Skip to content

Commit 158d778

Browse files
committed
Auto merge of rust-lang#639 - Susurrus:more_socket_constants, r=alexcrichton
Add socket constants for more platforms Missing a few constants across all nix-supported platforms (see nix-rust/nix#636) so this adds them. This is still a work in progress as I wanted to make sure I didn't break anything doing most of the fixes. I'll come back and finish this up later.
2 parents 1af26db + 2a27242 commit 158d778

File tree

8 files changed

+36
-4
lines changed

8 files changed

+36
-4
lines changed

src/unix/bsd/netbsdlike/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ pub const PF_NATM: ::c_int = AF_NATM;
407407
pub const SOCK_STREAM: ::c_int = 1;
408408
pub const SOCK_DGRAM: ::c_int = 2;
409409
pub const SOCK_RAW: ::c_int = 3;
410+
pub const SOCK_RDM: ::c_int = 4;
410411
pub const SOCK_SEQPACKET: ::c_int = 5;
411412
pub const IPPROTO_ICMP: ::c_int = 1;
412413
pub const IPPROTO_ICMPV6: ::c_int = 58;

src/unix/notbsd/android/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,11 +486,14 @@ pub const SO_KEEPALIVE: ::c_int = 9;
486486
pub const SO_OOBINLINE: ::c_int = 10;
487487
pub const SO_LINGER: ::c_int = 13;
488488
pub const SO_REUSEPORT: ::c_int = 15;
489+
pub const SO_PASSCRED: ::c_int = 16;
490+
pub const SO_PEERCRED: ::c_int = 17;
489491
pub const SO_RCVLOWAT: ::c_int = 18;
490492
pub const SO_SNDLOWAT: ::c_int = 19;
491493
pub const SO_RCVTIMEO: ::c_int = 20;
492494
pub const SO_SNDTIMEO: ::c_int = 21;
493495
pub const SO_ACCEPTCONN: ::c_int = 30;
496+
pub const SO_SNDBUFFORCE: ::c_int = 32;
494497

495498
pub const O_ACCMODE: ::c_int = 3;
496499
pub const O_APPEND: ::c_int = 1024;

src/unix/notbsd/linux/musl/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,13 @@ pub const B3000000: ::speed_t = 0o010015;
328328
pub const B3500000: ::speed_t = 0o010016;
329329
pub const B4000000: ::speed_t = 0o010017;
330330

331+
pub const SO_BINDTODEVICE: ::c_int = 25;
332+
pub const SO_TIMESTAMP: ::c_int = 29;
333+
pub const SO_MARK: ::c_int = 36;
334+
pub const SO_RXQ_OVFL: ::c_int = 40;
335+
pub const SO_PEEK_OFF: ::c_int = 42;
336+
pub const SO_BUSY_POLL: ::c_int = 46;
337+
331338
extern {
332339
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
333340
pub fn ptrace(request: ::c_int, ...) -> ::c_long;

src/unix/notbsd/linux/other/b32/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,19 @@ pub const SO_SNDBUF: ::c_int = 7;
172172
pub const SO_RCVBUF: ::c_int = 8;
173173
pub const SO_KEEPALIVE: ::c_int = 9;
174174
pub const SO_OOBINLINE: ::c_int = 10;
175+
pub const SO_PRIORITY: ::c_int = 12;
175176
pub const SO_LINGER: ::c_int = 13;
177+
pub const SO_BSDCOMPAT: ::c_int = 14;
176178
pub const SO_REUSEPORT: ::c_int = 15;
179+
pub const SO_BINDTODEVICE: ::c_int = 25;
180+
pub const SO_TIMESTAMP: ::c_int = 29;
177181
pub const SO_ACCEPTCONN: ::c_int = 30;
182+
pub const SO_MARK: ::c_int = 36;
183+
pub const SO_PROTOCOL: ::c_int = 38;
184+
pub const SO_DOMAIN: ::c_int = 39;
185+
pub const SO_RXQ_OVFL: ::c_int = 40;
186+
pub const SO_PEEK_OFF: ::c_int = 42;
187+
pub const SO_BUSY_POLL: ::c_int = 46;
178188

179189
pub const SA_ONSTACK: ::c_int = 0x08000000;
180190
pub const SA_SIGINFO: ::c_int = 0x00000004;

src/unix/notbsd/linux/other/b32/powerpc.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ pub const EDEADLOCK: ::c_int = 58;
8484
pub const SO_SNDBUFFORCE: ::c_int = 32;
8585
pub const SO_RCVBUFFORCE: ::c_int = 33;
8686
pub const SO_NO_CHECK: ::c_int = 11;
87-
pub const SO_PRIORITY: ::c_int = 12;
88-
pub const SO_BSDCOMPAT: ::c_int = 14;
8987
pub const SO_RCVLOWAT: ::c_int = 16;
9088
pub const SO_SNDLOWAT: ::c_int = 17;
9189
pub const SO_RCVTIMEO: ::c_int = 18;

src/unix/notbsd/linux/other/b32/x86.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ pub const EDEADLOCK: ::c_int = 35;
184184
pub const SO_SNDBUFFORCE: ::c_int = 32;
185185
pub const SO_RCVBUFFORCE: ::c_int = 33;
186186
pub const SO_NO_CHECK: ::c_int = 11;
187-
pub const SO_PRIORITY: ::c_int = 12;
188-
pub const SO_BSDCOMPAT: ::c_int = 14;
189187
pub const SO_PASSCRED: ::c_int = 16;
190188
pub const SO_PEERCRED: ::c_int = 17;
191189
pub const SO_RCVLOWAT: ::c_int = 18;

src/unix/notbsd/linux/other/b64/sparc64.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,19 @@ pub const ERFKILL: ::c_int = 134;
183183
pub const SOL_SOCKET: ::c_int = 0xffff;
184184

185185
pub const SO_REUSEADDR: ::c_int = 4;
186+
pub const SO_BINDTODEVICE: ::c_int = 0x000d;
187+
pub const SO_TIMESTAMP: ::c_int = 0x001d;
188+
pub const SO_MARK: ::c_int = 0x0022;
189+
pub const SO_RXQ_OVFL: ::c_int = 0x0024;
190+
pub const SO_PEEK_OFF: ::c_int = 0x0026;
191+
pub const SO_BUSY_POLL: ::c_int = 0x0030;
186192
pub const SO_TYPE: ::c_int = 0x1008;
187193
pub const SO_ERROR: ::c_int = 0x1007;
188194
pub const SO_DONTROUTE: ::c_int = 16;
189195
pub const SO_BROADCAST: ::c_int = 32;
190196
pub const SO_SNDBUF: ::c_int = 0x1001;
191197
pub const SO_RCVBUF: ::c_int = 0x1002;
198+
pub const SO_DOMAIN: ::c_int = 0x1029;
192199
pub const SO_KEEPALIVE: ::c_int = 8;
193200
pub const SO_OOBINLINE: ::c_int = 0x100;
194201
pub const SO_LINGER: ::c_int = 128;

src/unix/notbsd/linux/s390x.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,14 @@ pub const SO_ERROR: ::c_int = 4;
350350
pub const SO_RCVTIMEO: ::c_int = 20;
351351
pub const SO_REUSEADDR: ::c_int = 2;
352352
pub const SO_SNDTIMEO: ::c_int = 21;
353+
pub const SO_BINDTODEVICE: ::c_int = 25;
354+
pub const SO_TIMESTAMP: ::c_int = 29;
355+
pub const SO_MARK: ::c_int = 36;
356+
pub const SO_PROTOCOL: ::c_int = 38;
357+
pub const SO_DOMAIN: ::c_int = 39;
358+
pub const SO_RXQ_OVFL: ::c_int = 40;
359+
pub const SO_PEEK_OFF: ::c_int = 42;
360+
pub const SO_BUSY_POLL: ::c_int = 46;
353361

354362
pub const RLIMIT_RSS: ::c_int = 5;
355363
pub const RLIMIT_NOFILE: ::c_int = 7;

0 commit comments

Comments
 (0)