Next: , Previous: , Up: posix   [Index]


4.14 Memory–mapped input/output

(vicare-scheme)Shared memory through mmap for a description of shared memory through mmap.

Function: mmap address length protect flags fd offset

Interface to the C function mmap(), (libc)mmap. Create a new mapping and return a pointer object referencing the region of memory.

address can be #f or a pointer object; #f is interpreted as a NULL pointer. length must be an exact integer in the range of the C language type size_t. protect and flags must fixnums of flags. fd must be a fixnum representing a file descriptor. offset must be an exact integer in the range of the C language type off_t.

NOTE On BSD and Darwin systems only MAP_ANON is defined, MAP_ANONYMOUS is undefined.

Function: munmap address length

Interface to the C function munmap(), (libc)munmap. Remove memory mapping. Return unspecified values.

address is a pointer object referencing the mapping. length must be an exact integer in the range of the C language type size_t.

Function: msync address length flags

Interface to the C function msync(), (libc)msync. Synchronise the mapping with the underlying file. Return unspecified values.

address is a pointer object referencing the mapping. length must be an exact integer in the range of the C language type size_t. flags is a fixnum of flags.

Function: mremap address length new-length flags

Interface to the C function mremap(), (libc)mremap. Change the size of an existing memory mapping; return a pointer object referencing the new mapping.

address is a pointer object referencing the mapping. length and new-length must be exact integers in the range of the C language type size_t. flags is a fixnum of flags.

Function: madvise address length advice

Interface to the C function madvise(), (libc)madvise. Synchronise the mapping with the underlying file. Return unspecified values.

address is a pointer object referencing the mapping. length must be an exact integer in the range of the C language type size_t. advice is a fixnum of flags.

Function: mlock address length
Function: munlock address length

Interface to the C functions mlock() and munlock(), see the manual page mlock(2). Lock or unlock a segment of virtual address space, preventing the memory from begin paged to the swap area. If successful return unspecified values, else raise an exception.

Function: mlockall flags
Function: munlockall

Interface to the C functions mlockall() and munlockall(), see the manual page mlock(2). Lock or unlock all pages. If successful return unspecified values, else raise an exception. flags must be a fixnum being an OR combination of the constants: MCL_CURRENT, MCL_FUTURE.


Next: , Previous: , Up: posix   [Index]