Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netbsd/openbsd adding more IPC_* flags. #2324

Merged
merged 1 commit into from Aug 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions libc-test/build.rs
Expand Up @@ -422,6 +422,7 @@ fn test_openbsd(target: &str) {
"sys/ioctl.h",
"sys/mman.h",
"sys/resource.h",
"sys/shm.h",
"sys/socket.h",
"sys/time.h",
"sys/un.h",
Expand Down Expand Up @@ -960,6 +961,7 @@ fn test_netbsd(target: &str) {
"sys/mount.h",
"sys/ptrace.h",
"sys/resource.h",
"sys/shm.h",
"sys/socket.h",
"sys/statvfs.h",
"sys/sysctl.h",
Expand Down Expand Up @@ -1167,12 +1169,14 @@ fn test_dragonflybsd(target: &str) {
"sys/event.h",
"sys/file.h",
"sys/ioctl.h",
"sys/ipc.h",
"sys/mman.h",
"sys/mount.h",
"sys/ptrace.h",
"sys/resource.h",
"sys/rtprio.h",
"sys/sched.h",
"sys/shm.h",
"sys/socket.h",
"sys/stat.h",
"sys/statvfs.h",
Expand Down
14 changes: 14 additions & 0 deletions libc-test/semver/dragonfly.txt
Expand Up @@ -341,6 +341,16 @@ IFF_STATICARP
IFF_UP
INIT_PROCESS
IOV_MAX
IPC_CREAT
IPC_EXCL
IPC_M
IPC_NOWAIT
IPC_PRIVATE
IPC_R
IPC_RMID
IPC_SET
IPC_STAT
IPC_W
IPPROTO_3PC
IPPROTO_ADFS
IPPROTO_AH
Expand Down Expand Up @@ -827,6 +837,10 @@ SF_NOHISTORY
SF_NOUNLINK
SF_SETTABLE
SF_XLINK
SHM_R
SHM_RDONLY
SHM_RND
SHM_W
SIGEMT
SIGEV_KEVENT
SIGEV_NONE
Expand Down
5 changes: 5 additions & 0 deletions libc-test/semver/netbsd.txt
Expand Up @@ -351,11 +351,14 @@ INIT_PROCESS
IOV_MAX
IPC_CREAT
IPC_EXCL
IPC_M
IPC_NOWAIT
IPC_PRIVATE
IPC_R
IPC_RMID
IPC_SET
IPC_STAT
IPC_W
IPPROTO_AH
IPPROTO_CARP
IPPROTO_DCCP
Expand Down Expand Up @@ -800,6 +803,8 @@ SF_LOG
SF_SETTABLE
SF_SNAPINVAL
SF_SNAPSHOT
SHM_R
SHM_W
SIGEMT
SIGEV_NONE
SIGEV_SIGNAL
Expand Down
5 changes: 5 additions & 0 deletions libc-test/semver/openbsd.txt
Expand Up @@ -242,11 +242,14 @@ IFF_UP
IOV_MAX
IPC_CREAT
IPC_EXCL
IPC_M
IPC_NOWAIT
IPC_PRIVATE
IPC_R
IPC_RMID
IPC_SET
IPC_STAT
IPC_W
IPPROTO_AH
IPPROTO_CARP
IPPROTO_DIVERT
Expand Down Expand Up @@ -670,6 +673,8 @@ SF_APPEND
SF_ARCHIVED
SF_IMMUTABLE
SF_SETTABLE
SHM_R
SHM_W
SIGEMT
SIGINFO
SIGSTKSZ
Expand Down
15 changes: 0 additions & 15 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Expand Up @@ -10,7 +10,6 @@ pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
pub type idtype_t = ::c_uint;

pub type key_t = ::c_long;
pub type msglen_t = ::c_ulong;
pub type msgqnum_t = ::c_ulong;

Expand Down Expand Up @@ -1176,22 +1175,8 @@ pub const NET_RT_IFMALIST: ::c_int = 4;
pub const NET_RT_IFLISTL: ::c_int = 5;

// System V IPC
pub const IPC_PRIVATE: ::key_t = 0;
pub const IPC_CREAT: ::c_int = 0o1000;
pub const IPC_EXCL: ::c_int = 0o2000;
pub const IPC_NOWAIT: ::c_int = 0o4000;
pub const IPC_RMID: ::c_int = 0;
pub const IPC_SET: ::c_int = 1;
pub const IPC_STAT: ::c_int = 2;
pub const IPC_INFO: ::c_int = 3;
pub const IPC_R: ::c_int = 0o400;
pub const IPC_W: ::c_int = 0o200;
pub const IPC_M: ::c_int = 0o10000;
pub const MSG_NOERROR: ::c_int = 0o10000;
pub const SHM_RDONLY: ::c_int = 0o10000;
pub const SHM_RND: ::c_int = 0o20000;
pub const SHM_R: ::c_int = 0o400;
pub const SHM_W: ::c_int = 0o200;
pub const SHM_LOCK: ::c_int = 11;
pub const SHM_UNLOCK: ::c_int = 12;
pub const SHM_STAT: ::c_int = 13;
Expand Down
17 changes: 17 additions & 0 deletions src/unix/bsd/freebsdlike/mod.rs
Expand Up @@ -13,6 +13,7 @@ pub type speed_t = ::c_uint;
pub type nl_item = ::c_int;
pub type id_t = i64;
pub type vm_size_t = ::uintptr_t;
pub type key_t = ::c_long;

// elf.h

Expand Down Expand Up @@ -1358,6 +1359,22 @@ pub const TIME_ERROR: ::c_int = 5;
pub const REG_ENOSYS: ::c_int = -1;
pub const REG_ILLSEQ: ::c_int = 17;

pub const IPC_PRIVATE: ::key_t = 0;
pub const IPC_CREAT: ::c_int = 0o1000;
pub const IPC_EXCL: ::c_int = 0o2000;
pub const IPC_NOWAIT: ::c_int = 0o4000;
pub const IPC_RMID: ::c_int = 0;
pub const IPC_SET: ::c_int = 1;
pub const IPC_STAT: ::c_int = 2;
pub const IPC_R: ::c_int = 0o400;
pub const IPC_W: ::c_int = 0o200;
pub const IPC_M: ::c_int = 0o10000;

pub const SHM_RDONLY: ::c_int = 0o10000;
pub const SHM_RND: ::c_int = 0o20000;
pub const SHM_R: ::c_int = 0o400;
pub const SHM_W: ::c_int = 0o200;

safe_f! {
pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
status == 0x13
Expand Down
7 changes: 7 additions & 0 deletions src/unix/bsd/netbsdlike/mod.rs
Expand Up @@ -238,6 +238,13 @@ pub const IPC_RMID: ::c_int = 0;
pub const IPC_SET: ::c_int = 1;
pub const IPC_STAT: ::c_int = 2;

pub const IPC_R: ::c_int = 0o000400;
pub const IPC_W: ::c_int = 0o000200;
pub const IPC_M: ::c_int = 0o010000;

pub const SHM_R: ::c_int = IPC_R;
pub const SHM_W: ::c_int = IPC_W;

pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;

Expand Down