// netdb.h
pub const EAI_SYSTEM: ::c_int = -11;
+pub const NI_MAXHOST: ::c_int = 1025;
+pub const NI_MAXSERV: ::c_int = 32;
+pub const NI_NUMERICHOST: ::c_int = 0x0001;
+pub const NI_NUMERICSERV: ::c_int = 0x0002;
+pub const NI_NOFQDN: ::c_int = 0x0004;
+pub const NI_NAMEREQD: ::c_int = 0x0008;
+pub const NI_DGRAM: ::c_int = 0x0010;
// netinet/in.h
// FIXME: relibc {
pub const SA_NODEFER: ::c_ulong = 0x40000000;
pub const SA_RESETHAND: ::c_ulong = 0x80000000;
+// sys/file.h
+pub const LOCK_SH: ::c_int = 1;
+pub const LOCK_EX: ::c_int = 2;
+pub const LOCK_NB: ::c_int = 4;
+pub const LOCK_UN: ::c_int = 8;
+
// sys/epoll.h
pub const EPOLL_CLOEXEC: ::c_int = 0x0100_0000;
pub const EPOLL_CTL_ADD: ::c_int = 1;
pub const FD_SETSIZE: usize = 1024;
// sys/socket.h
-pub const AF_UNIX: ::c_int = 1;
pub const AF_INET: ::c_int = 2;
pub const AF_INET6: ::c_int = 10;
+pub const AF_UNIX: ::c_int = 1;
+pub const AF_UNSPEC: ::c_int = 0;
+pub const PF_INET: ::c_int = 2;
+pub const PF_INET6: ::c_int = 10;
+pub const PF_UNIX: ::c_int = 1;
+pub const PF_UNSPEC: ::c_int = 0;
+pub const MSG_CTRUNC: ::c_int = 8;
+pub const MSG_DONTROUTE: ::c_int = 4;
+pub const MSG_EOR: ::c_int = 128;
+pub const MSG_OOB: ::c_int = 1;
pub const MSG_PEEK: ::c_int = 2;
+pub const MSG_TRUNC: ::c_int = 32;
+pub const MSG_WAITALL: ::c_int = 256;
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
pub const SHUT_RDWR: ::c_int = 2;
+pub const SO_DEBUG: ::c_int = 1;
pub const SO_REUSEADDR: ::c_int = 2;
+pub const SO_TYPE: ::c_int = 3;
pub const SO_ERROR: ::c_int = 4;
+pub const SO_DONTROUTE: ::c_int = 5;
pub const SO_BROADCAST: ::c_int = 6;
pub const SO_SNDBUF: ::c_int = 7;
pub const SO_RCVBUF: ::c_int = 8;
pub const SO_KEEPALIVE: ::c_int = 9;
+pub const SO_OOBINLINE: ::c_int = 10;
+pub const SO_NO_CHECK: ::c_int = 11;
+pub const SO_PRIORITY: ::c_int = 12;
pub const SO_LINGER: ::c_int = 13;
+pub const SO_BSDCOMPAT: ::c_int = 14;
pub const SO_REUSEPORT: ::c_int = 15;
+pub const SO_PASSCRED: ::c_int = 16;
+pub const SO_PEERCRED: ::c_int = 17;
+pub const SO_RCVLOWAT: ::c_int = 18;
+pub const SO_SNDLOWAT: ::c_int = 19;
pub const SO_RCVTIMEO: ::c_int = 20;
pub const SO_SNDTIMEO: ::c_int = 21;
+pub const SO_ACCEPTCONN: ::c_int = 30;
+pub const SO_PEERSEC: ::c_int = 31;
+pub const SO_SNDBUFFORCE: ::c_int = 32;
+pub const SO_RCVBUFFORCE: ::c_int = 33;
+pub const SO_PROTOCOL: ::c_int = 38;
+pub const SO_DOMAIN: ::c_int = 39;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
+pub const SOCK_NONBLOCK: ::c_int = 0o4_000;
+pub const SOCK_CLOEXEC: ::c_int = 0o2_000_000;
+pub const SOCK_SEQPACKET: ::c_int = 5;
pub const SOL_SOCKET: ::c_int = 1;
// sys/termios.h
extern "C" {
// errno.h
pub fn __errno_location() -> *mut ::c_int;
- pub fn strerror_r(
- errnum: ::c_int,
- buf: *mut c_char,
- buflen: ::size_t,
- ) -> ::c_int;
+ pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
// unistd.h
pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
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;
+ pub fn epoll_ctl(epfd: ::c_int, op: ::c_int, fd: ::c_int, event: *mut ::epoll_event)
+ -> ::c_int;
// sys/ioctl.h
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
// sys/mman.h
- pub fn msync(
- addr: *mut ::c_void,
- len: ::size_t,
- flags: ::c_int,
- ) -> ::c_int;
- pub fn mprotect(
- addr: *mut ::c_void,
- len: ::size_t,
- prot: ::c_int,
- ) -> ::c_int;
- pub fn shm_open(
- name: *const c_char,
- oflag: ::c_int,
- mode: mode_t,
- ) -> ::c_int;
+ pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+ pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+ pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
// sys/resource.h
pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
// sys/socket.h
- pub fn bind(
- socket: ::c_int,
- address: *const ::sockaddr,
- address_len: ::socklen_t,
- ) -> ::c_int;
+ pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
pub fn recvfrom(
socket: ::c_int,
buf: *mut ::c_void,
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
// sys/uio.h
- pub fn readv(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- ) -> ::ssize_t;
- pub fn writev(
- fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int,
- ) -> ::ssize_t;
+ pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
+ pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
// sys/utsname.h
pub fn uname(utsname: *mut utsname) -> ::c_int;