From bcaabae7c22d27fdbb07ea6009a6f4a9c3672fa2 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Sat, 16 Sep 2017 08:42:30 -0700 Subject: Update libc crate to 0.2.30 Import subrepo libc/:libc at 3520512a8c9cb55661910318a6fb169a75c02a59 --- libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs | 94 +++++++++++++++++++++----- 1 file changed, 76 insertions(+), 18 deletions(-) (limited to 'libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs') diff --git a/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs index e60825a..038a886 100644 --- a/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -131,13 +131,51 @@ s! { pub st_qspare1: ::int64_t, pub st_qspare2: ::int64_t, } + + pub struct if_data { + pub ifi_type: ::c_uchar, + pub ifi_physical: ::c_uchar, + pub ifi_addrlen: ::c_uchar, + pub ifi_hdrlen: ::c_uchar, + pub ifi_recvquota: ::c_uchar, + pub ifi_xmitquota: ::c_uchar, + pub ifi_mtu: ::c_ulong, + pub ifi_metric: ::c_ulong, + pub ifi_link_state: ::c_ulong, + pub ifi_baudrate: u64, + pub ifi_ipackets: ::c_ulong, + pub ifi_ierrors: ::c_ulong, + pub ifi_opackets: ::c_ulong, + pub ifi_oerrors: ::c_ulong, + pub ifi_collisions: ::c_ulong, + pub ifi_ibytes: ::c_ulong, + pub ifi_obytes: ::c_ulong, + pub ifi_imcasts: ::c_ulong, + pub ifi_omcasts: ::c_ulong, + pub ifi_iqdrops: ::c_ulong, + pub ifi_noproto: ::c_ulong, + pub ifi_hwassist: ::c_ulong, + pub ifi_oqdrops: ::c_ulong, + pub ifi_lastchange: ::timeval, + } + + pub struct if_msghdr { + pub ifm_msglen: ::c_ushort, + pub ifm_version: ::c_uchar, + pub ifm_type: ::c_uchar, + pub ifm_addrs: ::c_int, + pub ifm_flags: ::c_int, + pub ifm_index: ::c_ushort, + pub ifm_data: if_data, + } } pub const RAND_MAX: ::c_int = 0x7fff_ffff; -pub const PTHREAD_STACK_MIN: ::size_t = 1024; +pub const PTHREAD_STACK_MIN: ::size_t = 16384; pub const SIGSTKSZ: ::size_t = 40960; pub const MADV_INVAL: ::c_int = 10; pub const O_CLOEXEC: ::c_int = 0x00020000; +pub const O_DIRECTORY: ::c_int = 0x08000000; pub const F_GETLK: ::c_int = 7; pub const F_SETLK: ::c_int = 8; pub const F_SETLKW: ::c_int = 9; @@ -148,20 +186,20 @@ pub const RLIM_NLIMITS: ::rlim_t = 12; pub const Q_GETQUOTA: ::c_int = 0x300; pub const Q_SETQUOTA: ::c_int = 0x400; -pub const CLOCK_REALTIME: clockid_t = 0; -pub const CLOCK_VIRTUAL: clockid_t = 1; -pub const CLOCK_PROF: clockid_t = 2; -pub const CLOCK_MONOTONIC: clockid_t = 4; -pub const CLOCK_UPTIME: clockid_t = 5; -pub const CLOCK_UPTIME_PRECISE: clockid_t = 7; -pub const CLOCK_UPTIME_FAST: clockid_t = 8; -pub const CLOCK_REALTIME_PRECISE: clockid_t = 9; -pub const CLOCK_REALTIME_FAST: clockid_t = 10; -pub const CLOCK_MONOTONIC_PRECISE: clockid_t = 11; -pub const CLOCK_MONOTONIC_FAST: clockid_t = 12; -pub const CLOCK_SECOND: clockid_t = 13; -pub const CLOCK_THREAD_CPUTIME_ID: clockid_t = 14; -pub const CLOCK_PROCESS_CPUTIME_ID: clockid_t = 15; +pub const CLOCK_REALTIME: ::clockid_t = 0; +pub const CLOCK_VIRTUAL: ::clockid_t = 1; +pub const CLOCK_PROF: ::clockid_t = 2; +pub const CLOCK_MONOTONIC: ::clockid_t = 4; +pub const CLOCK_UPTIME: ::clockid_t = 5; +pub const CLOCK_UPTIME_PRECISE: ::clockid_t = 7; +pub const CLOCK_UPTIME_FAST: ::clockid_t = 8; +pub const CLOCK_REALTIME_PRECISE: ::clockid_t = 9; +pub const CLOCK_REALTIME_FAST: ::clockid_t = 10; +pub const CLOCK_MONOTONIC_PRECISE: ::clockid_t = 11; +pub const CLOCK_MONOTONIC_FAST: ::clockid_t = 12; +pub const CLOCK_SECOND: ::clockid_t = 13; +pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14; +pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 15; pub const CTL_UNSPEC: ::c_int = 0; pub const CTL_KERN: ::c_int = 1; @@ -302,6 +340,7 @@ pub const EVFILT_VNODE: ::int16_t = -4; pub const EVFILT_PROC: ::int16_t = -5; pub const EVFILT_SIGNAL: ::int16_t = -6; pub const EVFILT_TIMER: ::int16_t = -7; +pub const EVFILT_EXCEPT: ::int16_t = -8; pub const EVFILT_USER: ::int16_t = -9; pub const EVFILT_FS: ::int16_t = -10; @@ -404,12 +443,31 @@ pub const TIOCMODG: ::c_uint = 0x40047403; pub const TIOCMODS: ::c_ulong = 0x80047404; pub const TIOCREMOTE: ::c_ulong = 0x80047469; +// Constants used by "at" family of system calls. +pub const AT_FDCWD: ::c_int = 0xFFFAFDCD; // invalid file descriptor +pub const AT_SYMLINK_NOFOLLOW: ::c_int = 1; +pub const AT_REMOVEDIR: ::c_int = 2; +pub const AT_EACCESS: ::c_int = 4; +pub const AT_SYMLINK_FOLLOW: ::c_int = 8; + +pub const VCHECKPT: usize = 19; + +pub const _PC_2_SYMLINKS: ::c_int = 22; +pub const _PC_TIMESTAMP_RESOLUTION: ::c_int = 23; + +pub const _SC_V7_ILP32_OFF32: ::c_int = 122; +pub const _SC_V7_ILP32_OFFBIG: ::c_int = 123; +pub const _SC_V7_LP64_OFF64: ::c_int = 124; +pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 125; +pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 126; +pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 127; + extern { pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::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_settime(clk_id: clockid_t, tp: *const ::timespec) -> ::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_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; pub fn setutxdb(_type: ::c_uint, file: *mut ::c_char) -> ::c_int; -- cgit v1.2.1