Skip to content

Commit

Permalink
Few socket updates related for Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Jul 21, 2022
1 parent 4238054 commit cfb7e8b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libc-test/build.rs
Expand Up @@ -1601,6 +1601,7 @@ fn test_android(target: &str) {
"linux/reboot.h",
"linux/seccomp.h",
"linux/sched.h",
"linux/sock_diag.h",
"linux/sockios.h",
"linux/vm_sockets.h",
"linux/wait.h",
Expand Down Expand Up @@ -2820,6 +2821,7 @@ fn test_linux(target: &str) {
"linux/sched.h",
"linux/seccomp.h",
"linux/sched.h",
"linux/sock_diag.h",
"linux/sockios.h",
"linux/uinput.h",
"linux/vm_sockets.h",
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/linux.txt
Expand Up @@ -1181,6 +1181,7 @@ MSG_RST
MSG_STAT
MSG_SYN
MSG_WAITFORONE
MSG_ZEROCOPY
MS_ACTIVE
MS_BIND
MS_DIRSYNC
Expand Down
12 changes: 12 additions & 0 deletions src/unix/linux_like/mod.rs
Expand Up @@ -775,6 +775,7 @@ pub const MSG_ERRQUEUE: ::c_int = 0x2000;
pub const MSG_NOSIGNAL: ::c_int = 0x4000;
pub const MSG_MORE: ::c_int = 0x8000;
pub const MSG_WAITFORONE: ::c_int = 0x10000;
pub const MSG_ZEROCOPY: ::c_int = 0x4000000;
pub const MSG_FASTOPEN: ::c_int = 0x20000000;
pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;

Expand Down Expand Up @@ -1178,6 +1179,17 @@ pub const PTRACE_EVENT_VFORK_DONE: ::c_int = 5;
pub const PTRACE_EVENT_EXIT: ::c_int = 6;
pub const PTRACE_EVENT_SECCOMP: ::c_int = 7;

// SO_MEMINFO offsets
pub const SK_MEMINFO_RMEM_ALLOC: ::c_int = 0;
pub const SK_MEMINFO_RCVBUF: ::c_int = 1;
pub const SK_MEMINFO_WMEM_ALLOC: ::c_int = 2;
pub const SK_MEMINFO_SNDBUF: ::c_int = 3;
pub const SK_MEMINFO_FWD_ALLOC: ::c_int = 4;
pub const SK_MEMINFO_WMEM_QUEUED: ::c_int = 5;
pub const SK_MEMINFO_OPTMEM: ::c_int = 6;
pub const SK_MEMINFO_BACKLOG: ::c_int = 7;
pub const SK_MEMINFO_DROPS: ::c_int = 8;

pub const __WNOTHREAD: ::c_int = 0x20000000;
pub const __WALL: ::c_int = 0x40000000;
pub const __WCLONE: ::c_int = 0x80000000;
Expand Down

0 comments on commit cfb7e8b

Please sign in to comment.