Skip to content

Commit 24ec8a0

Browse files
authored
Use FreeBSD SO_ constants on newlib
This is necessary to set socket options on the Nintendo Switch, which uses a socket implementation directly ported from FreeBSD.
1 parent 39ca01c commit 24ec8a0

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/unix/newlib/mod.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,42 @@ pub const S_IROTH: ::mode_t = 4;
431431
pub const S_IWOTH: ::mode_t = 2;
432432
pub const S_IXOTH: ::mode_t = 1;
433433

434+
pub const SO_BINTIME: ::c_int = 0x2000;
435+
pub const SO_NO_OFFLOAD: ::c_int = 0x4000;
436+
pub const SO_NO_DDP: ::c_int = 0x8000;
437+
pub const SO_REUSEPORT_LB: ::c_int = 0x10000;
438+
pub const SO_LABEL: ::c_int = 0x1009;
439+
pub const SO_PEERLABEL: ::c_int = 0x1010;
440+
pub const SO_LISTENQLIMIT: ::c_int = 0x1011;
441+
pub const SO_LISTENQLEN: ::c_int = 0x1012;
442+
pub const SO_LISTENINCQLEN: ::c_int = 0x1013;
443+
pub const SO_SETFIB: ::c_int = 0x1014;
444+
pub const SO_USER_COOKIE: ::c_int = 0x1015;
445+
pub const SO_PROTOCOL: ::c_int = 0x1016;
446+
pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL;
447+
pub const SO_VENDOR: ::c_int = 0x80000000;
448+
pub const SO_DEBUG: ::c_int = 0x01;
449+
pub const SO_ACCEPTCONN: ::c_int = 0x0002;
450+
pub const SO_REUSEADDR: ::c_int = 0x0004;
451+
pub const SO_KEEPALIVE: ::c_int = 0x0008;
452+
pub const SO_DONTROUTE: ::c_int = 0x0010;
453+
pub const SO_BROADCAST: ::c_int = 0x0020;
454+
pub const SO_USELOOPBACK: ::c_int = 0x0040;
455+
pub const SO_LINGER: ::c_int = 0x0080;
456+
pub const SO_OOBINLINE: ::c_int = 0x0100;
457+
pub const SO_REUSEPORT: ::c_int = 0x0200;
458+
pub const SO_TIMESTAMP: ::c_int = 0x0400;
459+
pub const SO_NOSIGPIPE: ::c_int = 0x0800;
460+
pub const SO_ACCEPTFILTER: ::c_int = 0x1000;
461+
pub const SO_SNDBUF: ::c_int = 0x1001;
462+
pub const SO_RCVBUF: ::c_int = 0x1002;
463+
pub const SO_SNDLOWAT: ::c_int = 0x1003;
464+
pub const SO_RCVLOWAT: ::c_int = 0x1004;
465+
pub const SO_SNDTIMEO: ::c_int = 0x1005;
466+
pub const SO_RCVTIMEO: ::c_int = 0x1006;
467+
pub const SO_ERROR: ::c_int = 0x1007;
468+
pub const SO_TYPE: ::c_int = 0x1008;
469+
434470
pub const SOL_SOCKET: ::c_int = 65535;
435471
pub const SOL_TCP: ::c_int = 6;
436472

0 commit comments

Comments
 (0)