1
0
mirror of https://github.com/PDP-10/klh10.git synced 2026-02-05 07:55:23 +00:00

Replace 0600 in shmget(2) call with symbolic constants.

Inspired by Rich Alderson's MacOS 10.6.8 changes.
He used IPC_CREAT+IPC_PRIVATE+IPC_R+IPC_W.
However, IPC_PRIVATE is a special value for the key argument, not shmflg.
Furthermore, adding IPC_CREAT to the flags when the key is IPC_PRIVATE
seems unnecessary but should not harm.

See http://pubs.opengroup.org/onlinepubs/9699919799/functions/shmget.html
for the "IEEE Std 1003.1-2008, 2016 Edition" version of shmget(2).
This commit is contained in:
Olaf Seibert
2016-11-27 17:10:00 +01:00
parent 8f37d8cf17
commit d218e5b03f

View File

@@ -1620,7 +1620,7 @@ os_mmcreate(register size_t memsiz,
** Note shmget will lose grossly if on a system where its size arg
** (defined as a u_int) is less than 32 bits!
*/
if ((shmid = shmget(IPC_PRIVATE, (u_int)memsiz, 0600)) == -1) {
if ((shmid = shmget(IPC_PRIVATE, (u_int)memsiz, IPC_CREAT|IPC_R|IPC_W)) == -1) {
fprintf(stderr, "[os_mmcreate: shmget failed for %ld bytes - %s]\n",
(long)memsiz, os_strerror(errno));
return FALSE;