From e2604a756aaddcd5919ee2f1b9cc0055d200f846 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Mon, 10 Dec 2018 21:00:27 -0800 Subject: Update libc crate to 0.2.45 This change updates the libc crate to version 0.2.45. Import subrepo libc/:libc at f5636fc618f8e16968b3178196d73c94ad9f7b05 --- libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs | 51 ++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (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 620fad4..0414380 100644 --- a/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -1,5 +1,6 @@ pub type clock_t = u64; pub type ino_t = u64; +pub type lwpid_t = i32; pub type nlink_t = u32; pub type blksize_t = i64; pub type clockid_t = ::c_ulong; @@ -114,6 +115,27 @@ s! { pub f_uid_uuid: ::uuid_t, } + pub struct statfs { + pub f_bsize: ::c_long, + pub f_iosize: ::c_long, + pub f_blocks: ::c_long, + pub f_bfree: ::c_long, + pub f_bavail: ::c_long, + pub f_files: ::c_long, + pub f_ffree: ::c_long, + pub f_fsid: ::fsid_t, + pub f_owner: ::uid_t, + pub f_type: ::int32_t, + pub f_flags: ::int32_t, + pub f_syncwrites: ::c_long, + pub f_asyncwrites: ::c_long, + pub f_fstypename: [::c_char; 16], + pub f_mntonname: [::c_char; 90], + pub f_syncreads: ::c_long, + pub f_asyncreads: ::c_long, + pub f_mntfromname: [::c_char; 90], + } + pub struct stat { pub st_ino: ::ino_t, pub st_nlink: ::nlink_t, @@ -200,6 +222,8 @@ 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; +pub const ENOMEDIUM: ::c_int = 93; +pub const EASYNC: ::c_int = 99; pub const ELAST: ::c_int = 99; pub const RLIMIT_POSIXLOCKS: ::c_int = 11; pub const RLIM_NLIMITS: ::rlim_t = 12; @@ -407,6 +431,8 @@ pub const NOTE_CHILD: ::uint32_t = 0x00000004; pub const SO_SNDSPACE: ::c_int = 0x100a; pub const SO_CPUHINT: ::c_int = 0x1030; +pub const PT_FIRSTMACH: ::c_int = 32; + // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/net/if.h#L101 pub const IFF_UP: ::c_int = 0x1; // interface is up pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid @@ -658,6 +684,11 @@ pub const IPPROTO_DONE: ::c_int = 257; /// Used by RSS: the layer3 protocol is unknown pub const IPPROTO_UNKNOWN: ::c_int = 258; +// sys/netinet/tcp.h +pub const TCP_SIGNATURE_ENABLE: ::c_int = 16; +pub const TCP_KEEPINIT: ::c_int = 32; +pub const TCP_FASTKEEP: ::c_int = 128; + pub const AF_BLUETOOTH: ::c_int = 33; pub const AF_MPLS: ::c_int = 34; pub const AF_IEEE80211: ::c_int = 35; @@ -737,6 +768,20 @@ pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 127; pub const WCONTINUED: ::c_int = 4; pub const WSTOPPED: ::c_int = 0o177; +// Values for struct rtprio (type_ field) +pub const RTP_PRIO_REALTIME: ::c_ushort = 0; +pub const RTP_PRIO_NORMAL: ::c_ushort = 1; +pub const RTP_PRIO_IDLE: ::c_ushort = 2; +pub const RTP_PRIO_THREAD: ::c_ushort = 3; + +// Flags for chflags(2) +pub const UF_NOHISTORY: ::c_ulong = 0x00000040; +pub const UF_CACHE: ::c_ulong = 0x00000080; +pub const UF_XLINK: ::c_ulong = 0x00000100; +pub const SF_NOHISTORY: ::c_ulong = 0x00400000; +pub const SF_CACHE: ::c_ulong = 0x00800000; +pub const SF_XLINK: ::c_ulong = 0x01000000; + extern { pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; @@ -750,4 +795,10 @@ extern { timeout: *mut ::timespec) -> ::c_int; pub fn freelocale(loc: ::locale_t); + + pub fn lwp_rtprio(function: ::c_int, pid: ::pid_t, lwpid: lwpid_t, + rtp: *mut super::rtprio) -> ::c_int; + + pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; + pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; } -- cgit v1.2.1