summaryrefslogtreecommitdiff
path: root/libc/src/unix/bsd/mod.rs
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2019-11-01 07:42:33 -0700
committerDaniel Mueller <deso@posteo.net>2019-11-01 07:42:33 -0700
commit49be10a8179165d24bbb8eb3490c4ca6f94b42c4 (patch)
tree642978648e57ba8b162a7378e8754df85ca83b37 /libc/src/unix/bsd/mod.rs
parent9f3991a74fa5124e298582afa60b229dd005be40 (diff)
downloadnitrocli-49be10a8179165d24bbb8eb3490c4ca6f94b42c4.tar.gz
nitrocli-49be10a8179165d24bbb8eb3490c4ca6f94b42c4.tar.bz2
Update libc crate to 0.2.66
This change updates the libc crate to version 0.2.66. Import subrepo libc/:libc at 4f11029a68040c90acf771976b019c1ef273a8cd
Diffstat (limited to 'libc/src/unix/bsd/mod.rs')
-rw-r--r--libc/src/unix/bsd/mod.rs324
1 files changed, 212 insertions, 112 deletions
diff --git a/libc/src/unix/bsd/mod.rs b/libc/src/unix/bsd/mod.rs
index ee64411..cf9f59e 100644
--- a/libc/src/unix/bsd/mod.rs
+++ b/libc/src/unix/bsd/mod.rs
@@ -103,7 +103,7 @@ s! {
}
}
-s_no_extra_traits!{
+s_no_extra_traits! {
pub struct sockaddr_un {
pub sun_len: u8,
pub sun_family: sa_family_t,
@@ -436,6 +436,20 @@ pub const POLLWRNORM: ::c_short = 0x004;
pub const POLLRDBAND: ::c_short = 0x080;
pub const POLLWRBAND: ::c_short = 0x100;
+pub const BIOCGBLEN: ::c_ulong = 0x40044266;
+pub const BIOCSBLEN: ::c_ulong = 0xc0044266;
+pub const BIOCFLUSH: ::c_uint = 0x20004268;
+pub const BIOCPROMISC: ::c_uint = 0x20004269;
+pub const BIOCGDLT: ::c_ulong = 0x4004426a;
+pub const BIOCGETIF: ::c_ulong = 0x4020426b;
+pub const BIOCSETIF: ::c_ulong = 0x8020426c;
+pub const BIOCGSTATS: ::c_ulong = 0x4008426f;
+pub const BIOCIMMEDIATE: ::c_ulong = 0x80044270;
+pub const BIOCVERSION: ::c_ulong = 0x40044271;
+pub const BIOCGHDRCMPLT: ::c_ulong = 0x40044274;
+pub const BIOCSHDRCMPLT: ::c_ulong = 0x80044275;
+pub const SIOCGIFADDR: ::c_ulong = 0xc0206921;
+
f! {
pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr {
if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() {
@@ -492,16 +506,23 @@ f! {
}
}
-extern {
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "getrlimit$UNIX2003")]
+extern "C" {
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86"),
+ link_name = "getrlimit$UNIX2003"
+ )]
pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "setrlimit$UNIX2003")]
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86"),
+ link_name = "setrlimit$UNIX2003"
+ )]
pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::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;
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;
@@ -510,8 +531,7 @@ extern {
pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
pub fn freeifaddrs(ifa: *mut ::ifaddrs);
- pub fn setgroups(ngroups: ::c_int,
- ptr: *const ::gid_t) -> ::c_int;
+ pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
pub fn kqueue() -> ::c_int;
pub fn unmount(target: *const ::c_char, arg: ::c_int) -> ::c_int;
@@ -529,152 +549,232 @@ extern {
pub fn if_nameindex() -> *mut if_nameindex;
pub fn if_freenameindex(ptr: *mut if_nameindex);
- pub fn getpeereid(socket: ::c_int,
- euid: *mut ::uid_t,
- egid: *mut ::gid_t) -> ::c_int;
+ pub fn getpeereid(
+ socket: ::c_int,
+ euid: *mut ::uid_t,
+ egid: *mut ::gid_t,
+ ) -> ::c_int;
#[cfg_attr(target_os = "macos", link_name = "glob$INODE64")]
#[cfg_attr(target_os = "netbsd", link_name = "__glob30")]
#[cfg_attr(
- all(target_os = "freebsd", freebsd11),
+ all(target_os = "freebsd", any(freebsd11, freebsd10)),
link_name = "glob@FBSD_1.0"
)]
- pub fn glob(pattern: *const ::c_char,
- flags: ::c_int,
- errfunc: ::Option<extern fn(epath: *const ::c_char,
- errno: ::c_int) -> ::c_int>,
- pglob: *mut ::glob_t) -> ::c_int;
+ pub fn glob(
+ pattern: *const ::c_char,
+ flags: ::c_int,
+ errfunc: ::Option<
+ extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int,
+ >,
+ pglob: *mut ::glob_t,
+ ) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__globfree30")]
#[cfg_attr(
- all(target_os = "freebsd", freebsd11),
+ all(target_os = "freebsd", any(freebsd11, freebsd10)),
link_name = "globfree@FBSD_1.0"
)]
pub fn globfree(pglob: *mut ::glob_t);
- pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
- -> ::c_int;
+ pub fn posix_madvise(
+ addr: *mut ::c_void,
+ len: ::size_t,
+ advice: ::c_int,
+ ) -> ::c_int;
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
- #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"),
- link_name = "seekdir$INODE64")]
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "seekdir$INODE64$UNIX2003")]
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86_64"),
+ link_name = "seekdir$INODE64"
+ )]
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86"),
+ link_name = "seekdir$INODE64$UNIX2003"
+ )]
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
- #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"),
- link_name = "telldir$INODE64")]
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "telldir$INODE64$UNIX2003")]
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86_64"),
+ link_name = "telldir$INODE64"
+ )]
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86"),
+ link_name = "telldir$INODE64$UNIX2003"
+ )]
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
- pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
- -> ::c_int;
+ pub fn madvise(
+ addr: *mut ::c_void,
+ len: ::size_t,
+ advice: ::c_int,
+ ) -> ::c_int;
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "msync$UNIX2003")]
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86"),
+ link_name = "msync$UNIX2003"
+ )]
#[cfg_attr(target_os = "netbsd", link_name = "__msync13")]
- pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+ pub fn msync(
+ addr: *mut ::c_void,
+ len: ::size_t,
+ flags: ::c_int,
+ ) -> ::c_int;
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "recvfrom$UNIX2003")]
- 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;
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86"),
+ link_name = "recvfrom$UNIX2003"
+ )]
+ 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;
#[cfg_attr(target_os = "netbsd", link_name = "__futimes50")]
pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "bind$UNIX2003")]
- pub fn bind(socket: ::c_int, address: *const ::sockaddr,
- address_len: ::socklen_t) -> ::c_int;
-
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "writev$UNIX2003")]
- pub fn writev(fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int) -> ::ssize_t;
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "readv$UNIX2003")]
- pub fn readv(fd: ::c_int,
- iov: *const ::iovec,
- iovcnt: ::c_int) -> ::ssize_t;
-
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "sendmsg$UNIX2003")]
- pub fn sendmsg(fd: ::c_int,
- msg: *const ::msghdr,
- flags: ::c_int) -> ::ssize_t;
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "recvmsg$UNIX2003")]
- pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
- -> ::ssize_t;
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86"),
+ link_name = "bind$UNIX2003"
+ )]
+ pub fn bind(
+ socket: ::c_int,
+ address: *const ::sockaddr,
+ address_len: ::socklen_t,
+ ) -> ::c_int;
+
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86"),
+ link_name = "writev$UNIX2003"
+ )]
+ pub fn writev(
+ fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int,
+ ) -> ::ssize_t;
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86"),
+ link_name = "readv$UNIX2003"
+ )]
+ pub fn readv(
+ fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int,
+ ) -> ::ssize_t;
+
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86"),
+ link_name = "sendmsg$UNIX2003"
+ )]
+ pub fn sendmsg(
+ fd: ::c_int,
+ msg: *const ::msghdr,
+ flags: ::c_int,
+ ) -> ::ssize_t;
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86"),
+ link_name = "recvmsg$UNIX2003"
+ )]
+ pub fn recvmsg(
+ fd: ::c_int,
+ msg: *mut ::msghdr,
+ flags: ::c_int,
+ ) -> ::ssize_t;
pub fn sync();
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")]
- pub fn getgrgid_r(gid: ::gid_t,
- grp: *mut ::group,
- 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")]
+ pub fn getgrgid_r(
+ gid: ::gid_t,
+ grp: *mut ::group,
+ 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 sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
pub fn sem_close(sem: *mut sem_t) -> ::c_int;
pub fn getdtablesize() -> ::c_int;
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrnam_r")]
- pub fn getgrnam_r(name: *const ::c_char,
- grp: *mut ::group,
- 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 getgrnam_r(
+ name: *const ::c_char,
+ grp: *mut ::group,
+ 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;
pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
- #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "pthread_cancel$UNIX2003")]
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86"),
+ link_name = "pthread_cancel$UNIX2003"
+ )]
pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
pub fn sem_unlink(name: *const ::c_char) -> ::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;
+ 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")]
+ 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;
- pub fn pthread_atfork(prepare: ::Option<unsafe extern fn()>,
- parent: ::Option<unsafe extern fn()>,
- child: ::Option<unsafe extern fn()>) -> ::c_int;
+ pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
+ pub fn pthread_atfork(
+ prepare: ::Option<unsafe extern "C" fn()>,
+ parent: ::Option<unsafe extern "C" fn()>,
+ child: ::Option<unsafe extern "C" 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;
- pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char,
- mode: ::c_int, flags: ::c_int) -> ::c_int;
- 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;
+ #[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;
+ pub fn faccessat(
+ dirfd: ::c_int,
+ pathname: *const ::c_char,
+ mode: ::c_int,
+ flags: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_create(
+ native: *mut ::pthread_t,
+ attr: *const ::pthread_attr_t,
+ f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+ value: *mut ::c_void,
+ ) -> ::c_int;
pub fn acct(filename: *const ::c_char) -> ::c_int;
}