Closed Kevin-Jin closed 7 years ago
By default, the O_CREAT
flag should be set for shared memory so that it is created if it does not already exist. Do not set the flag for file-backed memory so that, by default, the mmap
R constructor fails if the file does not already exist. In any case, this behavior should all be customizable by the user through the oflag
parameter to the mmap
R constructor.
Currently, files are always opened with
O_RDWR
. However,O_RDONLY
may be sufficient for users who'll never requestPROT_WRITE
. If this is the case, the user should be able to specifyoflag
to the POSIXopen()
andshm_open()
functions so that the file system does not deny access to the file. As usual, perform the necessary translations to support the same behavior on the Win32 analogues.In order to fully support
oflag
, then theO_CREAT
flag must be supported and so must themode
parameter ofopen()
andshm_open()
. The behavior ofmode
is probably best emulated by Windows's access control lists using the concepts of effective user and primary group.