Add runtime translation support
[mplayer/kovensky.git] / osdep / mmap.h
blobdb7c136a9637900bc95b6e184a98cd9ce81076e0
1 /*
2 * mmap declaration header for systems with missing/nonfunctional sys/mman.h
4 * Copyright (c) 2008 KO Myung-Hun (komh@chollian.net)
6 * This file is part of MPlayer.
8 * MPlayer is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * MPlayer is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef MPLAYER_MMAP_H
24 #define MPLAYER_MMAP_H
26 #include <sys/types.h>
29 * Protections are chosen from these bits, or-ed together
31 #define PROT_NONE 0x00 /* no permissions */
32 #define PROT_READ 0x01 /* pages can be read */
33 #define PROT_WRITE 0x02 /* pages can be written */
34 #define PROT_EXEC 0x04 /* pages can be executed */
37 * Flags contain sharing type and options.
38 * Sharing types; choose one.
40 #define MAP_SHARED 0x0001 /* share changes */
41 #define MAP_PRIVATE 0x0002 /* changes are private */
42 #define MAP_FIXED 0x0010 /* map addr must be exactly as requested */
45 * Mapping type
47 #define MAP_ANON 0x1000 /* allocated from memory, swap space */
49 /* MAP_FAILED is defined in config.h */
51 #ifndef _MMAP_DECLARED
52 #define _MMAP_DECLARED
53 void *mmap( void *addr, size_t len, int prot, int flags, int fildes, off_t off );
54 #endif
55 int munmap( void *addr, size_t len );
56 int mprotect( void *addr, size_t len, int prot );
58 #endif /* MPLAYER_MMAP_H */