Add SO_PEERSEC and SO_PASSSEC for all linux archs and android

SO_PASSSEC and SO_PEERSEC were already added for the most common archs
such as x86_64 and aarch64, but were missing on for example x86.

Sources:
* linux mips: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/mips/include/uapi/asm/socket.h
* linux sparc: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/sparc/include/uapi/asm/socket.h
* other linux: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/socket.h
* android: https://android.googlesource.com/platform/bionic.git/+/refs/heads/master/libc/kernel/uapi/asm-generic/socket.h
This commit is contained in:
Torbjørn Birch Moltu 2021-03-07 20:47:46 +01:00
parent 0f40951415
commit fe4be350a8
16 changed files with 32 additions and 0 deletions

View File

@ -1078,8 +1078,10 @@ pub const SO_SNDTIMEO: ::c_int = 21;
pub const SO_BINDTODEVICE: ::c_int = 25;
pub const SO_TIMESTAMP: ::c_int = 29;
pub const SO_ACCEPTCONN: ::c_int = 30;
pub const SO_PEERSEC: ::c_int = 31;
pub const SO_SNDBUFFORCE: ::c_int = 32;
pub const SO_RCVBUFFORCE: ::c_int = 33;
pub const SO_PASSSEC: ::c_int = 34;
pub const SO_MARK: ::c_int = 36;
pub const SO_PROTOCOL: ::c_int = 38;
pub const SO_DOMAIN: ::c_int = 39;

View File

@ -321,8 +321,10 @@ pub const SO_RCVLOWAT: ::c_int = 18;
pub const SO_SNDLOWAT: ::c_int = 19;
pub const SO_RCVTIMEO: ::c_int = 20;
pub const SO_SNDTIMEO: ::c_int = 21;
pub const SO_PEERSEC: ::c_int = 31;
pub const SO_SNDBUFFORCE: ::c_int = 32;
pub const SO_RCVBUFFORCE: ::c_int = 33;
pub const SO_PASSSEC: ::c_int = 34;
pub const SA_SIGINFO: ::c_int = 0x00000004;
pub const SA_NOCLDWAIT: ::c_int = 0x00000002;

View File

@ -325,6 +325,8 @@ pub const SO_RCVTIMEO: ::c_int = 18;
pub const SO_SNDTIMEO: ::c_int = 19;
pub const SO_PASSCRED: ::c_int = 20;
pub const SO_PEERCRED: ::c_int = 21;
pub const SO_PEERSEC: ::c_int = 31;
pub const SO_PASSSEC: ::c_int = 34;
pub const SA_SIGINFO: ::c_int = 0x00000004;
pub const SA_NOCLDWAIT: ::c_int = 0x00000002;

View File

@ -324,6 +324,8 @@ pub const SOL_SOCKET: ::c_int = 0xffff;
pub const SO_PASSCRED: ::c_int = 2;
pub const SO_REUSEADDR: ::c_int = 4;
pub const SO_PEERSEC: ::c_int = 0x001e;
pub const SO_PASSSEC: ::c_int = 0x001f;
pub const SO_TYPE: ::c_int = 0x1008;
pub const SO_ERROR: ::c_int = 0x1007;
pub const SO_DONTROUTE: ::c_int = 16;

View File

@ -526,6 +526,8 @@ pub const SO_RCVLOWAT: ::c_int = 18;
pub const SO_SNDLOWAT: ::c_int = 19;
pub const SO_RCVTIMEO: ::c_int = 20;
pub const SO_SNDTIMEO: ::c_int = 21;
pub const SO_PEERSEC: ::c_int = 31;
pub const SO_PASSSEC: ::c_int = 34;
pub const SA_SIGINFO: ::c_int = 0x00000004;
pub const SA_NOCLDWAIT: ::c_int = 0x00000002;

View File

@ -486,8 +486,10 @@ pub const SO_PEERCRED: ::c_int = 17;
pub const SO_RCVLOWAT: ::c_int = 18;
pub const SO_SNDLOWAT: ::c_int = 19;
pub const SO_ACCEPTCONN: ::c_int = 30;
pub const SO_PEERSEC: ::c_int = 31;
pub const SO_SNDBUFFORCE: ::c_int = 32;
pub const SO_RCVBUFFORCE: ::c_int = 33;
pub const SO_PASSSEC: ::c_int = 34;
pub const SIGTTIN: ::c_int = 21;
pub const SIGTTOU: ::c_int = 22;

View File

@ -334,6 +334,8 @@ pub const SO_PASSCRED: ::c_int = 2;
pub const SO_REUSEADDR: ::c_int = 4;
pub const SO_BINDTODEVICE: ::c_int = 0x000d;
pub const SO_TIMESTAMP: ::c_int = 0x001d;
pub const SO_PEERSEC: ::c_int = 0x001e;
pub const SO_PASSSEC: ::c_int = 0x001f;
pub const SO_MARK: ::c_int = 0x0022;
pub const SO_RXQ_OVFL: ::c_int = 0x0024;
pub const SO_PEEK_OFF: ::c_int = 0x0026;

View File

@ -377,8 +377,10 @@ pub const SO_SNDLOWAT: ::c_int = 19;
pub const SO_RCVTIMEO: ::c_int = 20;
pub const SO_SNDTIMEO: ::c_int = 21;
pub const SO_ACCEPTCONN: ::c_int = 30;
pub const SO_PEERSEC: ::c_int = 31;
pub const SO_SNDBUFFORCE: ::c_int = 32;
pub const SO_RCVBUFFORCE: ::c_int = 33;
pub const SO_PASSSEC: ::c_int = 34;
pub const SO_PROTOCOL: ::c_int = 38;
pub const SO_DOMAIN: ::c_int = 39;

View File

@ -388,8 +388,10 @@ pub const SO_PRIORITY: ::c_int = 12;
pub const SO_BSDCOMPAT: ::c_int = 14;
pub const SO_PASSCRED: ::c_int = 17;
pub const SO_PEERCRED: ::c_int = 18;
pub const SO_PEERSEC: ::c_int = 30;
pub const SO_SNDBUFFORCE: ::c_int = 31;
pub const SO_RCVBUFFORCE: ::c_int = 33;
pub const SO_PASSSEC: ::c_int = 34;
pub const SA_ONSTACK: ::c_int = 0x08000000;
pub const SA_SIGINFO: ::c_int = 8;

View File

@ -379,8 +379,10 @@ pub const SO_SNDTIMEO: ::c_int = 19;
pub const SO_PASSCRED: ::c_int = 20;
pub const SO_PEERCRED: ::c_int = 21;
pub const SO_ACCEPTCONN: ::c_int = 30;
pub const SO_PEERSEC: ::c_int = 31;
pub const SO_SNDBUFFORCE: ::c_int = 32;
pub const SO_RCVBUFFORCE: ::c_int = 33;
pub const SO_PASSSEC: ::c_int = 34;
pub const SO_PROTOCOL: ::c_int = 38;
pub const SO_DOMAIN: ::c_int = 39;

View File

@ -437,8 +437,10 @@ pub const SO_SNDLOWAT: ::c_int = 19;
pub const SO_RCVTIMEO: ::c_int = 20;
pub const SO_SNDTIMEO: ::c_int = 21;
pub const SO_ACCEPTCONN: ::c_int = 30;
pub const SO_PEERSEC: ::c_int = 31;
pub const SO_SNDBUFFORCE: ::c_int = 32;
pub const SO_RCVBUFFORCE: ::c_int = 33;
pub const SO_PASSSEC: ::c_int = 34;
pub const SO_PROTOCOL: ::c_int = 38;
pub const SO_DOMAIN: ::c_int = 39;

View File

@ -598,6 +598,8 @@ pub const SO_RCVLOWAT: ::c_int = 18;
pub const SO_SNDLOWAT: ::c_int = 19;
pub const SO_RCVTIMEO: ::c_int = 20;
pub const SO_SNDTIMEO: ::c_int = 21;
pub const SO_PEERSEC: ::c_int = 31;
pub const SO_PASSSEC: ::c_int = 34;
pub const EXTPROC: ::tcflag_t = 0x00010000;
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;

View File

@ -613,6 +613,8 @@ pub const SO_RCVLOWAT: ::c_int = 16;
pub const SO_SNDLOWAT: ::c_int = 17;
pub const SO_RCVTIMEO: ::c_int = 18;
pub const SO_SNDTIMEO: ::c_int = 19;
pub const SO_PEERSEC: ::c_int = 31;
pub const SO_PASSSEC: ::c_int = 34;
pub const EXTPROC: ::tcflag_t = 0x10000000;
pub const VEOL: usize = 6;
pub const VEOL2: usize = 8;

View File

@ -903,6 +903,8 @@ pub const SO_RCVLOWAT: ::c_int = 18;
pub const SO_SNDLOWAT: ::c_int = 19;
pub const SO_RCVTIMEO: ::c_int = 20;
pub const SO_SNDTIMEO: ::c_int = 21;
pub const SO_PEERSEC: ::c_int = 31;
pub const SO_PASSSEC: ::c_int = 34;
pub const EXTPROC: ::tcflag_t = 0x00010000;
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;

View File

@ -262,6 +262,8 @@ pub const MAP_HUGETLB: ::c_int = 0x040000; // from linux/other/mod.rs
pub const SO_BUSY_POLL: ::c_int = 46; // from src/unix/linux_like/mod.rs
pub const SO_PEEK_OFF: ::c_int = 42; // from src/unix/linux_like/mod.rs
pub const SO_REUSEPORT: ::c_int = 15; // from src/unix/linux_like/mod.rs
pub const SO_PEERSEC: ::c_int = 31;
pub const SO_PASSSEC: ::c_int = 34;
// autogenerated constants with hand tuned types
pub const B0: ::speed_t = 0;

View File

@ -324,6 +324,8 @@ pub const SO_RCVTIMEO: ::c_int = 20;
pub const SO_REUSEADDR: ::c_int = 2;
pub const SO_SNDTIMEO: ::c_int = 21;
pub const SO_TIMESTAMP: ::c_int = 0x1d;
pub const SO_PEERSEC: ::c_int = 31;
pub const SO_PASSSEC: ::c_int = 34;
pub const RLIM_INFINITY: u64 = 0xffffffffffffffff;
pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;