authorgravatar for koachan@protonmail.comKoakuma <koachan@protonmail.com> 2021-09-27 21:01:03+07:00
committergravatar for koachan@protonmail.comKoakuma <koachan@protonmail.com> 2021-10-10 09:13:18+07:00
log569802160e187b9a51e5e62b3f456b6680973e0c
tree4afe5d568288a18d2a799ca4866a0bab85876554
parent834202bf985c257b2bf79df7cb804af9cb0ca422

Linux: fix socket constants for SPARCv9


1 files changed, 195 insertions(+), 49 deletions(-)

lib/std/os/linux.zig+195-49
......@@ -2005,8 +2005,8 @@ pub const SOCK = struct {
20052005 pub const SEQPACKET = 5;
20062006 pub const DCCP = 6;
20072007 pub const PACKET = 10;
2008 pub const CLOEXEC = 0o2000000;
2009 pub const NONBLOCK = if (is_mips) 0o200 else 0o4000;
2008 pub const CLOEXEC = if (is_sparc) 0o20000000 else 0o2000000;
2009 pub const NONBLOCK = if (is_mips) 0o200 else if (is_sparc) 0o40000 else 0o4000;
20102010};
20112011
20122012pub const TCP = struct {
......@@ -2218,6 +2218,47 @@ pub const SO = struct {
22182218 pub const PEERSEC = 30;
22192219 pub const SNDBUFFORCE = 31;
22202220 pub const RCVBUFFORCE = 33;
2221 pub const SECURITY_AUTHENTICATION = 22;
2222 pub const SECURITY_ENCRYPTION_TRANSPORT = 23;
2223 pub const SECURITY_ENCRYPTION_NETWORK = 24;
2224 pub const BINDTODEVICE = 25;
2225 pub const ATTACH_FILTER = 26;
2226 pub const DETACH_FILTER = 27;
2227 pub const GET_FILTER = ATTACH_FILTER;
2228 pub const PEERNAME = 28;
2229 pub const TIMESTAMP_OLD = 29;
2230 pub const PASSSEC = 34;
2231 pub const TIMESTAMPNS_OLD = 35;
2232 pub const MARK = 36;
2233 pub const TIMESTAMPING_OLD = 37;
2234 pub const RXQ_OVFL = 40;
2235 pub const WIFI_STATUS = 41;
2236 pub const PEEK_OFF = 42;
2237 pub const NOFCS = 43;
2238 pub const LOCK_FILTER = 44;
2239 pub const SELECT_ERR_QUEUE = 45;
2240 pub const BUSY_POLL = 46;
2241 pub const MAX_PACING_RATE = 47;
2242 pub const BPF_EXTENSIONS = 48;
2243 pub const INCOMING_CPU = 49;
2244 pub const ATTACH_BPF = 50;
2245 pub const DETACH_BPF = DETACH_FILTER;
2246 pub const ATTACH_REUSEPORT_CBPF = 51;
2247 pub const ATTACH_REUSEPORT_EBPF = 52;
2248 pub const CNX_ADVICE = 53;
2249 pub const MEMINFO = 55;
2250 pub const INCOMING_NAPI_ID = 56;
2251 pub const COOKIE = 57;
2252 pub const PEERGROUPS = 59;
2253 pub const ZEROCOPY = 60;
2254 pub const TXTIME = 61;
2255 pub const BINDTOIFINDEX = 62;
2256 pub const TIMESTAMP_NEW = 63;
2257 pub const TIMESTAMPNS_NEW = 64;
2258 pub const TIMESTAMPING_NEW = 65;
2259 pub const RCVTIMEO_NEW = 66;
2260 pub const SNDTIMEO_NEW = 67;
2261 pub const DETACH_REUSEPORT_BPF = 68;
22212262 } else if (is_ppc or is_ppc64) struct {
22222263 pub const DEBUG = 1;
22232264 pub const REUSEADDR = 2;
......@@ -2246,6 +2287,116 @@ pub const SO = struct {
22462287 pub const RCVBUFFORCE = 33;
22472288 pub const PROTOCOL = 38;
22482289 pub const DOMAIN = 39;
2290 pub const SECURITY_AUTHENTICATION = 22;
2291 pub const SECURITY_ENCRYPTION_TRANSPORT = 23;
2292 pub const SECURITY_ENCRYPTION_NETWORK = 24;
2293 pub const BINDTODEVICE = 25;
2294 pub const ATTACH_FILTER = 26;
2295 pub const DETACH_FILTER = 27;
2296 pub const GET_FILTER = ATTACH_FILTER;
2297 pub const PEERNAME = 28;
2298 pub const TIMESTAMP_OLD = 29;
2299 pub const PASSSEC = 34;
2300 pub const TIMESTAMPNS_OLD = 35;
2301 pub const MARK = 36;
2302 pub const TIMESTAMPING_OLD = 37;
2303 pub const RXQ_OVFL = 40;
2304 pub const WIFI_STATUS = 41;
2305 pub const PEEK_OFF = 42;
2306 pub const NOFCS = 43;
2307 pub const LOCK_FILTER = 44;
2308 pub const SELECT_ERR_QUEUE = 45;
2309 pub const BUSY_POLL = 46;
2310 pub const MAX_PACING_RATE = 47;
2311 pub const BPF_EXTENSIONS = 48;
2312 pub const INCOMING_CPU = 49;
2313 pub const ATTACH_BPF = 50;
2314 pub const DETACH_BPF = DETACH_FILTER;
2315 pub const ATTACH_REUSEPORT_CBPF = 51;
2316 pub const ATTACH_REUSEPORT_EBPF = 52;
2317 pub const CNX_ADVICE = 53;
2318 pub const MEMINFO = 55;
2319 pub const INCOMING_NAPI_ID = 56;
2320 pub const COOKIE = 57;
2321 pub const PEERGROUPS = 59;
2322 pub const ZEROCOPY = 60;
2323 pub const TXTIME = 61;
2324 pub const BINDTOIFINDEX = 62;
2325 pub const TIMESTAMP_NEW = 63;
2326 pub const TIMESTAMPNS_NEW = 64;
2327 pub const TIMESTAMPING_NEW = 65;
2328 pub const RCVTIMEO_NEW = 66;
2329 pub const SNDTIMEO_NEW = 67;
2330 pub const DETACH_REUSEPORT_BPF = 68;
2331 } else if (is_sparc) struct {
2332 pub const DEBUG = 1;
2333 pub const REUSEADDR = 4;
2334 pub const TYPE = 4104;
2335 pub const ERROR = 4103;
2336 pub const DONTROUTE = 16;
2337 pub const BROADCAST = 32;
2338 pub const SNDBUF = 4097;
2339 pub const RCVBUF = 4098;
2340 pub const KEEPALIVE = 8;
2341 pub const OOBINLINE = 256;
2342 pub const NO_CHECK = 11;
2343 pub const PRIORITY = 12;
2344 pub const LINGER = 128;
2345 pub const BSDCOMPAT = 1024;
2346 pub const REUSEPORT = 512;
2347 pub const PASSCRED = 2;
2348 pub const PEERCRED = 64;
2349 pub const RCVLOWAT = 2048;
2350 pub const SNDLOWAT = 4096;
2351 pub const RCVTIMEO = 8192;
2352 pub const SNDTIMEO = 16384;
2353 pub const ACCEPTCONN = 32768;
2354 pub const PEERSEC = 30;
2355 pub const SNDBUFFORCE = 4106;
2356 pub const RCVBUFFORCE = 4107;
2357 pub const PROTOCOL = 4136;
2358 pub const DOMAIN = 4137;
2359 pub const SECURITY_AUTHENTICATION = 20481;
2360 pub const SECURITY_ENCRYPTION_TRANSPORT = 20482;
2361 pub const SECURITY_ENCRYPTION_NETWORK = 20484;
2362 pub const BINDTODEVICE = 13;
2363 pub const ATTACH_FILTER = 26;
2364 pub const DETACH_FILTER = 27;
2365 pub const GET_FILTER = 26;
2366 pub const PEERNAME = 28;
2367 pub const TIMESTAMP_OLD = 29;
2368 pub const PASSSEC = 31;
2369 pub const TIMESTAMPNS_OLD = 33;
2370 pub const MARK = 34;
2371 pub const TIMESTAMPING_OLD = 35;
2372 pub const RXQ_OVFL = 36;
2373 pub const WIFI_STATUS = 37;
2374 pub const PEEK_OFF = 38;
2375 pub const NOFCS = 39;
2376 pub const LOCK_FILTER = 40;
2377 pub const SELECT_ERR_QUEUE = 41;
2378 pub const BUSY_POLL = 48;
2379 pub const MAX_PACING_RATE = 49;
2380 pub const BPF_EXTENSIONS = 50;
2381 pub const INCOMING_CPU = 51;
2382 pub const ATTACH_BPF = 52;
2383 pub const DETACH_BPF = 27;
2384 pub const ATTACH_REUSEPORT_CBPF = 53;
2385 pub const ATTACH_REUSEPORT_EBPF = 54;
2386 pub const CNX_ADVICE = 55;
2387 pub const MEMINFO = 57;
2388 pub const INCOMING_NAPI_ID = 58;
2389 pub const COOKIE = 59;
2390 pub const PEERGROUPS = 61;
2391 pub const ZEROCOPY = 62;
2392 pub const TXTIME = 63;
2393 pub const BINDTOIFINDEX = 65;
2394 pub const TIMESTAMP_NEW = 70;
2395 pub const TIMESTAMPNS_NEW = 66;
2396 pub const TIMESTAMPING_NEW = 67;
2397 pub const RCVTIMEO_NEW = 68;
2398 pub const SNDTIMEO_NEW = 69;
2399 pub const DETACH_REUSEPORT_BPF = 71;
22492400 } else struct {
22502401 pub const DEBUG = 1;
22512402 pub const REUSEADDR = 2;
......@@ -2274,53 +2425,48 @@ pub const SO = struct {
22742425 pub const RCVBUFFORCE = 33;
22752426 pub const PROTOCOL = 38;
22762427 pub const DOMAIN = 39;
2428 pub const SECURITY_AUTHENTICATION = 22;
2429 pub const SECURITY_ENCRYPTION_TRANSPORT = 23;
2430 pub const SECURITY_ENCRYPTION_NETWORK = 24;
2431 pub const BINDTODEVICE = 25;
2432 pub const ATTACH_FILTER = 26;
2433 pub const DETACH_FILTER = 27;
2434 pub const GET_FILTER = ATTACH_FILTER;
2435 pub const PEERNAME = 28;
2436 pub const TIMESTAMP_OLD = 29;
2437 pub const PASSSEC = 34;
2438 pub const TIMESTAMPNS_OLD = 35;
2439 pub const MARK = 36;
2440 pub const TIMESTAMPING_OLD = 37;
2441 pub const RXQ_OVFL = 40;
2442 pub const WIFI_STATUS = 41;
2443 pub const PEEK_OFF = 42;
2444 pub const NOFCS = 43;
2445 pub const LOCK_FILTER = 44;
2446 pub const SELECT_ERR_QUEUE = 45;
2447 pub const BUSY_POLL = 46;
2448 pub const MAX_PACING_RATE = 47;
2449 pub const BPF_EXTENSIONS = 48;
2450 pub const INCOMING_CPU = 49;
2451 pub const ATTACH_BPF = 50;
2452 pub const DETACH_BPF = DETACH_FILTER;
2453 pub const ATTACH_REUSEPORT_CBPF = 51;
2454 pub const ATTACH_REUSEPORT_EBPF = 52;
2455 pub const CNX_ADVICE = 53;
2456 pub const MEMINFO = 55;
2457 pub const INCOMING_NAPI_ID = 56;
2458 pub const COOKIE = 57;
2459 pub const PEERGROUPS = 59;
2460 pub const ZEROCOPY = 60;
2461 pub const TXTIME = 61;
2462 pub const BINDTOIFINDEX = 62;
2463 pub const TIMESTAMP_NEW = 63;
2464 pub const TIMESTAMPNS_NEW = 64;
2465 pub const TIMESTAMPING_NEW = 65;
2466 pub const RCVTIMEO_NEW = 66;
2467 pub const SNDTIMEO_NEW = 67;
2468 pub const DETACH_REUSEPORT_BPF = 68;
22772469 };
2278
2279 pub const SECURITY_AUTHENTICATION = 22;
2280 pub const SECURITY_ENCRYPTION_TRANSPORT = 23;
2281 pub const SECURITY_ENCRYPTION_NETWORK = 24;
2282
2283 pub const BINDTODEVICE = 25;
2284
2285 pub const ATTACH_FILTER = 26;
2286 pub const DETACH_FILTER = 27;
2287 pub const GET_FILTER = ATTACH_FILTER;
2288
2289 pub const PEERNAME = 28;
2290 pub const TIMESTAMP_OLD = 29;
2291 pub const PASSSEC = 34;
2292 pub const TIMESTAMPNS_OLD = 35;
2293 pub const MARK = 36;
2294 pub const TIMESTAMPING_OLD = 37;
2295
2296 pub const RXQ_OVFL = 40;
2297 pub const WIFI_STATUS = 41;
2298 pub const PEEK_OFF = 42;
2299 pub const NOFCS = 43;
2300 pub const LOCK_FILTER = 44;
2301 pub const SELECT_ERR_QUEUE = 45;
2302 pub const BUSY_POLL = 46;
2303 pub const MAX_PACING_RATE = 47;
2304 pub const BPF_EXTENSIONS = 48;
2305 pub const INCOMING_CPU = 49;
2306 pub const ATTACH_BPF = 50;
2307 pub const DETACH_BPF = DETACH_FILTER;
2308 pub const ATTACH_REUSEPORT_CBPF = 51;
2309 pub const ATTACH_REUSEPORT_EBPF = 52;
2310 pub const CNX_ADVICE = 53;
2311 pub const MEMINFO = 55;
2312 pub const INCOMING_NAPI_ID = 56;
2313 pub const COOKIE = 57;
2314 pub const PEERGROUPS = 59;
2315 pub const ZEROCOPY = 60;
2316 pub const TXTIME = 61;
2317 pub const BINDTOIFINDEX = 62;
2318 pub const TIMESTAMP_NEW = 63;
2319 pub const TIMESTAMPNS_NEW = 64;
2320 pub const TIMESTAMPING_NEW = 65;
2321 pub const RCVTIMEO_NEW = 66;
2322 pub const SNDTIMEO_NEW = 67;
2323 pub const DETACH_REUSEPORT_BPF = 68;
23242470};
23252471
23262472pub const SCM = struct {
......@@ -2331,7 +2477,7 @@ pub const SCM = struct {
23312477};
23322478
23332479pub const SOL = struct {
2334 pub const SOCKET = if (is_mips) 65535 else 1;
2480 pub const SOCKET = if (is_mips or is_sparc) 65535 else 1;
23352481
23362482 pub const IP = 0;
23372483 pub const IPV6 = 41;