$NetBSD: patch-ad,v 1.1 2001/10/29 19:33:50 jlam Exp $ --- apc_shm.c.orig Sat Mar 24 17:15:50 2001 +++ apc_shm.c @@ -22,12 +22,17 @@ #include #include +#if defined(__NetBSD__) +#define IPC_PERMS ((S_IRUSR|S_IWUSR) | (S_IRGRP|S_IWGRP) | (S_IROTH|S_IWOTH)) +#else #ifndef SHM_R # define SHM_R 0444 /* read permission */ #endif #ifndef SHM_A # define SHM_A 0222 /* write permission */ #endif +#define IPC_PERMS (SHM_R|SHM_A) +#endif /* apc_shm_create: create a shared memory segment of given size */ int apc_shm_create(const char* pathname, int proj, int size) @@ -44,7 +49,7 @@ } } - oflag = IPC_CREAT | SHM_R | SHM_A; + oflag = IPC_CREAT | IPC_PERMS; if ((shmid = shmget(key, size, oflag)) < 0) { apc_eprint("apc_shmcreate: shmget(%d, %d,%d) failed: %s", key, size, oflag, strerror(errno)); }