Commit 569802160e

Koakuma <koachan@protonmail.com>
2021-09-27 16:01:03
Linux: fix socket constants for SPARCv9
1 parent 834202b
Changed files (1)
lib
std
lib/std/os/linux.zig
@@ -2005,8 +2005,8 @@ pub const SOCK = struct {
     pub const SEQPACKET = 5;
     pub const DCCP = 6;
     pub const PACKET = 10;
-    pub const CLOEXEC = 0o2000000;
-    pub const NONBLOCK = if (is_mips) 0o200 else 0o4000;
+    pub const CLOEXEC = if (is_sparc) 0o20000000 else 0o2000000;
+    pub const NONBLOCK = if (is_mips) 0o200 else if (is_sparc) 0o40000 else 0o4000;
 };
 
 pub const TCP = struct {
@@ -2218,6 +2218,47 @@ pub const SO = struct {
         pub const PEERSEC = 30;
         pub const SNDBUFFORCE = 31;
         pub const RCVBUFFORCE = 33;
+        pub const SECURITY_AUTHENTICATION = 22;
+        pub const SECURITY_ENCRYPTION_TRANSPORT = 23;
+        pub const SECURITY_ENCRYPTION_NETWORK = 24;
+        pub const BINDTODEVICE = 25;
+        pub const ATTACH_FILTER = 26;
+        pub const DETACH_FILTER = 27;
+        pub const GET_FILTER = ATTACH_FILTER;
+        pub const PEERNAME = 28;
+        pub const TIMESTAMP_OLD = 29;
+        pub const PASSSEC = 34;
+        pub const TIMESTAMPNS_OLD = 35;
+        pub const MARK = 36;
+        pub const TIMESTAMPING_OLD = 37;
+        pub const RXQ_OVFL = 40;
+        pub const WIFI_STATUS = 41;
+        pub const PEEK_OFF = 42;
+        pub const NOFCS = 43;
+        pub const LOCK_FILTER = 44;
+        pub const SELECT_ERR_QUEUE = 45;
+        pub const BUSY_POLL = 46;
+        pub const MAX_PACING_RATE = 47;
+        pub const BPF_EXTENSIONS = 48;
+        pub const INCOMING_CPU = 49;
+        pub const ATTACH_BPF = 50;
+        pub const DETACH_BPF = DETACH_FILTER;
+        pub const ATTACH_REUSEPORT_CBPF = 51;
+        pub const ATTACH_REUSEPORT_EBPF = 52;
+        pub const CNX_ADVICE = 53;
+        pub const MEMINFO = 55;
+        pub const INCOMING_NAPI_ID = 56;
+        pub const COOKIE = 57;
+        pub const PEERGROUPS = 59;
+        pub const ZEROCOPY = 60;
+        pub const TXTIME = 61;
+        pub const BINDTOIFINDEX = 62;
+        pub const TIMESTAMP_NEW = 63;
+        pub const TIMESTAMPNS_NEW = 64;
+        pub const TIMESTAMPING_NEW = 65;
+        pub const RCVTIMEO_NEW = 66;
+        pub const SNDTIMEO_NEW = 67;
+        pub const DETACH_REUSEPORT_BPF = 68;
     } else if (is_ppc or is_ppc64) struct {
         pub const DEBUG = 1;
         pub const REUSEADDR = 2;
@@ -2246,6 +2287,116 @@ pub const SO = struct {
         pub const RCVBUFFORCE = 33;
         pub const PROTOCOL = 38;
         pub const DOMAIN = 39;
+        pub const SECURITY_AUTHENTICATION = 22;
+        pub const SECURITY_ENCRYPTION_TRANSPORT = 23;
+        pub const SECURITY_ENCRYPTION_NETWORK = 24;
+        pub const BINDTODEVICE = 25;
+        pub const ATTACH_FILTER = 26;
+        pub const DETACH_FILTER = 27;
+        pub const GET_FILTER = ATTACH_FILTER;
+        pub const PEERNAME = 28;
+        pub const TIMESTAMP_OLD = 29;
+        pub const PASSSEC = 34;
+        pub const TIMESTAMPNS_OLD = 35;
+        pub const MARK = 36;
+        pub const TIMESTAMPING_OLD = 37;
+        pub const RXQ_OVFL = 40;
+        pub const WIFI_STATUS = 41;
+        pub const PEEK_OFF = 42;
+        pub const NOFCS = 43;
+        pub const LOCK_FILTER = 44;
+        pub const SELECT_ERR_QUEUE = 45;
+        pub const BUSY_POLL = 46;
+        pub const MAX_PACING_RATE = 47;
+        pub const BPF_EXTENSIONS = 48;
+        pub const INCOMING_CPU = 49;
+        pub const ATTACH_BPF = 50;
+        pub const DETACH_BPF = DETACH_FILTER;
+        pub const ATTACH_REUSEPORT_CBPF = 51;
+        pub const ATTACH_REUSEPORT_EBPF = 52;
+        pub const CNX_ADVICE = 53;
+        pub const MEMINFO = 55;
+        pub const INCOMING_NAPI_ID = 56;
+        pub const COOKIE = 57;
+        pub const PEERGROUPS = 59;
+        pub const ZEROCOPY = 60;
+        pub const TXTIME = 61;
+        pub const BINDTOIFINDEX = 62;
+        pub const TIMESTAMP_NEW = 63;
+        pub const TIMESTAMPNS_NEW = 64;
+        pub const TIMESTAMPING_NEW = 65;
+        pub const RCVTIMEO_NEW = 66;
+        pub const SNDTIMEO_NEW = 67;
+        pub const DETACH_REUSEPORT_BPF = 68;
+    } else if (is_sparc) struct {
+        pub const DEBUG = 1;
+        pub const REUSEADDR = 4;
+        pub const TYPE = 4104;
+        pub const ERROR = 4103;
+        pub const DONTROUTE = 16;
+        pub const BROADCAST = 32;
+        pub const SNDBUF = 4097;
+        pub const RCVBUF = 4098;
+        pub const KEEPALIVE = 8;
+        pub const OOBINLINE = 256;
+        pub const NO_CHECK = 11;
+        pub const PRIORITY = 12;
+        pub const LINGER = 128;
+        pub const BSDCOMPAT = 1024;
+        pub const REUSEPORT = 512;
+        pub const PASSCRED = 2;
+        pub const PEERCRED = 64;
+        pub const RCVLOWAT = 2048;
+        pub const SNDLOWAT = 4096;
+        pub const RCVTIMEO = 8192;
+        pub const SNDTIMEO = 16384;
+        pub const ACCEPTCONN = 32768;
+        pub const PEERSEC = 30;
+        pub const SNDBUFFORCE = 4106;
+        pub const RCVBUFFORCE = 4107;
+        pub const PROTOCOL = 4136;
+        pub const DOMAIN = 4137;
+        pub const SECURITY_AUTHENTICATION = 20481;
+        pub const SECURITY_ENCRYPTION_TRANSPORT = 20482;
+        pub const SECURITY_ENCRYPTION_NETWORK = 20484;
+        pub const BINDTODEVICE = 13;
+        pub const ATTACH_FILTER = 26;
+        pub const DETACH_FILTER = 27;
+        pub const GET_FILTER = 26;
+        pub const PEERNAME = 28;
+        pub const TIMESTAMP_OLD = 29;
+        pub const PASSSEC = 31;
+        pub const TIMESTAMPNS_OLD = 33;
+        pub const MARK = 34;
+        pub const TIMESTAMPING_OLD = 35;
+        pub const RXQ_OVFL = 36;
+        pub const WIFI_STATUS = 37;
+        pub const PEEK_OFF = 38;
+        pub const NOFCS = 39;
+        pub const LOCK_FILTER = 40;
+        pub const SELECT_ERR_QUEUE = 41;
+        pub const BUSY_POLL = 48;
+        pub const MAX_PACING_RATE = 49;
+        pub const BPF_EXTENSIONS = 50;
+        pub const INCOMING_CPU = 51;
+        pub const ATTACH_BPF = 52;
+        pub const DETACH_BPF = 27;
+        pub const ATTACH_REUSEPORT_CBPF = 53;
+        pub const ATTACH_REUSEPORT_EBPF = 54;
+        pub const CNX_ADVICE = 55;
+        pub const MEMINFO = 57;
+        pub const INCOMING_NAPI_ID = 58;
+        pub const COOKIE = 59;
+        pub const PEERGROUPS = 61;
+        pub const ZEROCOPY = 62;
+        pub const TXTIME = 63;
+        pub const BINDTOIFINDEX = 65;
+        pub const TIMESTAMP_NEW = 70;
+        pub const TIMESTAMPNS_NEW = 66;
+        pub const TIMESTAMPING_NEW = 67;
+        pub const RCVTIMEO_NEW = 68;
+        pub const SNDTIMEO_NEW = 69;
+        pub const DETACH_REUSEPORT_BPF = 71;
     } else struct {
         pub const DEBUG = 1;
         pub const REUSEADDR = 2;
@@ -2274,53 +2425,48 @@ pub const SO = struct {
         pub const RCVBUFFORCE = 33;
         pub const PROTOCOL = 38;
         pub const DOMAIN = 39;
+        pub const SECURITY_AUTHENTICATION = 22;
+        pub const SECURITY_ENCRYPTION_TRANSPORT = 23;
+        pub const SECURITY_ENCRYPTION_NETWORK = 24;
+        pub const BINDTODEVICE = 25;
+        pub const ATTACH_FILTER = 26;
+        pub const DETACH_FILTER = 27;
+        pub const GET_FILTER = ATTACH_FILTER;
+        pub const PEERNAME = 28;
+        pub const TIMESTAMP_OLD = 29;
+        pub const PASSSEC = 34;
+        pub const TIMESTAMPNS_OLD = 35;
+        pub const MARK = 36;
+        pub const TIMESTAMPING_OLD = 37;
+        pub const RXQ_OVFL = 40;
+        pub const WIFI_STATUS = 41;
+        pub const PEEK_OFF = 42;
+        pub const NOFCS = 43;
+        pub const LOCK_FILTER = 44;
+        pub const SELECT_ERR_QUEUE = 45;
+        pub const BUSY_POLL = 46;
+        pub const MAX_PACING_RATE = 47;
+        pub const BPF_EXTENSIONS = 48;
+        pub const INCOMING_CPU = 49;
+        pub const ATTACH_BPF = 50;
+        pub const DETACH_BPF = DETACH_FILTER;
+        pub const ATTACH_REUSEPORT_CBPF = 51;
+        pub const ATTACH_REUSEPORT_EBPF = 52;
+        pub const CNX_ADVICE = 53;
+        pub const MEMINFO = 55;
+        pub const INCOMING_NAPI_ID = 56;
+        pub const COOKIE = 57;
+        pub const PEERGROUPS = 59;
+        pub const ZEROCOPY = 60;
+        pub const TXTIME = 61;
+        pub const BINDTOIFINDEX = 62;
+        pub const TIMESTAMP_NEW = 63;
+        pub const TIMESTAMPNS_NEW = 64;
+        pub const TIMESTAMPING_NEW = 65;
+        pub const RCVTIMEO_NEW = 66;
+        pub const SNDTIMEO_NEW = 67;
+        pub const DETACH_REUSEPORT_BPF = 68;
     };
-
-    pub const SECURITY_AUTHENTICATION = 22;
-    pub const SECURITY_ENCRYPTION_TRANSPORT = 23;
-    pub const SECURITY_ENCRYPTION_NETWORK = 24;
-
-    pub const BINDTODEVICE = 25;
-
-    pub const ATTACH_FILTER = 26;
-    pub const DETACH_FILTER = 27;
-    pub const GET_FILTER = ATTACH_FILTER;
-
-    pub const PEERNAME = 28;
-    pub const TIMESTAMP_OLD = 29;
-    pub const PASSSEC = 34;
-    pub const TIMESTAMPNS_OLD = 35;
-    pub const MARK = 36;
-    pub const TIMESTAMPING_OLD = 37;
-
-    pub const RXQ_OVFL = 40;
-    pub const WIFI_STATUS = 41;
-    pub const PEEK_OFF = 42;
-    pub const NOFCS = 43;
-    pub const LOCK_FILTER = 44;
-    pub const SELECT_ERR_QUEUE = 45;
-    pub const BUSY_POLL = 46;
-    pub const MAX_PACING_RATE = 47;
-    pub const BPF_EXTENSIONS = 48;
-    pub const INCOMING_CPU = 49;
-    pub const ATTACH_BPF = 50;
-    pub const DETACH_BPF = DETACH_FILTER;
-    pub const ATTACH_REUSEPORT_CBPF = 51;
-    pub const ATTACH_REUSEPORT_EBPF = 52;
-    pub const CNX_ADVICE = 53;
-    pub const MEMINFO = 55;
-    pub const INCOMING_NAPI_ID = 56;
-    pub const COOKIE = 57;
-    pub const PEERGROUPS = 59;
-    pub const ZEROCOPY = 60;
-    pub const TXTIME = 61;
-    pub const BINDTOIFINDEX = 62;
-    pub const TIMESTAMP_NEW = 63;
-    pub const TIMESTAMPNS_NEW = 64;
-    pub const TIMESTAMPING_NEW = 65;
-    pub const RCVTIMEO_NEW = 66;
-    pub const SNDTIMEO_NEW = 67;
-    pub const DETACH_REUSEPORT_BPF = 68;
 };
 
 pub const SCM = struct {
@@ -2331,7 +2477,7 @@ pub const SCM = struct {
 };
 
 pub const SOL = struct {
-    pub const SOCKET = if (is_mips) 65535 else 1;
+    pub const SOCKET = if (is_mips or is_sparc) 65535 else 1;
 
     pub const IP = 0;
     pub const IPV6 = 41;