From e1b9757128ccfe9d7c83dfda7a958818925a422d Mon Sep 17 00:00:00 2001 From: Patrick Mooney <pmooney@pfmooney.com> Date: Fri, 17 Jul 2020 17:44:11 +0000 Subject: [PATCH] Expose EPOLLEXCLUSIVE on illumos platform Initially the EPOLLEXCLUSIVE definition was hidden on the illumos platform as it lacked explicit support. After further review, it was concluded that EPOLLEXCLUSIVE can safely be considered a no-op, when not fully implemented by the OS, making it safe for use on illumos. --- libc-test/build.rs | 5 +++++ src/unix/solarish/mod.rs | 1 + src/unix/solarish/solaris.rs | 2 -- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index a2d6600b..48b7d7a2 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -794,6 +794,11 @@ fn test_solarish(target: &str) { // This evaluates to a sysconf() call rather than a constant "PTHREAD_STACK_MIN" => true, + // EPOLLEXCLUSIVE is a relatively recent addition to the epoll interface and may not be + // defined on older systems. It is, however, safe to use on systems which do not + // explicitly support it. (A no-op is an acceptable implementation of EPOLLEXCLUSIVE.) + "EPOLLEXCLUSIVE" => true, + _ => false, }); diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index c60e6780..98e2dc78 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -1838,6 +1838,7 @@ pub const EPOLLET: ::c_int = 0x80000000; pub const EPOLLRDHUP: ::c_int = 0x2000; pub const EPOLLONESHOT: ::c_int = 0x40000000; pub const EPOLLWAKEUP: ::c_int = 0x20000000; +pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000; pub const EPOLL_CLOEXEC: ::c_int = 0x80000; pub const EPOLL_CTL_ADD: ::c_int = 1; pub const EPOLL_CTL_MOD: ::c_int = 3; diff --git a/src/unix/solarish/solaris.rs b/src/unix/solarish/solaris.rs index 798622e3..596029d1 100644 --- a/src/unix/solarish/solaris.rs +++ b/src/unix/solarish/solaris.rs @@ -29,8 +29,6 @@ s! { pub const PORT_SOURCE_POSTWAIT: ::c_int = 8; pub const PORT_SOURCE_SIGNAL: ::c_int = 9; -pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000; - pub const AF_LOCAL: ::c_int = 0; pub const AF_FILE: ::c_int = 0; -- GitLab