Skip to content

Commit 6b78ca9

Browse files
committed
add missing TCP socket options for illumos
The socket2 crate now depends on TCP_MAXSEG, and the rest of the options may as well come along for the ride.
1 parent 297c002 commit 6b78ca9

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/unix/solarish/illumos.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ pub const EFD_CLOEXEC: ::c_int = 0x80000;
2525
pub const TCP_KEEPIDLE: ::c_int = 34;
2626
pub const TCP_KEEPCNT: ::c_int = 35;
2727
pub const TCP_KEEPINTVL: ::c_int = 36;
28+
pub const TCP_CONGESTION: ::c_int = 37;
2829

2930
extern "C" {
3031
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;

src/unix/solarish/mod.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,24 @@ pub const IP_DROP_MEMBERSHIP: ::c_int = 20;
13851385
pub const IPV6_JOIN_GROUP: ::c_int = 9;
13861386
pub const IPV6_LEAVE_GROUP: ::c_int = 10;
13871387

1388-
pub const TCP_NODELAY: ::c_int = 1;
1388+
// These TCP socket options are common between illumos and Solaris, while higher
1389+
// numbers have generally diverged:
1390+
pub const TCP_NODELAY: ::c_int = 0x1;
1391+
pub const TCP_MAXSEG: ::c_int = 0x2;
1392+
pub const TCP_KEEPALIVE: ::c_int = 0x8;
1393+
pub const TCP_NOTIFY_THRESHOLD: ::c_int = 0x10;
1394+
pub const TCP_ABORT_THRESHOLD: ::c_int = 0x11;
1395+
pub const TCP_CONN_NOTIFY_THRESHOLD: ::c_int = 0x12;
1396+
pub const TCP_CONN_ABORT_THRESHOLD: ::c_int = 0x13;
1397+
pub const TCP_RECVDSTADDR: ::c_int = 0x14;
1398+
pub const TCP_INIT_CWND: ::c_int = 0x15;
1399+
pub const TCP_KEEPALIVE_THRESHOLD: ::c_int = 0x16;
1400+
pub const TCP_KEEPALIVE_ABORT_THRESHOLD: ::c_int = 0x17;
1401+
pub const TCP_CORK: ::c_int = 0x18;
1402+
pub const TCP_RTO_INITIAL: ::c_int = 0x19;
1403+
pub const TCP_RTO_MIN: ::c_int = 0x1a;
1404+
pub const TCP_RTO_MAX: ::c_int = 0x1b;
1405+
pub const TCP_LINGER2: ::c_int = 0x1c;
13891406

13901407
pub const SOL_SOCKET: ::c_int = 0xffff;
13911408
pub const SO_DEBUG: ::c_int = 0x01;

0 commit comments

Comments
 (0)