From 91897770daa905edfe820f791a3398110ebad45a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=C3=A1n=20de=20B=C3=BArca?= Date: Thu, 15 Jun 2023 04:23:59 -0700 Subject: [PATCH 1/2] Define additional Linux socket ioctls --- libc-test/semver/linux.txt | 7 +++++++ src/unix/linux_like/linux/mod.rs | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index 1b8700f02b16a..7f4fc72f419cc 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -751,8 +751,10 @@ FFDLY FF_CNT FF_MAX FILENAME_MAX +FIOGETOWN FIONCLEX FIONREAD +FIOSETOWN FLUSHO FOPEN_MAX FUTEX_BITSET_MATCH_ANY @@ -2361,6 +2363,7 @@ SIGRTMIN SIGSTKSZ SIOCADDMULTI SIOCADDRT +SIOCATMARK SIOCDARP SIOCDELMULTI SIOCDELRT @@ -2388,8 +2391,11 @@ SIOCGIFNETMASK SIOCGIFPFLAGS SIOCGIFSLAVE SIOCGIFTXQLEN +SIOCGPGRP SIOCGRARP SIOCGSKNS +SIOCGSTAMP_OLD +SIOCGSTAMPNS_OLD SIOGIFINDEX SIOCGMIIPHY SIOCGMIIREG @@ -2413,6 +2419,7 @@ SIOCSIFPFLAGS SIOCSIFSLAVE SIOCSIFTXQLEN SIOCSMIIREG +SIOCSPGRP SIOCSRARP SIOCOUTQNSD SIOCWANDEV diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index e52b3d3a85eae..643e0a9f86015 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -2745,6 +2745,13 @@ pub const NF_IP6_PRI_LAST: ::c_int = ::INT_MAX; // linux/netfilter_ipv6/ip6_tables.h pub const IP6T_SO_ORIGINAL_DST: ::c_int = 80; +pub const FIOSETOWN: ::c_ulong = 0x00008901; +pub const SIOCSPGRP: ::c_ulong = 0x00008902; +pub const FIOGETOWN: ::c_ulong = 0x00008903; +pub const SIOCGPGRP: ::c_ulong = 0x00008904; +pub const SIOCATMARK: ::c_ulong = 0x00008905; +pub const SIOCGSTAMP_OLD: ::c_ulong = 0x00008906; +pub const SIOCGSTAMPNS_OLD: ::c_ulong = 0x00008907; pub const SIOCADDRT: ::c_ulong = 0x0000890B; pub const SIOCDELRT: ::c_ulong = 0x0000890C; pub const SIOCGIFNAME: ::c_ulong = 0x00008910; From 4a5b962a9968645200b0e5efcd12d33fbe0d869e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=C3=A1n=20de=20B=C3=BArca?= Date: Thu, 15 Jun 2023 19:52:48 -0700 Subject: [PATCH 2/2] Define additional sockios for more Unix-like systems --- libc-test/semver/android.txt | 7 +++++++ libc-test/semver/apple.txt | 3 +++ libc-test/semver/dragonfly.txt | 3 +++ libc-test/semver/freebsd.txt | 3 +++ libc-test/semver/netbsd.txt | 3 +++ libc-test/semver/openbsd.txt | 3 +++ src/unix/bsd/mod.rs | 3 +++ src/unix/linux_like/android/mod.rs | 7 +++++++ 8 files changed, 32 insertions(+) diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt index 7659995d50721..a3daa61ec810e 100644 --- a/libc-test/semver/android.txt +++ b/libc-test/semver/android.txt @@ -605,9 +605,11 @@ FF_MAX FILE FILENAME_MAX FIOCLEX +FIOGETOWN FIONBIO FIONCLEX FIONREAD +FIOSETOWN FLUSHO FOPEN_MAX FUTEX_CLOCK_REALTIME @@ -2135,6 +2137,7 @@ SIG_SETMASK SIG_UNBLOCK SIOCADDMULTI SIOCADDRT +SIOCATMARK SIOCDARP SIOCDELMULTI SIOCDELRT @@ -2154,7 +2157,10 @@ SIOCGIFMTU SIOCGIFNAME SIOCGIFNETMASK SIOCGIFSLAVE +SIOCGPGRP SIOCGRARP +SIOCGSTAMP_OLD +SIOCGSTAMPNS_OLD SIOCSARP SIOCSIFADDR SIOCSIFBRDADDR @@ -2169,6 +2175,7 @@ SIOCSIFMETRIC SIOCSIFMTU SIOCSIFNETMASK SIOCSIFSLAVE +SIOCSPGRP SIOCSRARP SI_LOAD_SHIFT SMB_SUPER_MAGIC diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index 244fe7d780c02..0202937f666a5 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -1289,7 +1289,10 @@ SIGINFO SIGIO SIGNATURE SIGSTKSZ +SIOCATMARK SIOCGIFADDR +SIOCGPGRP +SIOCSPGRP SOCK_MAXADDRLEN SOCK_RAW SOCK_RDM diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt index e27bfa41831a8..bf38ca4661813 100644 --- a/libc-test/semver/dragonfly.txt +++ b/libc-test/semver/dragonfly.txt @@ -918,7 +918,10 @@ SIGINFO SIGIO SIGNATURE SIGSTKSZ +SIOCATMARK SIOCGIFADDR +SIOCGPGRP +SIOCSPGRP SLIPDISC SOCK_CLOEXEC SOCK_MAXADDRLEN diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index e12a3642a8171..da8a8c4920541 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -1313,7 +1313,10 @@ SIGLIBRT SIGLWP SIGSTKSZ SIGTHR +SIOCATMARK SIOCGIFADDR +SIOCGPGRP +SIOCSPGRP SLIPDISC SOCKCREDSIZE SOCK_CLOEXEC diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt index 6150dbb81c41c..afd2e74f219fa 100644 --- a/libc-test/semver/netbsd.txt +++ b/libc-test/semver/netbsd.txt @@ -941,7 +941,10 @@ SIGINFO SIGIO SIGNATURE SIGSTKSZ +SIOCATMARK SIOCGIFADDR +SIOCGPGRP +SIOCSPGRP SOCKCREDSIZE SOCK_CLOEXEC SOCK_CONN_DGRAM diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt index afbf8eb572869..ad7acfc819b15 100644 --- a/libc-test/semver/openbsd.txt +++ b/libc-test/semver/openbsd.txt @@ -770,7 +770,10 @@ SIGEMT SIGINFO SIGIO SIGSTKSZ +SIOCATMARK SIOCGIFADDR +SIOCGPGRP +SIOCSPGRP SOCK_CLOEXEC SOCK_DNS SOCK_NONBLOCK diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 6ce041357ebee..f167edd141fc9 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -494,6 +494,9 @@ pub const BIOCVERSION: ::c_ulong = 0x40044271; pub const BIOCGHDRCMPLT: ::c_ulong = 0x40044274; pub const BIOCSHDRCMPLT: ::c_ulong = 0x80044275; pub const SIOCGIFADDR: ::c_ulong = 0xc0206921; +pub const SIOCATMARK: ::c_ulong = 0x40047307; +pub const SIOCSPGRP: ::c_ulong = 0x80047308; +pub const SIOCGPGRP: ::c_ulong = 0x40047309; pub const REG_BASIC: ::c_int = 0o0000; pub const REG_EXTENDED: ::c_int = 0o0001; diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index 91b19e6c08bd3..bc0ddf77ab7a2 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -2580,6 +2580,13 @@ pub const ETH_P_XDSA: ::c_int = 0x00F8; /* see rust-lang/libc#924 pub const ETH_P_MAP: ::c_int = 0x00F9;*/ // end android/platform/bionic/libc/kernel/uapi/linux/if_ether.h +pub const FIOSETOWN: ::c_ulong = 0x00008901; +pub const SIOCSPGRP: ::c_ulong = 0x00008902; +pub const FIOGETOWN: ::c_ulong = 0x00008903; +pub const SIOCGPGRP: ::c_ulong = 0x00008904; +pub const SIOCATMARK: ::c_ulong = 0x00008905; +pub const SIOCGSTAMP_OLD: ::c_ulong = 0x00008906; +pub const SIOCGSTAMPNS_OLD: ::c_ulong = 0x00008907; pub const SIOCADDRT: ::c_ulong = 0x0000890B; pub const SIOCDELRT: ::c_ulong = 0x0000890C; pub const SIOCGIFNAME: ::c_ulong = 0x00008910;