mmap (size, prot_flags, share_flags, shm_file, offset)
The size (in bytes) of the shared memory segment to map.
Access capability flags.
Sharing flags.
A file descriptor as returned by shm_open.
An offset from the beginning of the shared memory area.
This function is currently only available in QNX 4. It implements the C mmap function call, returning a buffer which maps to the shared memory region. The shm_open function needs to be called before using this function.
The prot_flags specifies the access capability. Valid prot_flags are bitwise OR-ed combinations of:
PROT_EXEC The region can be executed.
PROT_NOCACHE Disable caching of the region (use for dual port RAM).
PROT_NONE The region cannot be accessed.
PROT_READ The region can be read.
PROT_WRITE The region can be written.
The share_flags specify the handling of the memory region. Valid share_flags are bitwise OR-ed combinations of:
MAP_PRIVATE Changes are private.
MAP_SHARED Share changes.
Remember to require the "const/mman.lsp" file before using these constants.
Possible errors when using this function are:
EACCES The shm_file is not open for the correct mode
EAGAIN The mapping could not be locked in memory due to a lack of resources
EBADF The passed shm_file is bad.
EINVAL The prot_flags of share_flags argument is invalid
ENODEV The shm_file arg refers to an argument for which mmap is meaningless
ENOMEM The mapping could not be locked because it would require more space than the system is able to supply
ENOSYS The function mmap is not supported by this implementation
ENOTSUP MAP_PRIVATE was specified but the implementation does not support this functionality
ENXIO The offset or size arguments are invalid.
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.