Skip to content

Commit dcdd332

Browse files
committed
netbsd/openbsd adding more IPC_* flags.
SHM flags, albeit obsolete, are used in couple of crates.
1 parent e02b7e5 commit dcdd332

File tree

7 files changed

+52
-15
lines changed

7 files changed

+52
-15
lines changed

libc-test/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ fn test_openbsd(target: &str) {
422422
"sys/ioctl.h",
423423
"sys/mman.h",
424424
"sys/resource.h",
425+
"sys/shm.h",
425426
"sys/socket.h",
426427
"sys/time.h",
427428
"sys/un.h",
@@ -960,6 +961,7 @@ fn test_netbsd(target: &str) {
960961
"sys/mount.h",
961962
"sys/ptrace.h",
962963
"sys/resource.h",
964+
"sys/shm.h",
963965
"sys/socket.h",
964966
"sys/statvfs.h",
965967
"sys/sysctl.h",
@@ -1167,12 +1169,14 @@ fn test_dragonflybsd(target: &str) {
11671169
"sys/event.h",
11681170
"sys/file.h",
11691171
"sys/ioctl.h",
1172+
"sys/ipc.h",
11701173
"sys/mman.h",
11711174
"sys/mount.h",
11721175
"sys/ptrace.h",
11731176
"sys/resource.h",
11741177
"sys/rtprio.h",
11751178
"sys/sched.h",
1179+
"sys/shm.h",
11761180
"sys/socket.h",
11771181
"sys/stat.h",
11781182
"sys/statvfs.h",

libc-test/semver/dragonfly.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,16 @@ IFF_STATICARP
341341
IFF_UP
342342
INIT_PROCESS
343343
IOV_MAX
344+
IPC_CREAT
345+
IPC_EXCL
346+
IPC_M
347+
IPC_NOWAIT
348+
IPC_PRIVATE
349+
IPC_R
350+
IPC_RMID
351+
IPC_SET
352+
IPC_STAT
353+
IPC_W
344354
IPPROTO_3PC
345355
IPPROTO_ADFS
346356
IPPROTO_AH
@@ -827,6 +837,10 @@ SF_NOHISTORY
827837
SF_NOUNLINK
828838
SF_SETTABLE
829839
SF_XLINK
840+
SHM_R
841+
SHM_RDONLY
842+
SHM_RND
843+
SHM_W
830844
SIGEMT
831845
SIGEV_KEVENT
832846
SIGEV_NONE

libc-test/semver/netbsd.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,14 @@ INIT_PROCESS
351351
IOV_MAX
352352
IPC_CREAT
353353
IPC_EXCL
354+
IPC_M
354355
IPC_NOWAIT
355356
IPC_PRIVATE
357+
IPC_R
356358
IPC_RMID
357359
IPC_SET
358360
IPC_STAT
361+
IPC_W
359362
IPPROTO_AH
360363
IPPROTO_CARP
361364
IPPROTO_DCCP
@@ -800,6 +803,8 @@ SF_LOG
800803
SF_SETTABLE
801804
SF_SNAPINVAL
802805
SF_SNAPSHOT
806+
SHM_R
807+
SHM_W
803808
SIGEMT
804809
SIGEV_NONE
805810
SIGEV_SIGNAL

libc-test/semver/openbsd.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,14 @@ IFF_UP
242242
IOV_MAX
243243
IPC_CREAT
244244
IPC_EXCL
245+
IPC_M
245246
IPC_NOWAIT
246247
IPC_PRIVATE
248+
IPC_R
247249
IPC_RMID
248250
IPC_SET
249251
IPC_STAT
252+
IPC_W
250253
IPPROTO_AH
251254
IPPROTO_CARP
252255
IPPROTO_DIVERT
@@ -670,6 +673,8 @@ SF_APPEND
670673
SF_ARCHIVED
671674
SF_IMMUTABLE
672675
SF_SETTABLE
676+
SHM_R
677+
SHM_W
673678
SIGEMT
674679
SIGINFO
675680
SIGSTKSZ

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ pub type fsblkcnt_t = u64;
1010
pub type fsfilcnt_t = u64;
1111
pub type idtype_t = ::c_uint;
1212

13-
pub type key_t = ::c_long;
1413
pub type msglen_t = ::c_ulong;
1514
pub type msgqnum_t = ::c_ulong;
1615

@@ -1176,22 +1175,8 @@ pub const NET_RT_IFMALIST: ::c_int = 4;
11761175
pub const NET_RT_IFLISTL: ::c_int = 5;
11771176

11781177
// System V IPC
1179-
pub const IPC_PRIVATE: ::key_t = 0;
1180-
pub const IPC_CREAT: ::c_int = 0o1000;
1181-
pub const IPC_EXCL: ::c_int = 0o2000;
1182-
pub const IPC_NOWAIT: ::c_int = 0o4000;
1183-
pub const IPC_RMID: ::c_int = 0;
1184-
pub const IPC_SET: ::c_int = 1;
1185-
pub const IPC_STAT: ::c_int = 2;
11861178
pub const IPC_INFO: ::c_int = 3;
1187-
pub const IPC_R: ::c_int = 0o400;
1188-
pub const IPC_W: ::c_int = 0o200;
1189-
pub const IPC_M: ::c_int = 0o10000;
11901179
pub const MSG_NOERROR: ::c_int = 0o10000;
1191-
pub const SHM_RDONLY: ::c_int = 0o10000;
1192-
pub const SHM_RND: ::c_int = 0o20000;
1193-
pub const SHM_R: ::c_int = 0o400;
1194-
pub const SHM_W: ::c_int = 0o200;
11951180
pub const SHM_LOCK: ::c_int = 11;
11961181
pub const SHM_UNLOCK: ::c_int = 12;
11971182
pub const SHM_STAT: ::c_int = 13;

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub type speed_t = ::c_uint;
1313
pub type nl_item = ::c_int;
1414
pub type id_t = i64;
1515
pub type vm_size_t = ::uintptr_t;
16+
pub type key_t = ::c_long;
1617

1718
// elf.h
1819

@@ -1358,6 +1359,22 @@ pub const TIME_ERROR: ::c_int = 5;
13581359
pub const REG_ENOSYS: ::c_int = -1;
13591360
pub const REG_ILLSEQ: ::c_int = 17;
13601361

1362+
pub const IPC_PRIVATE: ::key_t = 0;
1363+
pub const IPC_CREAT: ::c_int = 0o1000;
1364+
pub const IPC_EXCL: ::c_int = 0o2000;
1365+
pub const IPC_NOWAIT: ::c_int = 0o4000;
1366+
pub const IPC_RMID: ::c_int = 0;
1367+
pub const IPC_SET: ::c_int = 1;
1368+
pub const IPC_STAT: ::c_int = 2;
1369+
pub const IPC_R: ::c_int = 0o400;
1370+
pub const IPC_W: ::c_int = 0o200;
1371+
pub const IPC_M: ::c_int = 0o10000;
1372+
1373+
pub const SHM_RDONLY: ::c_int = 0o10000;
1374+
pub const SHM_RND: ::c_int = 0o20000;
1375+
pub const SHM_R: ::c_int = 0o400;
1376+
pub const SHM_W: ::c_int = 0o200;
1377+
13611378
safe_f! {
13621379
pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
13631380
status == 0x13

src/unix/bsd/netbsdlike/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,13 @@ pub const IPC_RMID: ::c_int = 0;
238238
pub const IPC_SET: ::c_int = 1;
239239
pub const IPC_STAT: ::c_int = 2;
240240

241+
pub const IPC_R: ::c_int = 0o000400;
242+
pub const IPC_W: ::c_int = 0o000200;
243+
pub const IPC_M: ::c_int = 0o010000;
244+
245+
pub const SHM_R: ::c_int = IPC_R;
246+
pub const SHM_W: ::c_int = IPC_W;
247+
241248
pub const MCL_CURRENT: ::c_int = 0x0001;
242249
pub const MCL_FUTURE: ::c_int = 0x0002;
243250

0 commit comments

Comments
 (0)