SYS$MGBLSC (OpenVMS) SYS$MGBLSC (OpenVMS)
NAME
mmap - map file system object into virtual memory
SYS$MGBLSC - Map global section
EXPLAINATION
The Digital UNIX mmap system call is similar to the OpenVMS SYS$MGBLSC
system service in that they both allow the calling program to map a
file into virtual memory. The mmap function can be called with the
It is possible to create memory mapped files that are shared among pro‐
cesses by mapping a file in with the MAP_FILE and MAP_SHARED flags set.
Other processes that now map this file will share the data. Mapping a
file with MAP_PRIVATE will cause changes to the file to be changed only
for that process. The changes are not written back to the file. A
mapped file may not be written out to disk until the msync function is
called or until the memory it is mapped to is paged out. Memory mapped
regions are inherited by children after a fork call, but are unmapped
after an exec unless marked as inheritable with MAP_INHERIT. The mmap
system call can subsume most of the functionality of the shmget family
of calls except that it must have a backing store file for a shared
virtual memory mapping for unrelated processes. Related processes can
either mmap /dev/zero or specify the MAP_ANONYMOUS flag and a file
descriptor of -1. Note that the file to be mapped must first be opened
with the open(2) system call.
RELATED INFORMATION
Digital UNIX Functions:
mmap(2), munmap(2), msync(2), mprotect(2), madvise(2), exec(2),
open(2) delim off
SYS$MGBLSC (OpenVMS)