Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
File List
Globals
EXTERNAL_HEADERS
RSL
etc
config
src
MMAP.cpp
Go to the documentation of this file.
1
// checking for mmap() and munmap() in <sys/mman.h>
2
3
25
#include <sys/mman.h>
26
#include <sys/types.h>
27
28
29
void
*
map_file
(
int
fd)
30
{
31
return
mmap (0, 4096, PROT_READ,
MAP_PRIVATE
, fd, 0);
32
}
33
34
35
int
main
(
int
argc,
char
*argv[])
36
{
37
// avoid executing the code except when one or more command
38
// line arguments have been specified
39
if
(argc < 2)
40
return
0;
41
42
void
*
p
=
map_file
(argc);
43
munmap (
p
, 0);
44
45
return
0;
46
}
p
#define p
Definition
17.names.cpp:132
main
#define main
Definition
BAD_ALLOC_COPY_CTOR.cpp:32
map_file
void * map_file(int fd)
Definition
MMAP.cpp:29
MAP_PRIVATE
#define MAP_PRIVATE
Definition
alloc.cpp:166
Generated by
1.9.8