00001 #ifndef WIBBLE_SYS_MMAP_H 00002 #define WIBBLE_SYS_MMAP_H 00003 00008 /* 00009 * Copyright (C) 2006--2008 Enrico Zini <enrico@enricozini.org> 00010 * 00011 * This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU General Public License 00022 * along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 */ 00025 00026 #include <string> 00027 00028 namespace wibble { 00029 namespace sys { 00030 00038 struct MMap 00039 { 00040 public: 00041 MMap(); 00042 MMap(const MMap& mmap); 00043 MMap(const std::string& filename); 00044 ~MMap(); 00045 00046 MMap& operator=(const MMap& mmap); 00047 00048 void map(const std::string& filename); 00049 void unmap(); 00050 00051 std::string filename; 00052 size_t size; 00053 int fd; 00054 const char* buf; 00055 00056 }; 00057 00058 } 00059 } 00060 00061 // vim:set ts=4 sw=4: 00062 #endif