Skip to content

Commit 727d0ed

Browse files
committed
Auto merge of #1962 - coolreader18:redox-sock, r=JohnTitor
Update redox socket constants
2 parents b765da8 + 0358ea8 commit 727d0ed

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

src/unix/redox/mod.rs

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,13 @@ pub const O_NOFOLLOW: ::c_int = -0x8000_0000;
440440

441441
// netdb.h
442442
pub const EAI_SYSTEM: ::c_int = -11;
443+
pub const NI_MAXHOST: ::c_int = 1025;
444+
pub const NI_MAXSERV: ::c_int = 32;
445+
pub const NI_NUMERICHOST: ::c_int = 0x0001;
446+
pub const NI_NUMERICSERV: ::c_int = 0x0002;
447+
pub const NI_NOFQDN: ::c_int = 0x0004;
448+
pub const NI_NAMEREQD: ::c_int = 0x0008;
449+
pub const NI_DGRAM: ::c_int = 0x0010;
443450

444451
// netinet/in.h
445452
// FIXME: relibc {
@@ -526,6 +533,12 @@ pub const SA_RESTART: ::c_ulong = 0x10000000;
526533
pub const SA_NODEFER: ::c_ulong = 0x40000000;
527534
pub const SA_RESETHAND: ::c_ulong = 0x80000000;
528535

536+
// sys/file.h
537+
pub const LOCK_SH: ::c_int = 1;
538+
pub const LOCK_EX: ::c_int = 2;
539+
pub const LOCK_NB: ::c_int = 4;
540+
pub const LOCK_UN: ::c_int = 8;
541+
529542
// sys/epoll.h
530543
pub const EPOLL_CLOEXEC: ::c_int = 0x0100_0000;
531544
pub const EPOLL_CTL_ADD: ::c_int = 1;
@@ -608,25 +621,56 @@ pub const MS_SYNC: ::c_int = 0x0004;
608621
pub const FD_SETSIZE: usize = 1024;
609622

610623
// sys/socket.h
611-
pub const AF_UNIX: ::c_int = 1;
612624
pub const AF_INET: ::c_int = 2;
613625
pub const AF_INET6: ::c_int = 10;
626+
pub const AF_UNIX: ::c_int = 1;
627+
pub const AF_UNSPEC: ::c_int = 0;
628+
pub const PF_INET: ::c_int = 2;
629+
pub const PF_INET6: ::c_int = 10;
630+
pub const PF_UNIX: ::c_int = 1;
631+
pub const PF_UNSPEC: ::c_int = 0;
632+
pub const MSG_CTRUNC: ::c_int = 8;
633+
pub const MSG_DONTROUTE: ::c_int = 4;
634+
pub const MSG_EOR: ::c_int = 128;
635+
pub const MSG_OOB: ::c_int = 1;
614636
pub const MSG_PEEK: ::c_int = 2;
637+
pub const MSG_TRUNC: ::c_int = 32;
638+
pub const MSG_WAITALL: ::c_int = 256;
615639
pub const SHUT_RD: ::c_int = 0;
616640
pub const SHUT_WR: ::c_int = 1;
617641
pub const SHUT_RDWR: ::c_int = 2;
642+
pub const SO_DEBUG: ::c_int = 1;
618643
pub const SO_REUSEADDR: ::c_int = 2;
644+
pub const SO_TYPE: ::c_int = 3;
619645
pub const SO_ERROR: ::c_int = 4;
646+
pub const SO_DONTROUTE: ::c_int = 5;
620647
pub const SO_BROADCAST: ::c_int = 6;
621648
pub const SO_SNDBUF: ::c_int = 7;
622649
pub const SO_RCVBUF: ::c_int = 8;
623650
pub const SO_KEEPALIVE: ::c_int = 9;
651+
pub const SO_OOBINLINE: ::c_int = 10;
652+
pub const SO_NO_CHECK: ::c_int = 11;
653+
pub const SO_PRIORITY: ::c_int = 12;
624654
pub const SO_LINGER: ::c_int = 13;
655+
pub const SO_BSDCOMPAT: ::c_int = 14;
625656
pub const SO_REUSEPORT: ::c_int = 15;
657+
pub const SO_PASSCRED: ::c_int = 16;
658+
pub const SO_PEERCRED: ::c_int = 17;
659+
pub const SO_RCVLOWAT: ::c_int = 18;
660+
pub const SO_SNDLOWAT: ::c_int = 19;
626661
pub const SO_RCVTIMEO: ::c_int = 20;
627662
pub const SO_SNDTIMEO: ::c_int = 21;
663+
pub const SO_ACCEPTCONN: ::c_int = 30;
664+
pub const SO_PEERSEC: ::c_int = 31;
665+
pub const SO_SNDBUFFORCE: ::c_int = 32;
666+
pub const SO_RCVBUFFORCE: ::c_int = 33;
667+
pub const SO_PROTOCOL: ::c_int = 38;
668+
pub const SO_DOMAIN: ::c_int = 39;
628669
pub const SOCK_STREAM: ::c_int = 1;
629670
pub const SOCK_DGRAM: ::c_int = 2;
671+
pub const SOCK_NONBLOCK: ::c_int = 0o4_000;
672+
pub const SOCK_CLOEXEC: ::c_int = 0o2_000_000;
673+
pub const SOCK_SEQPACKET: ::c_int = 5;
630674
pub const SOL_SOCKET: ::c_int = 1;
631675

632676
// sys/termios.h

0 commit comments

Comments
 (0)