From 684c4574c09a6f2cc5a208e4505e9306602b4abc Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Mon, 29 May 2017 14:07:12 -0700 Subject: Update libc crate to 0.2.23 The 'libc' create got a couple of updates. This change imports the new code and bumps the version to use. Import subrepo libc/:libc at 7db3fd570dfb41a38fb17116e93679307178103a --- libc/src/unix/notbsd/android/b32/mod.rs | 3 + libc/src/unix/notbsd/android/b64/aarch64.rs | 56 ++++++++++++++++++ libc/src/unix/notbsd/android/b64/mod.rs | 70 +++++------------------ libc/src/unix/notbsd/android/b64/x86_64.rs | 50 ++++++++++++++++ libc/src/unix/notbsd/android/mod.rs | 13 ++++- libc/src/unix/notbsd/linux/mips/mips32.rs | 2 +- libc/src/unix/notbsd/linux/mips/mips64.rs | 2 +- libc/src/unix/notbsd/linux/mips/mod.rs | 3 +- libc/src/unix/notbsd/linux/mod.rs | 45 +++++++++++++++ libc/src/unix/notbsd/linux/musl/mod.rs | 6 +- libc/src/unix/notbsd/linux/other/b32/arm.rs | 1 + libc/src/unix/notbsd/linux/other/b32/powerpc.rs | 1 + libc/src/unix/notbsd/linux/other/b32/x86.rs | 1 + libc/src/unix/notbsd/linux/other/b64/aarch64.rs | 1 + libc/src/unix/notbsd/linux/other/b64/powerpc64.rs | 1 + libc/src/unix/notbsd/linux/other/b64/sparc64.rs | 1 + libc/src/unix/notbsd/linux/other/b64/x86_64.rs | 1 + libc/src/unix/notbsd/linux/other/mod.rs | 3 +- libc/src/unix/notbsd/linux/s390x.rs | 4 +- libc/src/unix/notbsd/mod.rs | 40 +++++-------- 20 files changed, 215 insertions(+), 89 deletions(-) create mode 100644 libc/src/unix/notbsd/android/b64/aarch64.rs create mode 100644 libc/src/unix/notbsd/android/b64/x86_64.rs (limited to 'libc/src/unix/notbsd') diff --git a/libc/src/unix/notbsd/android/b32/mod.rs b/libc/src/unix/notbsd/android/b32/mod.rs index 9efcd61..32f88e4 100644 --- a/libc/src/unix/notbsd/android/b32/mod.rs +++ b/libc/src/unix/notbsd/android/b32/mod.rs @@ -1,3 +1,6 @@ +// The following definitions are correct for arm and i686, +// but may be wrong for mips + pub type c_long = i32; pub type c_ulong = u32; pub type mode_t = u16; diff --git a/libc/src/unix/notbsd/android/b64/aarch64.rs b/libc/src/unix/notbsd/android/b64/aarch64.rs new file mode 100644 index 0000000..89c505d --- /dev/null +++ b/libc/src/unix/notbsd/android/b64/aarch64.rs @@ -0,0 +1,56 @@ +pub type c_char = u8; +pub type wchar_t = u32; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::c_uint, + pub st_nlink: ::c_uint, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad1: ::c_ulong, + pub st_size: ::off64_t, + pub st_blksize: ::c_int, + __pad2: ::c_int, + pub st_blocks: ::c_long, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_ulong, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_ulong, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_ulong, + __unused4: ::c_uint, + __unused5: ::c_uint, + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::c_uint, + pub st_nlink: ::c_uint, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad1: ::c_ulong, + pub st_size: ::off64_t, + pub st_blksize: ::c_int, + __pad2: ::c_int, + pub st_blocks: ::c_long, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_ulong, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_ulong, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_ulong, + __unused4: ::c_uint, + __unused5: ::c_uint, + } +} + +pub const O_DIRECT: ::c_int = 0x10000; +pub const O_DIRECTORY: ::c_int = 0x4000; +pub const O_NOFOLLOW: ::c_int = 0x8000; + +pub const SYS_gettid: ::c_long = 178; diff --git a/libc/src/unix/notbsd/android/b64/mod.rs b/libc/src/unix/notbsd/android/b64/mod.rs index 31a05d6..98a2f39 100644 --- a/libc/src/unix/notbsd/android/b64/mod.rs +++ b/libc/src/unix/notbsd/android/b64/mod.rs @@ -1,12 +1,11 @@ -// The following definitions are correct for aarch64 and may be wrong for x86_64 +// The following definitions are correct for aarch64 and x86_64, +// but may be wrong for mips64 -pub type c_char = u8; pub type c_long = i64; pub type c_ulong = u64; pub type mode_t = u32; pub type off64_t = i64; pub type socklen_t = u32; -pub type wchar_t = u32; s! { pub struct sigset_t { @@ -17,7 +16,7 @@ s! { pub sa_flags: ::c_uint, pub sa_sigaction: ::sighandler_t, pub sa_mask: ::sigset_t, - _restorer: *mut ::c_void, + pub sa_restorer: ::dox::Option, } pub struct rlimit64 { @@ -25,52 +24,6 @@ s! { pub rlim_max: ::c_ulonglong, } - pub struct stat { - pub st_dev: ::dev_t, - pub st_ino: ::ino_t, - pub st_mode: ::c_uint, - pub st_nlink: ::c_uint, - pub st_uid: ::uid_t, - pub st_gid: ::gid_t, - pub st_rdev: ::dev_t, - __pad1: ::c_ulong, - pub st_size: ::off64_t, - pub st_blksize: ::c_int, - __pad2: ::c_int, - pub st_blocks: ::c_long, - pub st_atime: ::time_t, - pub st_atime_nsec: ::c_ulong, - pub st_mtime: ::time_t, - pub st_mtime_nsec: ::c_ulong, - pub st_ctime: ::time_t, - pub st_ctime_nsec: ::c_ulong, - __unused4: ::c_uint, - __unused5: ::c_uint, - } - - pub struct stat64 { - pub st_dev: ::dev_t, - pub st_ino: ::ino_t, - pub st_mode: ::c_uint, - pub st_nlink: ::c_uint, - pub st_uid: ::uid_t, - pub st_gid: ::gid_t, - pub st_rdev: ::dev_t, - __pad1: ::c_ulong, - pub st_size: ::off64_t, - pub st_blksize: ::c_int, - __pad2: ::c_int, - pub st_blocks: ::c_long, - pub st_atime: ::time_t, - pub st_atime_nsec: ::c_ulong, - pub st_mtime: ::time_t, - pub st_mtime_nsec: ::c_ulong, - pub st_ctime: ::time_t, - pub st_ctime_nsec: ::c_ulong, - __unused4: ::c_uint, - __unused5: ::c_uint, - } - pub struct pthread_attr_t { pub flags: ::uint32_t, pub stack_base: *mut ::c_void, @@ -143,15 +96,10 @@ s! { } } -pub const O_DIRECT: ::c_int = 0x10000; -pub const O_DIRECTORY: ::c_int = 0x4000; -pub const O_NOFOLLOW: ::c_int = 0x8000; - pub const RTLD_GLOBAL: ::c_int = 0x00100; pub const RTLD_NOW: ::c_int = 2; pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; -pub const SYS_gettid: ::c_long = 178; pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { value: 0, __reserved: [0; 36], @@ -200,3 +148,15 @@ extern { // the return type should be ::ssize_t, but it is c_int! pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::c_int; } + +cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; + pub use self::x86_64::*; + } else if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; + } else { + // Unknown target_arch + } +} diff --git a/libc/src/unix/notbsd/android/b64/x86_64.rs b/libc/src/unix/notbsd/android/b64/x86_64.rs new file mode 100644 index 0000000..58d07e1 --- /dev/null +++ b/libc/src/unix/notbsd/android/b64/x86_64.rs @@ -0,0 +1,50 @@ +pub type c_char = i8; +pub type wchar_t = i32; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::c_ulong, + pub st_mode: ::c_uint, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_size: ::off64_t, + pub st_blksize: ::c_long, + pub st_blocks: ::c_long, + pub st_atime: ::c_ulong, + pub st_atime_nsec: ::c_ulong, + pub st_mtime: ::c_ulong, + pub st_mtime_nsec: ::c_ulong, + pub st_ctime: ::c_ulong, + pub st_ctime_nsec: ::c_ulong, + __unused: [::c_long; 3], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::c_ulong, + pub st_mode: ::c_uint, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_size: ::off64_t, + pub st_blksize: ::c_long, + pub st_blocks: ::c_long, + pub st_atime: ::c_ulong, + pub st_atime_nsec: ::c_ulong, + pub st_mtime: ::c_ulong, + pub st_mtime_nsec: ::c_ulong, + pub st_ctime: ::c_ulong, + pub st_ctime_nsec: ::c_ulong, + __unused: [::c_long; 3], + } +} + +pub const O_DIRECT: ::c_int = 0x4000; +pub const O_DIRECTORY: ::c_int = 0x10000; +pub const O_NOFOLLOW: ::c_int = 0x20000; + +pub const SYS_gettid: ::c_long = 186; diff --git a/libc/src/unix/notbsd/android/mod.rs b/libc/src/unix/notbsd/android/mod.rs index cd20cb1..547d832 100644 --- a/libc/src/unix/notbsd/android/mod.rs +++ b/libc/src/unix/notbsd/android/mod.rs @@ -464,7 +464,6 @@ pub const TCSBRKP: ::c_int = 0x5425; pub const TCSANOW: ::c_int = 0; pub const TCSADRAIN: ::c_int = 0x1; pub const TCSAFLUSH: ::c_int = 0x2; -pub const IUTF8: ::tcflag_t = 0x00004000; pub const VEOF: usize = 4; pub const VEOL: usize = 11; pub const VEOL2: usize = 16; @@ -585,6 +584,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001; pub const MCL_FUTURE: ::c_int = 0x0002; pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; pub const CBAUD: ::tcflag_t = 0o0010017; pub const TAB1: ::c_int = 0x00000800; pub const TAB2: ::c_int = 0x00001000; @@ -753,6 +753,17 @@ f! { pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool { set1.__bits == set2.__bits } + pub fn major(dev: ::dev_t) -> ::c_int { + ((dev >> 8) & 0xfff) as ::c_int + } + pub fn minor(dev: ::dev_t) -> ::c_int { + ((dev & 0xff) | ((dev >> 12) & 0xfff00)) as ::c_int + } + pub fn makedev(ma: ::c_int, mi: ::c_int) -> ::dev_t { + let ma = ma as ::dev_t; + let mi = mi as ::dev_t; + ((ma & 0xfff) << 8) | (mi & 0xff) | ((mi & 0xfff00) << 12) + } } extern { diff --git a/libc/src/unix/notbsd/linux/mips/mips32.rs b/libc/src/unix/notbsd/linux/mips/mips32.rs index 22bb33b..042495e 100644 --- a/libc/src/unix/notbsd/linux/mips/mips32.rs +++ b/libc/src/unix/notbsd/linux/mips/mips32.rs @@ -86,7 +86,7 @@ s! { pub sa_flags: ::c_int, pub sa_sigaction: ::sighandler_t, pub sa_mask: sigset_t, - _restorer: *mut ::c_void, + pub sa_restorer: ::dox::Option, _resv: [::c_int; 1], } diff --git a/libc/src/unix/notbsd/linux/mips/mips64.rs b/libc/src/unix/notbsd/linux/mips/mips64.rs index 9478599..5b0484a 100644 --- a/libc/src/unix/notbsd/linux/mips/mips64.rs +++ b/libc/src/unix/notbsd/linux/mips/mips64.rs @@ -85,7 +85,7 @@ s! { pub sa_flags: ::c_int, pub sa_sigaction: ::sighandler_t, pub sa_mask: sigset_t, - _restorer: *mut ::c_void, + pub sa_restorer: ::dox::Option, } pub struct stack_t { diff --git a/libc/src/unix/notbsd/linux/mips/mod.rs b/libc/src/unix/notbsd/linux/mips/mod.rs index db580c9..7b1c15e 100644 --- a/libc/src/unix/notbsd/linux/mips/mod.rs +++ b/libc/src/unix/notbsd/linux/mips/mod.rs @@ -322,7 +322,7 @@ pub const VMIN: usize = 4; pub const IEXTEN: ::tcflag_t = 0x00000100; pub const TOSTOP: ::tcflag_t = 0x00008000; pub const FLUSHO: ::tcflag_t = 0x00002000; -pub const IUTF8: ::tcflag_t = 0x00004000; +pub const EXTPROC: ::tcflag_t = 0o200000; pub const TCSANOW: ::c_int = 0x540e; pub const TCSADRAIN: ::c_int = 0x540f; pub const TCSAFLUSH: ::c_int = 0x5410; @@ -420,6 +420,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001; pub const MCL_FUTURE: ::c_int = 0x0002; pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; pub const CBAUD: ::tcflag_t = 0o0010017; pub const TAB1: ::c_int = 0x00000800; pub const TAB2: ::c_int = 0x00001000; diff --git a/libc/src/unix/notbsd/linux/mod.rs b/libc/src/unix/notbsd/linux/mod.rs index 9774f93..b9375a3 100644 --- a/libc/src/unix/notbsd/linux/mod.rs +++ b/libc/src/unix/notbsd/linux/mod.rs @@ -220,6 +220,11 @@ s! { pub msgtql: ::c_int, pub msgseg: ::c_ushort, } + + pub struct mmsghdr { + pub msg_hdr: ::msghdr, + pub msg_len: ::c_uint, + } } pub const ABDAY_1: ::nl_item = 0x20000; @@ -692,6 +697,14 @@ pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2; pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3; pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4; +pub const XATTR_CREATE: ::c_int = 0x1; +pub const XATTR_REPLACE: ::c_int = 0x2; + +// On Linux, libc doesn't define this constant, libattr does instead. +// We still define it for Linux as it's defined by libc on other platforms, +// and it's mentioned in the man pages for getxattr and setxattr. +pub const ENOATTR: ::c_int = ::ENODATA; + f! { pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { for slot in cpuset.bits.iter_mut() { @@ -722,6 +735,31 @@ f! { pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool { set1.bits == set2.bits } + + pub fn major(dev: ::dev_t) -> ::c_uint { + let mut major = 0; + major |= (dev & 0x00000000000fff00) >> 8; + major |= (dev & 0xfffff00000000000) >> 32; + major as ::c_uint + } + + pub fn minor(dev: ::dev_t) -> ::c_uint { + let mut minor = 0; + minor |= (dev & 0xfffff00000000000) >> 0; + minor |= (dev & 0x00000ffffff00000) >> 12; + minor as ::c_uint + } + + pub fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t { + let major = major as ::dev_t; + let minor = minor as ::dev_t; + let mut dev = 0; + dev |= (major & 0x00000fff) << 8; + dev |= (major & 0xfffff000) << 32; + dev |= (minor & 0x000000ff) << 0; + dev |= (minor & 0xffffff00) << 12; + dev + } } extern { @@ -958,6 +996,13 @@ extern { -> ::ssize_t; } +extern { + pub fn sendmmsg(sockfd: ::c_int, msgvec: *mut mmsghdr, vlen: ::c_uint, + flags: ::c_int) -> ::c_int; + pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut mmsghdr, vlen: ::c_uint, + flags: ::c_int, timeout: *mut ::timespec) -> ::c_int; +} + cfg_if! { if #[cfg(any(target_env = "musl", target_os = "fuchsia", diff --git a/libc/src/unix/notbsd/linux/musl/mod.rs b/libc/src/unix/notbsd/linux/musl/mod.rs index 2bf13f9..b365028 100644 --- a/libc/src/unix/notbsd/linux/musl/mod.rs +++ b/libc/src/unix/notbsd/linux/musl/mod.rs @@ -35,7 +35,7 @@ s! { pub sa_sigaction: ::sighandler_t, pub sa_mask: ::sigset_t, pub sa_flags: ::c_int, - _restorer: *mut ::c_void, + pub sa_restorer: ::dox::Option, } pub struct ipc_perm { @@ -124,6 +124,9 @@ pub const EFD_CLOEXEC: ::c_int = 0x80000; pub const BUFSIZ: ::c_uint = 1024; pub const TMP_MAX: ::c_uint = 10000; pub const FOPEN_MAX: ::c_uint = 1000; +pub const O_PATH: ::c_int = 0o10000000; +pub const O_EXEC: ::c_int = 0o10000000; +pub const O_SEARCH: ::c_int = 0o10000000; pub const O_ACCMODE: ::c_int = 0o10000003; pub const O_NDELAY: ::c_int = O_NONBLOCK; pub const NI_MAXHOST: ::socklen_t = 255; @@ -236,6 +239,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001; pub const MCL_FUTURE: ::c_int = 0x0002; pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; pub const CBAUD: ::tcflag_t = 0o0010017; pub const TAB1: ::c_int = 0x00000800; pub const TAB2: ::c_int = 0x00001000; diff --git a/libc/src/unix/notbsd/linux/other/b32/arm.rs b/libc/src/unix/notbsd/linux/other/b32/arm.rs index cbd9e40..ee6d674 100644 --- a/libc/src/unix/notbsd/linux/other/b32/arm.rs +++ b/libc/src/unix/notbsd/linux/other/b32/arm.rs @@ -100,6 +100,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001; pub const MCL_FUTURE: ::c_int = 0x0002; pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; pub const CBAUD: ::tcflag_t = 0o0010017; pub const TAB1: ::c_int = 0x00000800; pub const TAB2: ::c_int = 0x00001000; diff --git a/libc/src/unix/notbsd/linux/other/b32/powerpc.rs b/libc/src/unix/notbsd/linux/other/b32/powerpc.rs index 13e9d36..035bfe1 100644 --- a/libc/src/unix/notbsd/linux/other/b32/powerpc.rs +++ b/libc/src/unix/notbsd/linux/other/b32/powerpc.rs @@ -103,6 +103,7 @@ pub const MCL_CURRENT: ::c_int = 0x2000; pub const MCL_FUTURE: ::c_int = 0x4000; pub const SIGSTKSZ: ::size_t = 0x4000; +pub const MINSIGSTKSZ: ::size_t = 4096; pub const CBAUD: ::tcflag_t = 0xff; pub const TAB1: ::c_int = 0x400; pub const TAB2: ::c_int = 0x800; diff --git a/libc/src/unix/notbsd/linux/other/b32/x86.rs b/libc/src/unix/notbsd/linux/other/b32/x86.rs index 68218ff..263e140 100644 --- a/libc/src/unix/notbsd/linux/other/b32/x86.rs +++ b/libc/src/unix/notbsd/linux/other/b32/x86.rs @@ -141,6 +141,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001; pub const MCL_FUTURE: ::c_int = 0x0002; pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; pub const CBAUD: ::tcflag_t = 0o0010017; pub const TAB1: ::c_int = 0x00000800; pub const TAB2: ::c_int = 0x00001000; diff --git a/libc/src/unix/notbsd/linux/other/b64/aarch64.rs b/libc/src/unix/notbsd/linux/other/b64/aarch64.rs index 26898c5..77cee3d 100644 --- a/libc/src/unix/notbsd/linux/other/b64/aarch64.rs +++ b/libc/src/unix/notbsd/linux/other/b64/aarch64.rs @@ -344,6 +344,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001; pub const MCL_FUTURE: ::c_int = 0x0002; pub const SIGSTKSZ: ::size_t = 16384; +pub const MINSIGSTKSZ: ::size_t = 5120; pub const CBAUD: ::tcflag_t = 0o0010017; pub const TAB1: ::c_int = 0x00000800; pub const TAB2: ::c_int = 0x00001000; diff --git a/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs b/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs index 1257023..8c19b07 100644 --- a/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs +++ b/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs @@ -342,6 +342,7 @@ pub const MCL_CURRENT: ::c_int = 0x2000; pub const MCL_FUTURE: ::c_int = 0x4000; pub const SIGSTKSZ: ::size_t = 0x4000; +pub const MINSIGSTKSZ: ::size_t = 4096; pub const CBAUD: ::tcflag_t = 0xff; pub const TAB1: ::c_int = 0x400; pub const TAB2: ::c_int = 0x800; diff --git a/libc/src/unix/notbsd/linux/other/b64/sparc64.rs b/libc/src/unix/notbsd/linux/other/b64/sparc64.rs index a1ac4f5..12598e0 100644 --- a/libc/src/unix/notbsd/linux/other/b64/sparc64.rs +++ b/libc/src/unix/notbsd/linux/other/b64/sparc64.rs @@ -301,6 +301,7 @@ pub const MCL_CURRENT: ::c_int = 0x2000; pub const MCL_FUTURE: ::c_int = 0x4000; pub const SIGSTKSZ: ::size_t = 16384; +pub const MINSIGSTKSZ: ::size_t = 4096; pub const CBAUD: ::tcflag_t = 0x0000100f; pub const TAB1: ::c_int = 0x800; pub const TAB2: ::c_int = 0x1000; diff --git a/libc/src/unix/notbsd/linux/other/b64/x86_64.rs b/libc/src/unix/notbsd/linux/other/b64/x86_64.rs index b5f2a82..b39ccb3 100644 --- a/libc/src/unix/notbsd/linux/other/b64/x86_64.rs +++ b/libc/src/unix/notbsd/linux/other/b64/x86_64.rs @@ -402,6 +402,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001; pub const MCL_FUTURE: ::c_int = 0x0002; pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; pub const CBAUD: ::tcflag_t = 0o0010017; pub const TAB1: ::c_int = 0x00000800; pub const TAB2: ::c_int = 0x00001000; diff --git a/libc/src/unix/notbsd/linux/other/mod.rs b/libc/src/unix/notbsd/linux/other/mod.rs index ad5cc69..b7a11a8 100644 --- a/libc/src/unix/notbsd/linux/other/mod.rs +++ b/libc/src/unix/notbsd/linux/other/mod.rs @@ -70,7 +70,7 @@ s! { #[cfg(target_arch = "sparc64")] __reserved0: ::c_int, pub sa_flags: ::c_int, - _restorer: *mut ::c_void, + pub sa_restorer: ::dox::Option, } pub struct stack_t { @@ -314,7 +314,6 @@ pub const TMPFS_MAGIC: ::c_long = 0x01021994; pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2; pub const VEOF: usize = 4; -pub const IUTF8: ::tcflag_t = 0x00004000; pub const CPU_SETSIZE: ::c_int = 0x400; diff --git a/libc/src/unix/notbsd/linux/s390x.rs b/libc/src/unix/notbsd/linux/s390x.rs index b646647..1c0cd56 100644 --- a/libc/src/unix/notbsd/linux/s390x.rs +++ b/libc/src/unix/notbsd/linux/s390x.rs @@ -86,7 +86,7 @@ s! { pub sa_sigaction: ::sighandler_t, __glibc_reserved0: ::c_int, pub sa_flags: ::c_int, - _restorer: *mut ::c_void, + pub sa_restorer: ::dox::Option, pub sa_mask: sigset_t, } @@ -339,6 +339,7 @@ pub const SA_ONSTACK: ::c_int = 0x08000000; pub const SA_SIGINFO: ::c_int = 4; pub const SIGBUS: ::c_int = 7; pub const SIGSTKSZ: ::size_t = 0x2000; +pub const MINSIGSTKSZ: ::size_t = 2048; pub const SIG_SETMASK: ::c_int = 2; pub const SOCK_DGRAM: ::c_int = 2; pub const SOCK_STREAM: ::c_int = 1; @@ -576,7 +577,6 @@ pub const VMIN: usize = 6; pub const IEXTEN: ::tcflag_t = 0x00008000; pub const TOSTOP: ::tcflag_t = 0x00000100; pub const FLUSHO: ::tcflag_t = 0x00001000; -pub const IUTF8: ::tcflag_t = 0x00004000; pub const CPU_SETSIZE: ::c_int = 0x400; diff --git a/libc/src/unix/notbsd/mod.rs b/libc/src/unix/notbsd/mod.rs index da6b928..b20d043 100644 --- a/libc/src/unix/notbsd/mod.rs +++ b/libc/src/unix/notbsd/mod.rs @@ -675,6 +675,7 @@ pub const IGNCR: ::tcflag_t = 0x00000080; pub const ICRNL: ::tcflag_t = 0x00000100; pub const IXANY: ::tcflag_t = 0x00000800; pub const IMAXBEL: ::tcflag_t = 0x00002000; +pub const IUTF8: ::tcflag_t = 0x00004000; pub const OPOST: ::tcflag_t = 0x1; pub const CS5: ::tcflag_t = 0x00000000; pub const CRTSCTS: ::tcflag_t = 0x80000000; @@ -728,6 +729,10 @@ pub const POSIX_FADV_WILLNEED: ::c_int = 3; pub const AT_FDCWD: ::c_int = -100; pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x100; +pub const AT_REMOVEDIR: ::c_int = 0x200; +pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400; +pub const AT_NO_AUTOMOUNT: ::c_int = 0x800; +pub const AT_EMPTY_PATH: ::c_int = 0x1000; pub const LOG_CRON: ::c_int = 9 << 3; pub const LOG_AUTHPRIV: ::c_int = 10 << 3; @@ -746,6 +751,9 @@ pub const P_ALL: idtype_t = 0; pub const P_PID: idtype_t = 1; pub const P_PGID: idtype_t = 2; +pub const UTIME_OMIT: c_long = 1073741822; +pub const UTIME_NOW: c_long = 1073741823; + f! { pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { let fd = fd as usize; @@ -917,44 +925,26 @@ extern { offset: off64_t) -> *mut ::c_void; pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int; + pub fn openat64(fd: ::c_int, + path: *const c_char, + oflag: ::c_int, ...) -> ::c_int; pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off64_t) -> ::ssize_t; pub fn pwrite64(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off64_t) -> ::ssize_t; + pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64; pub fn readdir64_r(dirp: *mut ::DIR, entry: *mut ::dirent64, result: *mut *mut ::dirent64) -> ::c_int; pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int; pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int; + pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int; pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; pub fn sysinfo (info: *mut ::sysinfo) -> ::c_int; - pub fn openat(dirfd: ::c_int, pathname: *const ::c_char, - flags: ::c_int, ...) -> ::c_int; - pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char, - mode: ::c_int, flags: ::c_int) -> ::c_int; - pub fn fchmodat(dirfd: ::c_int, pathname: *const ::c_char, - mode: ::mode_t, flags: ::c_int) -> ::c_int; - pub fn fchownat(dirfd: ::c_int, pathname: *const ::c_char, - owner: ::uid_t, group: ::gid_t, - flags: ::c_int) -> ::c_int; - pub fn fstatat(dirfd: ::c_int, pathname: *const ::c_char, - buf: *mut stat, flags: ::c_int) -> ::c_int; - pub fn linkat(olddirfd: ::c_int, oldpath: *const ::c_char, - newdirfd: ::c_int, newpath: *const ::c_char, - flags: ::c_int) -> ::c_int; - pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char, - mode: ::mode_t) -> ::c_int; + pub fn fdopendir(fd: ::c_int) -> *mut ::DIR; + pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t, dev: dev_t) -> ::c_int; - pub fn readlinkat(dirfd: ::c_int, pathname: *const ::c_char, - buf: *mut ::c_char, bufsiz: ::size_t) -> ::ssize_t; - pub fn renameat(olddirfd: ::c_int, oldpath: *const ::c_char, - newdirfd: ::c_int, newpath: *const ::c_char) - -> ::c_int; - pub fn symlinkat(target: *const ::c_char, newdirfd: ::c_int, - linkpath: *const ::c_char) -> ::c_int; - pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char, - flags: ::c_int) -> ::c_int; pub fn ppoll(fds: *mut ::pollfd, nfds: nfds_t, timeout: *const ::timespec, -- cgit v1.2.3