aboutsummaryrefslogtreecommitdiff
path: root/libc/src/unix/solaris/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'libc/src/unix/solaris/mod.rs')
-rw-r--r--libc/src/unix/solaris/mod.rs75
1 files changed, 73 insertions, 2 deletions
diff --git a/libc/src/unix/solaris/mod.rs b/libc/src/unix/solaris/mod.rs
index 63bd59a..c4ec111 100644
--- a/libc/src/unix/solaris/mod.rs
+++ b/libc/src/unix/solaris/mod.rs
@@ -353,6 +353,12 @@ s! {
pub portev_object: ::uintptr_t,
pub portev_user: *mut ::c_void,
}
+
+ #[cfg_attr(any(target_arch = "x86", target_arch = "x86_64"), repr(packed))]
+ pub struct epoll_event {
+ pub events: ::uint32_t,
+ pub u64: ::uint64_t,
+ }
}
pub const LC_CTYPE: ::c_int = 0;
@@ -469,6 +475,9 @@ pub const SIG_BLOCK: ::c_int = 1;
pub const SIG_UNBLOCK: ::c_int = 2;
pub const SIG_SETMASK: ::c_int = 3;
+pub const IPV6_UNICAST_HOPS: ::c_int = 0x5;
+pub const IPV6_MULTICAST_IF: ::c_int = 0x6;
+pub const IPV6_MULTICAST_HOPS: ::c_int = 0x7;
pub const IPV6_MULTICAST_LOOP: ::c_int = 0x8;
pub const IPV6_V6ONLY: ::c_int = 0x27;
@@ -844,6 +853,7 @@ pub const SOCK_STREAM: ::c_int = 2;
pub const SOCK_RAW: ::c_int = 4;
pub const SOCK_RDM: ::c_int = 5;
pub const SOCK_SEQPACKET: ::c_int = 6;
+pub const IP_MULTICAST_IF: ::c_int = 16;
pub const IP_MULTICAST_TTL: ::c_int = 17;
pub const IP_MULTICAST_LOOP: ::c_int = 18;
pub const IP_TTL: ::c_int = 4;
@@ -1127,6 +1137,9 @@ pub const NCCS: usize = 19;
pub const LOG_CRON: ::c_int = 15 << 3;
+pub const SYS_epoll_create: ::c_long = 213;
+pub const SYS_epoll_create1: ::c_long = 291;
+
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
__pthread_mutex_flag1: 0,
__pthread_mutex_flag2: 0,
@@ -1182,6 +1195,28 @@ pub const PORT_SOURCE_FILE: ::c_int = 7;
pub const PORT_SOURCE_POSTWAIT: ::c_int = 8;
pub const PORT_SOURCE_SIGNAL: ::c_int = 9;
+pub const TIOCGWINSZ: ::c_int = 0x5468;
+pub const TIOCSWINSZ: ::c_int = 0x5467;
+
+pub const EPOLLIN: ::c_int = 0x1;
+pub const EPOLLPRI: ::c_int = 0x2;
+pub const EPOLLOUT: ::c_int = 0x4;
+pub const EPOLLRDNORM: ::c_int = 0x40;
+pub const EPOLLRDBAND: ::c_int = 0x80;
+pub const EPOLLWRNORM: ::c_int = 0x100;
+pub const EPOLLWRBAND: ::c_int = 0x200;
+pub const EPOLLMSG: ::c_int = 0x400;
+pub const EPOLLERR: ::c_int = 0x8;
+pub const EPOLLHUP: ::c_int = 0x10;
+pub const EPOLLET: ::c_int = 0x80000000;
+pub const EPOLLRDHUP: ::c_int = 0x2000;
+pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
+pub const EPOLLONESHOT: ::c_int = 0x40000000;
+pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
+pub const EPOLL_CTL_ADD: ::c_int = 1;
+pub const EPOLL_CTL_MOD: ::c_int = 3;
+pub const EPOLL_CTL_DEL: ::c_int = 2;
+
f! {
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
let bits = mem::size_of_val(&(*set).fds_bits[0]) * 8;
@@ -1223,6 +1258,12 @@ f! {
}
extern {
+ pub fn abs(i: ::c_int) -> ::c_int;
+ pub fn atof(s: *const ::c_char) -> ::c_double;
+ pub fn labs(i: ::c_long) -> ::c_long;
+ pub fn rand() -> ::c_int;
+ pub fn srand(seed: ::c_uint);
+
pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
pub fn freeifaddrs(ifa: *mut ::ifaddrs);
@@ -1234,6 +1275,7 @@ extern {
pub fn ioctl(fildes: ::c_int, request: ::c_int, ...) -> ::c_int;
pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int)
-> ::c_int;
+ pub fn ___errno() -> *mut ::c_int;
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_nanosleep(clk_id: ::clockid_t,
@@ -1265,8 +1307,6 @@ extern {
pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int;
pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int;
- pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
-
pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
mode: ::mode_t, dev: dev_t) -> ::c_int;
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
@@ -1284,6 +1324,8 @@ extern {
clock_id: ::clockid_t) -> ::c_int;
pub fn sem_timedwait(sem: *mut sem_t,
abstime: *const ::timespec) -> ::c_int;
+ pub fn sem_getvalue(sem: *mut sem_t,
+ sval: *mut ::c_int) -> ::c_int;
pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t,
abstime: *const ::timespec) -> ::c_int;
pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t,
@@ -1361,6 +1403,23 @@ extern {
oss: *mut stack_t) -> ::c_int;
pub fn sem_close(sem: *mut sem_t) -> ::c_int;
pub fn getdtablesize() -> ::c_int;
+
+ pub fn epoll_pwait(epfd: ::c_int,
+ events: *mut ::epoll_event,
+ maxevents: ::c_int,
+ timeout: ::c_int,
+ sigmask: *const ::sigset_t) -> ::c_int;
+ pub fn epoll_create(size: ::c_int) -> ::c_int;
+ pub fn epoll_create1(flags: ::c_int) -> ::c_int;
+ pub fn epoll_wait(epfd: ::c_int,
+ events: *mut ::epoll_event,
+ maxevents: ::c_int,
+ timeout: ::c_int) -> ::c_int;
+ pub fn epoll_ctl(epfd: ::c_int,
+ op: ::c_int,
+ fd: ::c_int,
+ event: *mut ::epoll_event) -> ::c_int;
+
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrnam_r")]
pub fn getgrnam_r(name: *const ::c_char,
grp: *mut ::group,
@@ -1386,6 +1445,16 @@ extern {
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd) -> ::c_int;
+ #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwent_r")]
+ pub fn getpwent_r(pwd: *mut passwd,
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ result: *mut *mut passwd) -> ::c_int;
+ #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrent_r")]
+ pub fn getgrent_r(grp: *mut ::group,
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ result: *mut *mut ::group) -> ::c_int;
#[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")]
pub fn sigwait(set: *const sigset_t,
sig: *mut ::c_int) -> ::c_int;
@@ -1395,4 +1464,6 @@ extern {
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
pub fn popen(command: *const c_char,
mode: *const c_char) -> *mut ::FILE;
+
+ pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
}