1MMAP2(2) Linux Programmer's Manual MMAP2(2)
2
3
4
6 mmap2 - map files or devices into memory
7
9 #include <sys/mman.h>
10 #include <syscall.h>
11 #include <errno.h>
12
13 _syscall6(void *, mmap2, void *, start, size_t, length,
14 int, prot, int, flags, int, fd, off_t, pgoffset)
15 /* Using syscall(2) may be preferable; see intro(2) */
16
17 void * mmap2(void *start, size_t length, int prot,
18 int flags, int fd, off_t pgoffset);
19
21 The mmap2() system call operates in exactly the same way as mmap(2),
22 except that the final argument specifies the offset into the file in
23 4kB units (instead of bytes). This enables applications that use a
24 32-bit off_t to map larger files (typically up to 2^44 bytes).
25
27 On success, mmap2() returns a pointer to the mapped area. On error -1
28 is returned and errno is set appropriately.
29
31 EFAULT
32 Problem with getting the data from userspace.
33
35 mmap2() is available since Linux 2.3.31. It is Linux specific, and
36 should be avoided in portable applications. On 32-bit systems, mmap2()
37 is used to implement the mmap64() function that is part of the LFS
38 (Large File Summit).
39
41 This system call is Linux specific.
42
44 getpagesize(2), mmap(2), mremap(2), msync(2), shm_open(3)
45
46
47
48Linux 2.3.31 2002-01-31 MMAP2(2)