Skip to content

illumos fixups #1984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,11 @@ fn test_solarish(target: &str) {
"madvise" | "mprotect" if is_illumos => true,
"door_call" | "door_return" | "door_create" if is_illumos => true,

// These functions may return int or void depending on the exact
// configuration of the compilation environment, but the return
// value is not useful (always 0) so we can ignore it:
"setservent" | "endservent" if is_illumos => true,

_ => false,
}
});
Expand Down
1 change: 1 addition & 0 deletions src/unix/solarish/illumos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub const EFD_CLOEXEC: ::c_int = 0x80000;
pub const TCP_KEEPIDLE: ::c_int = 34;
pub const TCP_KEEPCNT: ::c_int = 35;
pub const TCP_KEEPINTVL: ::c_int = 36;
pub const TCP_CONGESTION: ::c_int = 37;

extern "C" {
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
Expand Down
19 changes: 18 additions & 1 deletion src/unix/solarish/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,24 @@ pub const IP_DROP_MEMBERSHIP: ::c_int = 20;
pub const IPV6_JOIN_GROUP: ::c_int = 9;
pub const IPV6_LEAVE_GROUP: ::c_int = 10;

pub const TCP_NODELAY: ::c_int = 1;
// These TCP socket options are common between illumos and Solaris, while higher
// numbers have generally diverged:
pub const TCP_NODELAY: ::c_int = 0x1;
pub const TCP_MAXSEG: ::c_int = 0x2;
pub const TCP_KEEPALIVE: ::c_int = 0x8;
pub const TCP_NOTIFY_THRESHOLD: ::c_int = 0x10;
pub const TCP_ABORT_THRESHOLD: ::c_int = 0x11;
pub const TCP_CONN_NOTIFY_THRESHOLD: ::c_int = 0x12;
pub const TCP_CONN_ABORT_THRESHOLD: ::c_int = 0x13;
pub const TCP_RECVDSTADDR: ::c_int = 0x14;
pub const TCP_INIT_CWND: ::c_int = 0x15;
pub const TCP_KEEPALIVE_THRESHOLD: ::c_int = 0x16;
pub const TCP_KEEPALIVE_ABORT_THRESHOLD: ::c_int = 0x17;
pub const TCP_CORK: ::c_int = 0x18;
pub const TCP_RTO_INITIAL: ::c_int = 0x19;
pub const TCP_RTO_MIN: ::c_int = 0x1a;
pub const TCP_RTO_MAX: ::c_int = 0x1b;
pub const TCP_LINGER2: ::c_int = 0x1c;

pub const SOL_SOCKET: ::c_int = 0xffff;
pub const SO_DEBUG: ::c_int = 0x01;
Expand Down