libc-rs/src/unix/bsd/freebsdlike/freebsd/mod.rs

81 lines
2.3 KiB
Rust
Raw Normal View History

Squashed commit of the following: Running libc-test: PASSED 3426 tests commit 1a7ee714db34f17abd33dc9262d3e10275eec68d Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 13:30:56 2016 +0100 Fix RLIM_POSIXLOCKS -> RLIMIT_POSIXLOCKS commit 09c49a97ebebf087486659ef8277610d99e5c7b3 Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 13:29:24 2016 +0100 Ignore signedness check for uuid_t on DragonFly commit aab4d11f59917686280c271683bf00ff34c8040d Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 13:23:21 2016 +0100 Move FreeBSD-only function into freebsd/mod.rs commit 9921f030b103dbccb37930ab1d64cf1dd587bd48 Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 13:21:42 2016 +0100 Move POSIX_FADV_* to freebsd/mod.rs commit 2921c2db1e3d0314375aa371936bd227cc6c6e2a Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 13:20:11 2016 +0100 Fix signedness of blksize_t for DragonFly commit 65e817baee9e01d2d7c86c6202c63ee46d218914 Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 13:19:02 2016 +0100 Fix Q_{GET,SET}QUOTA for DragonFly commit a0d2d63ef88206d321222140ae6b3d92c93b51bd Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 13:17:27 2016 +0100 Fix RLIMIT_* for DragonFly commit d04a1600a7c66a792a481e1524a1652234a69939 Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 13:12:09 2016 +0100 Fix ELAST for DragonFly commit d120b9278426a76ee106e91e6c999885c1f5c7f4 Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 13:10:28 2016 +0100 Fix F_GETLK, F_SETLK, F_SETLKW for DragonFly commit 963f7da270a14f4d12ea1a52301e363ce745c897 Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 13:08:51 2016 +0100 Fix O_CLOEXEC for DragonFly commit f4d6c9d5991d690c7cb4460790a8e37e713bc034 Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 13:07:18 2016 +0100 Fix RAND_MAX for DragonFly commit ba48336da7be613a49702ad9de445ab3850ebb7c Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 13:04:48 2016 +0100 Fix statvfs for DragonFly commit 9ae480c60a7d77b31a17d34320464f4179e40a4a Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 12:51:47 2016 +0100 Fix fd_set for DragonFly commit a15e027838288c4980371c503252cca7e32356c0 Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 12:42:24 2016 +0100 Fix all remaining issues on DragonFly Missing functions and missing constats. commit 3966e4fce0cb81bd0b3ed8cdf50611e6982f7767 Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 12:27:14 2016 +0100 Use a macro instead of a constant. When using a constant, the libc-test thinks this constant exists as an C equivalent. commit 9b5659aaf54419f317250cb3a4692a1c14fdbc33 Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 12:21:01 2016 +0100 Use a constant in utsname commit 50484eda3c978a9c0a9652f6fc619c41ad349c2d Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 12:17:55 2016 +0100 Fix struct utsname commit 832e94248fabc91574d6d42630168da3542c153f Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 12:07:08 2016 +0100 DragonFly has different stat, dirent, clock_t, ino_t, nlink_t, blksize_t commit f3152a369d75ae8c1558afa5a59aa55e33b33ec6 Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 11:52:54 2016 +0100 Move DragonFly related stuff into dragonfly/* Replicate x86_64.rs from FreeBSD. Need some twists. commit 9fe35124064aa92303171d019004df119f948223 Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 11:49:38 2016 +0100 Move FreeBSD code under freebsd/*. Next commit will replicate some of the architecture dependent stuff for DragonFly. commit e91983df8deb14004f7a0fe47878f0e4eb31198d Author: Michael Neumann <mneumann@ntecs.de> Date: Sat Feb 20 11:44:25 2016 +0100 struct utsname has a different size on DragonFly
2016-02-20 13:34:01 +01:00
cfg_if! {
if #[cfg(target_arch = "x86")] {
mod x86;
pub use self::x86::*;
} else if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
} else {
// ...
}
}
pub type clock_t = i32;
pub type ino_t = u32;
pub type nlink_t = u16;
pub type blksize_t = u32;
s! {
pub struct dirent {
pub d_fileno: u32,
pub d_reclen: u16,
pub d_type: u8,
pub d_namlen: u8,
pub d_name: [::c_char; 256],
}
pub struct statvfs {
pub f_bavail: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_blocks: ::fsblkcnt_t,
pub f_favail: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_bsize: ::c_ulong,
pub f_flag: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_fsid: ::c_ulong,
pub f_namemax: ::c_ulong,
}
}
pub type fsblkcnt_t = ::uint64_t;
pub type fsfilcnt_t = ::uint64_t;
pub const RAND_MAX: ::c_int = 0x7fff_fffd;
pub const PTHREAD_STACK_MIN: ::size_t = 2048;
pub const KERN_PROC_PATHNAME: ::c_int = 12;
pub const SIGSTKSZ: ::size_t = 34816;
pub const SF_NODISKIO: ::c_int = 0x00000001;
pub const SF_MNOWAIT: ::c_int = 0x00000002;
pub const SF_SYNC: ::c_int = 0x00000004;
pub const O_CLOEXEC: ::c_int = 0x00100000;
pub const F_GETLK: ::c_int = 11;
pub const F_SETLK: ::c_int = 12;
pub const F_SETLKW: ::c_int = 13;
pub const ELAST: ::c_int = 96;
pub const RLIMIT_NPTS: ::c_int = 11;
pub const RLIMIT_SWAP: ::c_int = 12;
pub const RLIM_NLIMITS: ::rlim_t = 13;
pub const Q_GETQUOTA: ::c_int = 0x700;
pub const Q_SETQUOTA: ::c_int = 0x800;
pub const POSIX_FADV_NORMAL: ::c_int = 0;
pub const POSIX_FADV_RANDOM: ::c_int = 1;
pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
pub const POSIX_FADV_WILLNEED: ::c_int = 3;
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
extern {
pub fn __error() -> *mut ::c_int;
pub fn posix_fallocate(fd: ::c_int, offset: ::off_t,
len: ::off_t) -> ::c_int;
pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t,
advise: ::c_int) -> ::c_int;
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
}