aboutsummaryrefslogtreecommitdiff
path: root/libc/src/unix/solaris
diff options
context:
space:
mode:
Diffstat (limited to 'libc/src/unix/solaris')
-rw-r--r--libc/src/unix/solaris/mod.rs101
1 files changed, 80 insertions, 21 deletions
diff --git a/libc/src/unix/solaris/mod.rs b/libc/src/unix/solaris/mod.rs
index 4461a79..63bd59a 100644
--- a/libc/src/unix/solaris/mod.rs
+++ b/libc/src/unix/solaris/mod.rs
@@ -32,7 +32,6 @@ pub type sa_family_t = u16;
pub type pthread_t = ::c_uint;
pub type pthread_key_t = ::c_uint;
pub type blksize_t = ::c_int;
-pub type fflags_t = ::c_int;
pub type nl_item = ::c_int;
pub type id_t = ::c_int;
pub type idtype_t = ::c_uint;
@@ -119,7 +118,7 @@ s! {
}
pub struct cmsghdr {
- pub cmsg_len: ::size_t,
+ pub cmsg_len: ::socklen_t,
pub cmsg_level: ::c_int,
pub cmsg_type: ::c_int,
}
@@ -177,7 +176,7 @@ s! {
pub d_ino: ::ino_t,
pub d_off: ::off_t,
pub d_reclen: u16,
- pub d_name: [::c_char; 1]
+ pub d_name: [::c_char; 3]
}
pub struct glob_t {
@@ -352,7 +351,7 @@ s! {
pub portev_source: ::c_ushort,
pub portev_pad: ::c_ushort,
pub portev_object: ::uintptr_t,
- pub portev_user: ::uintptr_t,
+ pub portev_user: *mut ::c_void,
}
}
@@ -591,6 +590,9 @@ pub const WSTOPPED: ::c_int = WUNTRACED;
pub const WCONTINUED: ::c_int = 0x08;
pub const WNOWAIT: ::c_int = 0x80;
+pub const AT_FDCWD: ::c_int = 0xffd19553;
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x1000;
+
// Solaris defines a great many more of these; we only expose the
// standardized ones.
pub const P_PID: idtype_t = 0;
@@ -744,7 +746,17 @@ pub const EWOULDBLOCK: ::c_int = EAGAIN;
pub const EALREADY: ::c_int = 149;
pub const EINPROGRESS: ::c_int = 150;
+pub const EAI_AGAIN: ::c_int = 2;
+pub const EAI_BADFLAGS: ::c_int = 3;
+pub const EAI_FAIL: ::c_int = 4;
+pub const EAI_FAMILY: ::c_int = 5;
+pub const EAI_MEMORY: ::c_int = 6;
+pub const EAI_NODATA: ::c_int = 7;
+pub const EAI_NONAME: ::c_int = 8;
+pub const EAI_SERVICE: ::c_int = 9;
+pub const EAI_SOCKTYPE: ::c_int = 10;
pub const EAI_SYSTEM: ::c_int = 11;
+pub const EAI_OVERFLOW: ::c_int = 12;
pub const F_DUPFD: ::c_int = 0;
pub const F_GETFD: ::c_int = 1;
@@ -766,6 +778,13 @@ pub const GLOB_NOSPACE : ::c_int = -2;
pub const GLOB_ABORTED : ::c_int = -1;
pub const GLOB_NOMATCH : ::c_int = -3;
+pub const POLLIN: ::c_short = 0x1;
+pub const POLLPRI: ::c_short = 0x2;
+pub const POLLOUT: ::c_short = 0x4;
+pub const POLLERR: ::c_short = 0x8;
+pub const POLLHUP: ::c_short = 0x10;
+pub const POLLNVAL: ::c_short = 0x20;
+
pub const POSIX_MADV_NORMAL: ::c_int = 0;
pub const POSIX_MADV_RANDOM: ::c_int = 1;
pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
@@ -857,7 +876,48 @@ pub const SO_TYPE: ::c_int = 0x1008;
pub const MSG_PEEK: ::c_int = 0x2;
-pub const IFF_LOOPBACK: ::c_int = 0x8;
+// https://docs.oracle.com/cd/E23824_01/html/821-1475/if-7p.html
+pub const IFF_UP: ::c_int = 0x0000000001; // Address is up
+pub const IFF_BROADCAST: ::c_int = 0x0000000002; // Broadcast address valid
+pub const IFF_DEBUG: ::c_int = 0x0000000004; // Turn on debugging
+pub const IFF_LOOPBACK: ::c_int = 0x0000000008; // Loopback net
+pub const IFF_POINTOPOINT: ::c_int = 0x0000000010; // Interface is p-to-p
+pub const IFF_NOTRAILERS: ::c_int = 0x0000000020; // Avoid use of trailers
+pub const IFF_RUNNING: ::c_int = 0x0000000040; // Resources allocated
+pub const IFF_NOARP: ::c_int = 0x0000000080; // No address res. protocol
+pub const IFF_PROMISC: ::c_int = 0x0000000100; // Receive all packets
+pub const IFF_ALLMULTI: ::c_int = 0x0000000200; // Receive all multicast pkts
+pub const IFF_INTELLIGENT: ::c_int = 0x0000000400; // Protocol code on board
+pub const IFF_MULTICAST: ::c_int = 0x0000000800; // Supports multicast
+// Multicast using broadcst. add.
+pub const IFF_MULTI_BCAST: ::c_int = 0x0000001000;
+pub const IFF_UNNUMBERED: ::c_int = 0x0000002000; // Non-unique address
+pub const IFF_DHCPRUNNING: ::c_int = 0x0000004000; // DHCP controls interface
+pub const IFF_PRIVATE: ::c_int = 0x0000008000; // Do not advertise
+pub const IFF_NOXMIT: ::c_int = 0x0000010000; // Do not transmit pkts
+// No address - just on-link subnet
+pub const IFF_NOLOCAL: ::c_int = 0x0000020000;
+pub const IFF_DEPRECATED: ::c_int = 0x0000040000; // Address is deprecated
+pub const IFF_ADDRCONF: ::c_int = 0x0000080000; // Addr. from stateless addrconf
+pub const IFF_ROUTER: ::c_int = 0x0000100000; // Router on interface
+pub const IFF_NONUD: ::c_int = 0x0000200000; // No NUD on interface
+pub const IFF_ANYCAST: ::c_int = 0x0000400000; // Anycast address
+pub const IFF_NORTEXCH: ::c_int = 0x0000800000; // Don't xchange rout. info
+pub const IFF_IPV4: ::c_int = 0x0001000000; // IPv4 interface
+pub const IFF_IPV6: ::c_int = 0x0002000000; // IPv6 interface
+pub const IFF_NOFAILOVER: ::c_int = 0x0008000000; // in.mpathd test address
+pub const IFF_FAILED: ::c_int = 0x0010000000; // Interface has failed
+pub const IFF_STANDBY: ::c_int = 0x0020000000; // Interface is a hot-spare
+pub const IFF_INACTIVE: ::c_int = 0x0040000000; // Functioning but not used
+pub const IFF_OFFLINE: ::c_int = 0x0080000000; // Interface is offline
+// If CoS marking is supported
+pub const IFF_COS_ENABLED: ::c_longlong = 0x0200000000;
+pub const IFF_PREFERRED: ::c_longlong = 0x0400000000; // Prefer as source addr.
+pub const IFF_TEMPORARY: ::c_longlong = 0x0800000000; // RFC3041
+pub const IFF_FIXEDMTU: ::c_longlong = 0x1000000000; // MTU set with SIOCSLIFMTU
+pub const IFF_VIRTUAL: ::c_longlong = 0x2000000000; // Cannot send/receive pkts
+pub const IFF_DUPLICATE: ::c_longlong = 0x4000000000; // Local address in use
+pub const IFF_IPMP: ::c_longlong = 0x8000000000; // IPMP IP interface
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
@@ -1100,6 +1160,7 @@ pub const RTLD_DEFAULT: *mut ::c_void = -2isize as *mut ::c_void;
pub const RTLD_SELF: *mut ::c_void = -3isize as *mut ::c_void;
pub const RTLD_PROBE: *mut ::c_void = -4isize as *mut ::c_void;
+pub const RTLD_LAZY: ::c_int = 0x1;
pub const RTLD_NOW: ::c_int = 0x2;
pub const RTLD_NOLOAD: ::c_int = 0x4;
pub const RTLD_GLOBAL: ::c_int = 0x100;
@@ -1210,9 +1271,13 @@ extern {
mode: ::mode_t, dev: dev_t) -> ::c_int;
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
mode: ::mode_t) -> ::c_int;
- pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+ pub fn sethostname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
pub fn if_nameindex() -> *mut if_nameindex;
pub fn if_freenameindex(ptr: *mut if_nameindex);
+ pub fn pthread_create(native: *mut ::pthread_t,
+ attr: *const ::pthread_attr_t,
+ f: extern fn(*mut ::c_void) -> *mut ::c_void,
+ value: *mut ::c_void) -> ::c_int;
pub fn pthread_condattr_getclock(attr: *const pthread_condattr_t,
clock_id: *mut clockid_t) -> ::c_int;
pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t,
@@ -1245,11 +1310,16 @@ extern {
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+ pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
+
pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
flags: ::c_int, addr: *mut ::sockaddr,
addrlen: *mut ::socklen_t) -> ::ssize_t;
pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
- pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
+ pub fn futimesat(fd: ::c_int, path: *const ::c_char,
+ times: *const ::timeval) -> ::c_int;
+ pub fn utimensat(dirfd: ::c_int, path: *const ::c_char,
+ times: *const ::timespec, flag: ::c_int) -> ::c_int;
pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
pub fn bind(socket: ::c_int, address: *const ::sockaddr,
@@ -1270,13 +1340,13 @@ extern {
pub fn port_create() -> ::c_int;
pub fn port_associate(port: ::c_int, source: ::c_int, object: ::uintptr_t,
- events: ::c_int, user: ::uintptr_t) -> ::c_int;
+ events: ::c_int, user: *mut ::c_void) -> ::c_int;
pub fn port_dissociate(port: ::c_int, source: ::c_int, object: ::uintptr_t)
-> ::c_int;
pub fn port_get(port: ::c_int, pe: *mut port_event,
- timeout: *const ::timespec) -> ::c_int;
+ timeout: *mut ::timespec) -> ::c_int;
pub fn port_getn(port: ::c_int, pe_list: *mut port_event, max: ::c_uint,
- nget: *mut ::c_uint, timeout: *const ::timespec)
+ nget: *mut ::c_uint, timeout: *mut ::timespec)
-> ::c_int;
pub fn fexecve(fd: ::c_int, argv: *const *const ::c_char,
envp: *const *const ::c_char)
@@ -1287,9 +1357,6 @@ extern {
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group) -> ::c_int;
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "sigaltstack$UNIX2003")]
- #[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")]
pub fn sigaltstack(ss: *const stack_t,
oss: *mut stack_t) -> ::c_int;
pub fn sem_close(sem: *mut sem_t) -> ::c_int;
@@ -1300,8 +1367,6 @@ extern {
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group) -> ::c_int;
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "pthread_sigmask$UNIX2003")]
pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t,
oldset: *mut sigset_t) -> ::c_int;
pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
@@ -1309,22 +1374,18 @@ extern {
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
- #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")]
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwnam_r")]
pub fn getpwnam_r(name: *const ::c_char,
pwd: *mut passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd) -> ::c_int;
- #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")]
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwuid_r")]
pub fn getpwuid_r(uid: ::uid_t,
pwd: *mut passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd) -> ::c_int;
- #[cfg_attr(all(target_os = "macos", target_arch ="x86"),
- link_name = "sigwait$UNIX2003")]
#[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")]
pub fn sigwait(set: *const sigset_t,
sig: *mut ::c_int) -> ::c_int;
@@ -1332,8 +1393,6 @@ extern {
parent: Option<unsafe extern fn()>,
child: Option<unsafe extern fn()>) -> ::c_int;
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "popen$UNIX2003")]
pub fn popen(command: *const c_char,
mode: *const c_char) -> *mut ::FILE;
}