repo
stringclasses 1
value | pull_number
int64 237
4.09k
| instance_id
stringlengths 19
20
| issue_numbers
listlengths 1
2
| base_commit
stringlengths 40
40
| patch
stringlengths 290
47.4k
| test_patch
stringlengths 196
263k
| problem_statement
stringlengths 18
8.89k
| hints_text
stringlengths 0
6.05k
| created_at
stringlengths 20
20
| version
stringclasses 2
values | environment_setup_commit
stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
rust-lang/libc
| 4,091
|
rust-lang__libc-4091
|
[
"3689"
] |
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs
index c4c7e6544b21b..ce274f2261279 100644
--- a/src/fuchsia/mod.rs
+++ b/src/fuchsia/mod.rs
@@ -382,7 +382,7 @@ s! {
}
pub struct fd_set {
- fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
+ fds_bits: [::c_ulong; FD_SETSIZE as usize / ULONG_SIZE],
}
pub struct tm {
diff --git a/src/lib.rs b/src/lib.rs
index 4f4cedb62f925..8af17cb0cb582 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -46,6 +46,8 @@ cfg_if! {
#[allow(unused_imports)]
use core::clone::Clone;
#[allow(unused_imports)]
+use core::ffi;
+#[allow(unused_imports)]
use core::fmt;
#[allow(unused_imports)]
use core::hash;
diff --git a/src/macros.rs b/src/macros.rs
index ff8afee32281a..2661e0fb13827 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -98,7 +98,7 @@ macro_rules! s_paren {
($(
$(#[$attr:meta])*
pub struct $i:ident ( $($field:tt)* );
- )* ) => ($(
+ )*) => ($(
__item! {
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
#[derive(Copy, Clone)]
diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs
index d404c3e8b52a1..a7ef2a073b7c1 100644
--- a/src/unix/aix/mod.rs
+++ b/src/unix/aix/mod.rs
@@ -60,6 +60,7 @@ pub type posix_spawn_file_actions_t = *mut ::c_char;
pub type iconv_t = *mut ::c_void;
e! {
+ #[repr(u32)]
pub enum uio_rw {
UIO_READ = 0,
UIO_WRITE,
@@ -573,7 +574,7 @@ cfg_if! {
}
impl Eq for __sigaction_sa_union {}
impl ::fmt::Debug for __sigaction_sa_union {
- fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
f.debug_struct("__sigaction_sa_union")
.field("__su_handler", unsafe { &self.__su_handler })
.field("__su_sigaction", unsafe { &self.__su_sigaction })
@@ -598,7 +599,7 @@ cfg_if! {
}
impl Eq for sigaction {}
impl ::fmt::Debug for sigaction {
- fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
f.debug_struct("sigaction")
.field("sa_union", &self.sa_union)
.field("sa_mask", &self.sa_mask)
@@ -625,7 +626,7 @@ cfg_if! {
}
impl Eq for __poll_ctl_ext_u {}
impl ::fmt::Debug for __poll_ctl_ext_u {
- fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
f.debug_struct("__poll_ctl_ext_u")
.field("addr", unsafe { &self.addr })
.field("data32", unsafe { &self.data32 })
@@ -655,7 +656,7 @@ cfg_if! {
}
impl Eq for poll_ctl_ext {}
impl ::fmt::Debug for poll_ctl_ext {
- fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
f.debug_struct("poll_ctl_ext")
.field("version", &self.version)
.field("command", &self.command)
diff --git a/src/unix/aix/powerpc64.rs b/src/unix/aix/powerpc64.rs
index e7f1b670823f8..f8ec9811be617 100644
--- a/src/unix/aix/powerpc64.rs
+++ b/src/unix/aix/powerpc64.rs
@@ -307,7 +307,7 @@ cfg_if! {
}
impl Eq for siginfo_t {}
impl ::fmt::Debug for siginfo_t {
- fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
f.debug_struct("siginfo_t")
.field("si_signo", &self.si_signo)
.field("si_errno", &self.si_errno)
@@ -347,7 +347,7 @@ cfg_if! {
}
impl Eq for _kernel_simple_lock {}
impl ::fmt::Debug for _kernel_simple_lock {
- fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
f.debug_struct("_kernel_simple_lock")
.field("_slock", unsafe { &self._slock })
.field("_slockp", unsafe { &self._slockp })
@@ -410,12 +410,12 @@ cfg_if! {
&& self.f_fnamep == other.f_fnamep
&& self.f_fdata == other.f_fdata
&& self.f_lock == other.f_lock
- && self.f_offset_lock == other.f_offset_lock;
+ && self.f_offset_lock == other.f_offset_lock
}
}
impl Eq for file {}
impl ::fmt::Debug for file {
- fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
f.debug_struct("file")
.field("f_flag", &self.f_flag)
.field("f_count", &self.f_count)
@@ -466,7 +466,7 @@ cfg_if! {
}
impl Eq for __ld_info_file {}
impl ::fmt::Debug for __ld_info_file {
- fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
f.debug_struct("__ld_info_file")
.field("_ldinfo_fd", unsafe { &self._ldinfo_fd })
.field("_ldinfo_fp", unsafe { &self._ldinfo_fp })
@@ -498,7 +498,7 @@ cfg_if! {
}
impl Eq for ld_info {}
impl ::fmt::Debug for ld_info {
- fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
f.debug_struct("ld_info")
.field("ldinfo_next", &self.ldinfo_next)
.field("ldinfo_flags", &self.ldinfo_flags)
@@ -535,7 +535,7 @@ cfg_if! {
}
impl Eq for __pollfd_ext_u {}
impl ::fmt::Debug for __pollfd_ext_u {
- fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
f.debug_struct("__pollfd_ext_u")
.field("addr", unsafe { &self.addr })
.field("data32", unsafe { &self.data32 })
@@ -563,7 +563,7 @@ cfg_if! {
}
impl Eq for pollfd_ext {}
impl ::fmt::Debug for pollfd_ext {
- fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
f.debug_struct("pollfd_ext")
.field("fd", &self.fd)
.field("events", &self.events)
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index 74eb9b45d5d2e..1bf743e1cd7ad 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -1595,7 +1595,7 @@ s_no_extra_traits! {
_os_unfair_lock_opaque: u32,
}
- #[repr(packed(1))]
+ #[repr(packed(1))]
pub struct sockaddr_vm {
pub svm_len: ::c_uchar,
pub svm_family: ::sa_family_t,
@@ -1722,8 +1722,7 @@ cfg_if! {
}
impl Eq for semun {}
impl ::fmt::Debug for semun {
- fn fmt(&self, f: &mut ::fmt::Formatter)
- -> ::fmt::Result {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("semun")
.field("val", unsafe { &self.val })
.finish()
@@ -1775,7 +1774,6 @@ cfg_if! {
&& self.udata == other.udata
}
}
-
impl Eq for kevent {}
impl ::fmt::Debug for kevent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs
index b49a83862f292..7e8d4d001c710 100644
--- a/src/unix/bsd/mod.rs
+++ b/src/unix/bsd/mod.rs
@@ -60,10 +60,10 @@ s! {
pub struct fd_set {
#[cfg(all(target_pointer_width = "64",
any(target_os = "freebsd", target_os = "dragonfly")))]
- fds_bits: [i64; FD_SETSIZE / 64],
+ fds_bits: [i64; FD_SETSIZE as usize / 64],
#[cfg(not(all(target_pointer_width = "64",
any(target_os = "freebsd", target_os = "dragonfly"))))]
- fds_bits: [i32; FD_SETSIZE / 32],
+ fds_bits: [i32; FD_SETSIZE as usize / 32],
}
pub struct tm {
@@ -129,7 +129,7 @@ s_no_extra_traits! {
pub struct sockaddr_un {
pub sun_len: u8,
pub sun_family: sa_family_t,
- pub sun_path: [c_char; 104]
+ pub sun_path: [::c_char; 104]
}
pub struct utsname {
diff --git a/src/unix/bsd/netbsdlike/netbsd/aarch64.rs b/src/unix/bsd/netbsdlike/netbsd/aarch64.rs
index 5f57779d3037e..e285d0617ce20 100644
--- a/src/unix/bsd/netbsdlike/netbsd/aarch64.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/aarch64.rs
@@ -81,6 +81,7 @@ cfg_if! {
}
pub(crate) const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
+
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2;
diff --git a/src/unix/linux_like/android/b32/mod.rs b/src/unix/linux_like/android/b32/mod.rs
index 1f4f796f2a94a..aa29267f9db50 100644
--- a/src/unix/linux_like/android/b32/mod.rs
+++ b/src/unix/linux_like/android/b32/mod.rs
@@ -9,6 +9,7 @@ pub type sigset_t = ::c_ulong;
pub type socklen_t = i32;
pub type time64_t = i64;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
s! {
pub struct sigaction {
diff --git a/src/unix/linux_like/android/b64/aarch64/mod.rs b/src/unix/linux_like/android/b64/aarch64/mod.rs
index 0d6f32ee3989c..9587770e8cb2c 100644
--- a/src/unix/linux_like/android/b64/aarch64/mod.rs
+++ b/src/unix/linux_like/android/b64/aarch64/mod.rs
@@ -1,6 +1,7 @@
pub type c_char = u8;
pub type wchar_t = u32;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
s! {
pub struct stat {
diff --git a/src/unix/linux_like/android/b64/riscv64/mod.rs b/src/unix/linux_like/android/b64/riscv64/mod.rs
index 0251804691fd6..82a3aa62f51a5 100644
--- a/src/unix/linux_like/android/b64/riscv64/mod.rs
+++ b/src/unix/linux_like/android/b64/riscv64/mod.rs
@@ -2,6 +2,7 @@ pub type c_char = i8;
pub type wchar_t = u32;
pub type greg_t = i64;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
s! {
pub struct stat {
diff --git a/src/unix/linux_like/android/b64/x86_64/mod.rs b/src/unix/linux_like/android/b64/x86_64/mod.rs
index f871fb2cd4a61..57a41a224fe2c 100644
--- a/src/unix/linux_like/android/b64/x86_64/mod.rs
+++ b/src/unix/linux_like/android/b64/x86_64/mod.rs
@@ -2,6 +2,7 @@ pub type c_char = i8;
pub type wchar_t = i32;
pub type greg_t = i64;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
s! {
pub struct stat {
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index 75f8a7877b617..3e30ce5bb17cf 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -514,8 +514,40 @@ s! {
pub ifr6_addr: ::in6_addr,
pub ifr6_prefixlen: u32,
pub ifr6_ifindex: ::c_int,
- }
+ }
+
+ pub struct statx {
+ pub stx_mask: ::__u32,
+ pub stx_blksize: ::__u32,
+ pub stx_attributes: ::__u64,
+ pub stx_nlink: ::__u32,
+ pub stx_uid: ::__u32,
+ pub stx_gid: ::__u32,
+ pub stx_mode: ::__u16,
+ __statx_pad1: [::__u16; 1],
+ pub stx_ino: ::__u64,
+ pub stx_size: ::__u64,
+ pub stx_blocks: ::__u64,
+ pub stx_attributes_mask: ::__u64,
+ pub stx_atime: ::statx_timestamp,
+ pub stx_btime: ::statx_timestamp,
+ pub stx_ctime: ::statx_timestamp,
+ pub stx_mtime: ::statx_timestamp,
+ pub stx_rdev_major: ::__u32,
+ pub stx_rdev_minor: ::__u32,
+ pub stx_dev_major: ::__u32,
+ pub stx_dev_minor: ::__u32,
+ pub stx_mnt_id: ::__u64,
+ pub stx_dio_mem_align: ::__u32,
+ pub stx_dio_offset_align: ::__u32,
+ __statx_pad3: [::__u64; 12],
+ }
+ pub struct statx_timestamp {
+ pub tv_sec: ::__s64,
+ pub tv_nsec: ::__u32,
+ pub __reserved: ::__s32,
+ }
}
s_no_extra_traits! {
@@ -4169,6 +4201,22 @@ extern "C" {
pub fn fgets_unlocked(buf: *mut ::c_char, size: ::c_int, stream: *mut ::FILE) -> *mut ::c_char;
pub fn klogctl(syslog_type: ::c_int, bufp: *mut ::c_char, len: ::c_int) -> ::c_int;
+
+ pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
+ pub fn renameat2(
+ olddirfd: ::c_int,
+ oldpath: *const ::c_char,
+ newdirfd: ::c_int,
+ newpath: *const ::c_char,
+ flags: ::c_uint,
+ ) -> ::c_int;
+ pub fn statx(
+ dirfd: ::c_int,
+ pathname: *const c_char,
+ flags: ::c_int,
+ mask: ::c_uint,
+ statxbuf: *mut statx,
+ ) -> ::c_int;
}
cfg_if! {
diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs
index bd943b99940f2..fd4c7868a63b9 100644
--- a/src/unix/linux_like/mod.rs
+++ b/src/unix/linux_like/mod.rs
@@ -85,7 +85,7 @@ s! {
}
pub struct fd_set {
- fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
+ fds_bits: [::c_ulong; FD_SETSIZE as usize / ULONG_SIZE],
}
pub struct tm {
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index 0a290b734a3d1..ebbf42d8140e2 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -940,6 +940,7 @@ extern "C" {
pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long;
pub fn pipe(fds: *mut ::c_int) -> ::c_int;
pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int;
+ pub fn aligned_alloc(alignment: ::size_t, size: ::size_t) -> *mut ::c_void;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "read$UNIX2003"
diff --git a/src/unix/newlib/mod.rs b/src/unix/newlib/mod.rs
index 3b02d93fb3dd7..6ecda27e04711 100644
--- a/src/unix/newlib/mod.rs
+++ b/src/unix/newlib/mod.rs
@@ -183,7 +183,7 @@ s! {
}
pub struct fd_set { // Unverified
- fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
+ fds_bits: [::c_ulong; FD_SETSIZE as usize / ULONG_SIZE],
}
pub struct passwd { // Unverified
diff --git a/src/unix/nto/mod.rs b/src/unix/nto/mod.rs
index 7c6eba66eea8d..90478d7aaf660 100644
--- a/src/unix/nto/mod.rs
+++ b/src/unix/nto/mod.rs
@@ -154,7 +154,7 @@ s! {
}
pub struct fd_set {
- fds_bits: [::c_uint; 2 * FD_SETSIZE / ULONG_SIZE],
+ fds_bits: [::c_uint; 2 * FD_SETSIZE as usize / ULONG_SIZE],
}
pub struct tm {
diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs
index 262079e042c5b..402857f9098cd 100644
--- a/src/unix/redox/mod.rs
+++ b/src/unix/redox/mod.rs
@@ -116,7 +116,7 @@ s! {
}
pub struct fd_set {
- fds_bits: [::c_ulong; ::FD_SETSIZE / ULONG_SIZE],
+ fds_bits: [::c_ulong; ::FD_SETSIZE as usize / ULONG_SIZE],
}
pub struct in_addr {
diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs
index a5190416836cd..503edf65663fd 100644
--- a/src/unix/solarish/mod.rs
+++ b/src/unix/solarish/mod.rs
@@ -513,9 +513,9 @@ s_no_extra_traits! {
pub struct fd_set {
#[cfg(target_pointer_width = "64")]
- fds_bits: [i64; FD_SETSIZE / 64],
+ fds_bits: [i64; FD_SETSIZE as usize / 64],
#[cfg(target_pointer_width = "32")]
- fds_bits: [i32; FD_SETSIZE / 32],
+ fds_bits: [i32; FD_SETSIZE as usize / 32],
}
pub struct sockaddr_storage {
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index c4b344f41b028..6b3e6abb166c3 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2075,7 +2075,7 @@ fn test_android(target: &str) {
"__system_property_wait" => true,
// Added in API level 30, but tests use level 28.
- "mlock2" => true,
+ "memfd_create" | "mlock2" | "renameat2" | "statx" | "statx_timestamp" => true,
// Added in glibc 2.25.
"getentropy" => true,
diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt
index 2c49d75c4466f..06a28efaac820 100644
--- a/libc-test/semver/android.txt
+++ b/libc-test/semver/android.txt
@@ -3469,6 +3469,7 @@ memalign
memchr
memcmp
memcpy
+memfd_create
memmem
memmove
memrchr
@@ -3484,6 +3485,7 @@ mknodat
mkstemp
mktime
mlock
+mlock2
mlockall
mmap
mmap64
@@ -3672,6 +3674,7 @@ remove
removexattr
rename
renameat
+renameat2
res_init
rewind
rewinddir
@@ -3797,6 +3800,8 @@ statfs
statfs64
statvfs
statvfs64
+statx
+statx_timestamp
strcasecmp
strcasestr
strcat
diff --git a/libc-test/semver/unix.txt b/libc-test/semver/unix.txt
index 6a18038c48ae3..093dde173137c 100644
--- a/libc-test/semver/unix.txt
+++ b/libc-test/semver/unix.txt
@@ -453,6 +453,7 @@ accept
access
addrinfo
alarm
+aligned_alloc
atexit
atof
atoi
|
Missing function: aligned_alloc
This function is part of the [C standard](https://en.cppreference.com/w/c/memory/aligned_alloc). I don't know the full set of targets that support it.
- Linux: [glibc has it](https://www.gnu.org/software/libc/manual/html_node/Aligned-Memory-Blocks.html), and I found it in [musl](https://git.musl-libc.org/cgit/musl/tree/src/malloc/mallocng/aligned_alloc.c?h=v1.2.2), too (but that uses `malloc` + offset -- no idea how they're making sure that you can `free` the resulting pointer)
- FreeBSD also [seems to have it](https://man.freebsd.org/cgi/man.cgi?query=aligned_alloc&apropos=0&sektion=3&manpath=FreeBSD+9-current&format=html)
- macOS: available since 10.15 according to [this](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92143) (but buggy until today... but that's not libc's concern)
- Solaris seems to [have it](https://docs.oracle.com/cd/E88353_01/html/E37843/aligned-alloc-3c.html), and same for [Illumos](https://illumos.org/man/3C/aligned_alloc) (again, [buggy](https://www.illumos.org/issues/16545)...)
- The function is mentioned [here](https://android.googlesource.com/platform/bionic/+/master/docs/status.md) so I assume (recent enough) Android also has it.
|
2024-11-18T09:42:55Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 4,086
|
rust-lang__libc-4086
|
[
"3190",
"3641"
] |
7c64d5d10c86bb1b19edf2c02bd3965bb4c80343
|
diff --git a/build.rs b/build.rs
index c8ffb7bf92ad2..e1c9b23c4617f 100644
--- a/build.rs
+++ b/build.rs
@@ -132,7 +132,7 @@ fn rustc_version_cmd(is_clippy_driver: bool) -> Output {
cmd.arg("--version");
- let output = cmd.output().ok().expect("Failed to get rustc version");
+ let output = cmd.output().expect("Failed to get rustc version");
if !output.status.success() {
panic!(
@@ -187,20 +187,14 @@ fn rustc_minor_nightly() -> (u32, bool) {
}
fn which_freebsd() -> Option<i32> {
- let output = std::process::Command::new("freebsd-version").output().ok();
- if output.is_none() {
- return None;
- }
- let output = output.unwrap();
+ let output = std::process::Command::new("freebsd-version")
+ .output()
+ .ok()?;
if !output.status.success() {
return None;
}
- let stdout = String::from_utf8(output.stdout).ok();
- if stdout.is_none() {
- return None;
- }
- let stdout = stdout.unwrap();
+ let stdout = String::from_utf8(output.stdout).ok()?;
match &stdout {
s if s.starts_with("10") => Some(10),
@@ -217,24 +211,16 @@ fn emcc_version_code() -> Option<u64> {
let output = std::process::Command::new("emcc")
.arg("-dumpversion")
.output()
- .ok();
- if output.is_none() {
- return None;
- }
- let output = output.unwrap();
+ .ok()?;
if !output.status.success() {
return None;
}
- let stdout = String::from_utf8(output.stdout).ok();
- if stdout.is_none() {
- return None;
- }
- let version = stdout.unwrap();
+ let version = String::from_utf8(output.stdout).ok()?;
// Some Emscripten versions come with `-git` attached, so split the
// version string also on the `-` char.
- let mut pieces = version.trim().split(|c| c == '.' || c == '-');
+ let mut pieces = version.trim().split(['.', '-']);
let major = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
let minor = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
diff --git a/ci/README.md b/ci/README.md
index b810cd4ac59c0..d97b98acfcd08 100644
--- a/ci/README.md
+++ b/ci/README.md
@@ -161,7 +161,7 @@ about above), and then shut down.
poweroff
1. Exit the post install shell: `exit`
- 1. Back in in the installer choose Reboot
+ 1. Back in the installer choose Reboot
1. If all went well the machine should reboot and show a login prompt. If you
switch to the serial console by choosing View > serial0 in the qemu menu,
you should be logged in as root.
diff --git a/ci/style.sh b/ci/style.sh
index 131632ff21dd4..0684caafaad7d 100755
--- a/ci/style.sh
+++ b/ci/style.sh
@@ -11,7 +11,7 @@ rustfmt -V
cargo fmt --all -- --check
if shellcheck --version ; then
- find . -name '*.sh' -exec shellcheck {} ';'
+ find . -name '*.sh' -print0 | xargs -0 shellcheck
else
echo "shellcheck not found"
exit 1
@@ -29,4 +29,12 @@ for file in libc-test/semver/*.txt; do
echo "Unsorted semver file $file"
exit 1
fi
+
+ duplicates=$(uniq -d "$file")
+ if [ -n "$duplicates" ]; then
+ echo "Semver file $file contains duplicates:"
+ echo "$duplicates"
+
+ exit 1
+ fi
done
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index cd8a67a1b9ec2..74eb9b45d5d2e 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -37,6 +37,8 @@ pub type rusage_info_t = *mut ::c_void;
pub type vm_offset_t = ::uintptr_t;
pub type vm_size_t = ::uintptr_t;
pub type vm_address_t = vm_offset_t;
+pub type quad_t = i64;
+pub type u_quad_t = u64;
pub type posix_spawnattr_t = *mut ::c_void;
pub type posix_spawn_file_actions_t = *mut ::c_void;
@@ -1233,6 +1235,78 @@ s! {
pub iffmid_id: u32,
pub iffmid_str: [::c_char; 1],
}
+
+ pub struct in6_addrlifetime {
+ pub ia6t_expire: time_t,
+ pub ia6t_preferred: time_t,
+ pub ia6t_vltime: u32,
+ pub ia6t_pltime: u32,
+ }
+
+ pub struct in6_ifstat {
+ pub ifs6_in_receive: ::u_quad_t,
+ pub ifs6_in_hdrerr: ::u_quad_t,
+ pub ifs6_in_toobig: ::u_quad_t,
+ pub ifs6_in_noroute: ::u_quad_t,
+ pub ifs6_in_addrerr: ::u_quad_t,
+ pub ifs6_in_protounknown: ::u_quad_t,
+ pub ifs6_in_truncated: ::u_quad_t,
+ pub ifs6_in_discard: ::u_quad_t,
+ pub ifs6_in_deliver: ::u_quad_t,
+ pub ifs6_out_forward: ::u_quad_t,
+ pub ifs6_out_request: ::u_quad_t,
+ pub ifs6_out_discard: ::u_quad_t,
+ pub ifs6_out_fragok: ::u_quad_t,
+ pub ifs6_out_fragfail: ::u_quad_t,
+ pub ifs6_out_fragcreat: ::u_quad_t,
+ pub ifs6_reass_reqd: ::u_quad_t,
+ pub ifs6_reass_ok: ::u_quad_t,
+ pub ifs6_atmfrag_rcvd: ::u_quad_t,
+ pub ifs6_reass_fail: ::u_quad_t,
+ pub ifs6_in_mcast: ::u_quad_t,
+ pub ifs6_out_mcast: ::u_quad_t,
+ pub ifs6_cantfoward_icmp6: ::u_quad_t,
+ pub ifs6_addr_expiry_cnt: ::u_quad_t,
+ pub ifs6_pfx_expiry_cnt: ::u_quad_t,
+ pub ifs6_defrtr_expiry_cnt: ::u_quad_t,
+ }
+
+ pub struct icmp6_ifstat {
+ pub ifs6_in_msg: ::u_quad_t,
+ pub ifs6_in_error: ::u_quad_t,
+ pub ifs6_in_dstunreach: ::u_quad_t,
+ pub ifs6_in_adminprohib: ::u_quad_t,
+ pub ifs6_in_timeexceed: ::u_quad_t,
+ pub ifs6_in_paramprob: ::u_quad_t,
+ pub ifs6_in_pkttoobig: ::u_quad_t,
+ pub ifs6_in_echo: ::u_quad_t,
+ pub ifs6_in_echoreply: ::u_quad_t,
+ pub ifs6_in_routersolicit: ::u_quad_t,
+ pub ifs6_in_routeradvert: ::u_quad_t,
+ pub ifs6_in_neighborsolicit: ::u_quad_t,
+ pub ifs6_in_neighboradvert: ::u_quad_t,
+ pub ifs6_in_redirect: ::u_quad_t,
+ pub ifs6_in_mldquery: ::u_quad_t,
+ pub ifs6_in_mldreport: ::u_quad_t,
+ pub ifs6_in_mlddone: ::u_quad_t,
+ pub ifs6_out_msg: ::u_quad_t,
+ pub ifs6_out_error: ::u_quad_t,
+ pub ifs6_out_dstunreach: ::u_quad_t,
+ pub ifs6_out_adminprohib: ::u_quad_t,
+ pub ifs6_out_timeexceed: ::u_quad_t,
+ pub ifs6_out_paramprob: ::u_quad_t,
+ pub ifs6_out_pkttoobig: ::u_quad_t,
+ pub ifs6_out_echo: ::u_quad_t,
+ pub ifs6_out_echoreply: ::u_quad_t,
+ pub ifs6_out_routersolicit: ::u_quad_t,
+ pub ifs6_out_routeradvert: ::u_quad_t,
+ pub ifs6_out_neighborsolicit: ::u_quad_t,
+ pub ifs6_out_neighboradvert: ::u_quad_t,
+ pub ifs6_out_redirect: ::u_quad_t,
+ pub ifs6_out_mldquery: ::u_quad_t,
+ pub ifs6_out_mldreport: ::u_quad_t,
+ pub ifs6_out_mlddone: ::u_quad_t,
+ }
}
s_no_extra_traits! {
@@ -1576,6 +1650,25 @@ s_no_extra_traits! {
pub ifcu_buf: *mut ::c_char,
pub ifcu_req: *mut ifreq,
}
+
+ pub union __c_anonymous_ifr_ifru6 {
+ pub ifru_addr: ::sockaddr_in6,
+ pub ifru_dstaddr: ::sockaddr_in6,
+ pub ifru_flags: ::c_int,
+ pub ifru_flags6: ::c_int,
+ pub ifru_metrics: ::c_int,
+ pub ifru_intval: ::c_int,
+ pub ifru_data: *mut ::c_char,
+ pub ifru_lifetime: in6_addrlifetime,
+ pub ifru_stat: in6_ifstat,
+ pub ifru_icmp6stat: icmp6_ifstat,
+ pub ifru_scope_id: [u32; SCOPE6_ID_MAX],
+ }
+
+ pub struct in6_ifreq {
+ pub ifr_name: [::c_char; ::IFNAMSIZ],
+ pub ifr_ifru: __c_anonymous_ifr_ifru6,
+ }
}
impl siginfo_t {
@@ -3151,6 +3244,74 @@ cfg_if! {
unsafe { self.ifcu_req.hash(state) };
}
}
+
+ impl PartialEq for __c_anonymous_ifr_ifru6 {
+ fn eq(&self, other: &__c_anonymous_ifr_ifru6) -> bool {
+ unsafe {
+ self.ifru_addr == other.ifru_addr
+ && self.ifru_dstaddr == other.ifru_dstaddr
+ && self.ifru_flags == other.ifru_flags
+ && self.ifru_flags6 == other.ifru_flags6
+ && self.ifru_metrics == other.ifru_metrics
+ && self.ifru_intval == other.ifru_intval
+ && self.ifru_data == other.ifru_data
+ && self.ifru_scope_id
+ .iter()
+ .zip(other.ifru_scope_id.iter())
+ .all(|(a,b)| a == b)
+ }
+ }
+ }
+
+ impl Eq for __c_anonymous_ifr_ifru6 {}
+
+ impl ::fmt::Debug for __c_anonymous_ifr_ifru6 {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("__c_anonymous_ifr_ifru6")
+ .field("ifru_addr", unsafe { &self.ifru_addr })
+ .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
+ .field("ifru_flags", unsafe { &self.ifru_flags })
+ .field("ifru_flags6", unsafe { &self.ifru_flags6 })
+ .field("ifru_metrics", unsafe { &self.ifru_metrics })
+ .field("ifru_intval", unsafe { &self.ifru_intval })
+ .field("ifru_data", unsafe { &self.ifru_data })
+ .field("ifru_scope_id", unsafe { &self.ifru_scope_id })
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for __c_anonymous_ifr_ifru6 {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ unsafe {
+ self.ifru_addr.hash(state);
+ self.ifru_dstaddr.hash(state);
+ self.ifru_flags.hash(state);
+ self.ifru_flags6.hash(state);
+ self.ifru_metrics.hash(state);
+ self.ifru_intval.hash(state);
+ self.ifru_data.hash(state);
+ self.ifru_scope_id.hash(state);
+ }
+ }
+ }
+
+ impl PartialEq for in6_ifreq {
+ fn eq(&self, other: &in6_ifreq) -> bool {
+ self.ifr_name == other.ifr_name
+ && self.ifr_ifru == other.ifr_ifru
+ }
+ }
+
+ impl Eq for in6_ifreq {}
+
+ impl ::fmt::Debug for in6_ifreq {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("in6_ifreq")
+ .field("ifr_name", &self.ifr_name)
+ .field("ifr_ifru", &self.ifr_ifru)
+ .finish()
+ }
+ }
}
}
@@ -4340,6 +4501,8 @@ pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
+pub const SCOPE6_ID_MAX: ::size_t = 16;
+
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
pub const SHUT_RDWR: ::c_int = 2;
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index 1cb8ab4c34845..9b69ccbbb74de 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -4902,6 +4902,12 @@ pub const TFD_TIMER_CANCEL_ON_SET: ::c_int = 0x02;
pub const CLOSE_RANGE_CLOEXEC: ::c_uint = 1 << 2;
+pub const KCMP_FILE: ::c_int = 100;
+pub const KCMP_FILEOBJ: ::c_int = 101;
+pub const KCMP_FILES: ::c_int = 102;
+pub const KCMP_SIGHAND: ::c_int = 103;
+pub const KCMP_VM: ::c_int = 104;
+
pub const fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
a << 24
}
@@ -5625,6 +5631,14 @@ extern "C" {
argv: *const *const ::c_char,
envp: *const *const ::c_char,
) -> ::c_int;
+
+ pub fn kcmp(
+ pid1: ::pid_t,
+ pid2: ::pid_t,
+ type_: ::c_int,
+ idx1: ::c_ulong,
+ idx2: ::c_ulong,
+ ) -> ::c_int;
}
#[link(name = "memstat")]
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index 2829b249dd0b6..75f8a7877b617 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -2349,9 +2349,11 @@ pub const NF_INET_FORWARD: ::c_int = 2;
pub const NF_INET_LOCAL_OUT: ::c_int = 3;
pub const NF_INET_POST_ROUTING: ::c_int = 4;
pub const NF_INET_NUMHOOKS: ::c_int = 5;
+pub const NF_INET_INGRESS: ::c_int = NF_INET_NUMHOOKS;
pub const NF_NETDEV_INGRESS: ::c_int = 0;
-pub const NF_NETDEV_NUMHOOKS: ::c_int = 1;
+pub const NF_NETDEV_EGRESS: ::c_int = 1;
+pub const NF_NETDEV_NUMHOOKS: ::c_int = 2;
pub const NFPROTO_UNSPEC: ::c_int = 0;
pub const NFPROTO_INET: ::c_int = 1;
@@ -2363,6 +2365,31 @@ pub const NFPROTO_IPV6: ::c_int = 10;
pub const NFPROTO_DECNET: ::c_int = 12;
pub const NFPROTO_NUMPROTO: ::c_int = 13;
+// linux/netfilter_arp.h
+pub const NF_ARP: ::c_int = 0;
+pub const NF_ARP_IN: ::c_int = 0;
+pub const NF_ARP_OUT: ::c_int = 1;
+pub const NF_ARP_FORWARD: ::c_int = 2;
+pub const NF_ARP_NUMHOOKS: ::c_int = 3;
+
+// linux/netfilter_bridge.h
+pub const NF_BR_PRE_ROUTING: ::c_int = 0;
+pub const NF_BR_LOCAL_IN: ::c_int = 1;
+pub const NF_BR_FORWARD: ::c_int = 2;
+pub const NF_BR_LOCAL_OUT: ::c_int = 3;
+pub const NF_BR_POST_ROUTING: ::c_int = 4;
+pub const NF_BR_BROUTING: ::c_int = 5;
+pub const NF_BR_NUMHOOKS: ::c_int = 6;
+
+pub const NF_BR_PRI_FIRST: ::c_int = ::INT_MIN;
+pub const NF_BR_PRI_NAT_DST_BRIDGED: ::c_int = -300;
+pub const NF_BR_PRI_FILTER_BRIDGED: ::c_int = -200;
+pub const NF_BR_PRI_BRNF: ::c_int = 0;
+pub const NF_BR_PRI_NAT_DST_OTHER: ::c_int = 100;
+pub const NF_BR_PRI_FILTER_OTHER: ::c_int = 200;
+pub const NF_BR_PRI_NAT_SRC: ::c_int = 300;
+pub const NF_BR_PRI_LAST: ::c_int = ::INT_MAX;
+
// linux/netfilter_ipv4.h
pub const NF_IP_PRE_ROUTING: ::c_int = 0;
pub const NF_IP_LOCAL_IN: ::c_int = 1;
@@ -2372,6 +2399,7 @@ pub const NF_IP_POST_ROUTING: ::c_int = 4;
pub const NF_IP_NUMHOOKS: ::c_int = 5;
pub const NF_IP_PRI_FIRST: ::c_int = ::INT_MIN;
+pub const NF_IP_PRI_RAW_BEFORE_DEFRAG: ::c_int = -450;
pub const NF_IP_PRI_CONNTRACK_DEFRAG: ::c_int = -400;
pub const NF_IP_PRI_RAW: ::c_int = -300;
pub const NF_IP_PRI_SELINUX_FIRST: ::c_int = -225;
@@ -2395,6 +2423,7 @@ pub const NF_IP6_POST_ROUTING: ::c_int = 4;
pub const NF_IP6_NUMHOOKS: ::c_int = 5;
pub const NF_IP6_PRI_FIRST: ::c_int = ::INT_MIN;
+pub const NF_IP6_PRI_RAW_BEFORE_DEFRAG: ::c_int = -450;
pub const NF_IP6_PRI_CONNTRACK_DEFRAG: ::c_int = -400;
pub const NF_IP6_PRI_RAW: ::c_int = -300;
pub const NF_IP6_PRI_SELINUX_FIRST: ::c_int = -225;
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index aa7213f77ee70..9cc2425fc6b6f 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -28,6 +28,8 @@ pub type Elf32_Half = u16;
pub type Elf32_Word = u32;
pub type Elf32_Off = u32;
pub type Elf32_Addr = u32;
+pub type Elf32_Xword = u64;
+pub type Elf32_Sword = i32;
pub type Elf64_Half = u16;
pub type Elf64_Word = u32;
@@ -35,10 +37,23 @@ pub type Elf64_Off = u64;
pub type Elf64_Addr = u64;
pub type Elf64_Xword = u64;
pub type Elf64_Sxword = i64;
+pub type Elf64_Sword = i32;
pub type Elf32_Section = u16;
pub type Elf64_Section = u16;
+pub type Elf32_Relr = Elf32_Word;
+pub type Elf64_Relr = Elf32_Xword;
+pub type Elf32_Rel = __c_anonymous_elf32_rel;
+pub type Elf64_Rel = __c_anonymous_elf64_rel;
+
+cfg_if! {
+ if #[cfg(not(target_arch = "sparc64"))] {
+ pub type Elf32_Rela = __c_anonymous_elf32_rela;
+ pub type Elf64_Rela = __c_anonymous_elf64_rela;
+ }
+}
+
// linux/can.h
pub type canid_t = u32;
@@ -980,6 +995,24 @@ s! {
}
}
+cfg_if! {
+ if #[cfg(not(target_arch = "sparc64"))] {
+ s!{
+ pub struct __c_anonymous_elf32_rela {
+ pub r_offset: Elf32_Addr,
+ pub r_info: Elf32_Word,
+ pub r_addend: Elf32_Sword,
+ }
+
+ pub struct __c_anonymous_elf64_rela {
+ pub r_offset: Elf64_Addr,
+ pub r_info: Elf64_Xword,
+ pub r_addend: Elf64_Sxword,
+ }
+ }
+ }
+}
+
s_no_extra_traits! {
pub struct sockaddr_nl {
pub nl_family: ::sa_family_t,
@@ -3336,20 +3369,47 @@ pub const NF_INET_FORWARD: ::c_int = 2;
pub const NF_INET_LOCAL_OUT: ::c_int = 3;
pub const NF_INET_POST_ROUTING: ::c_int = 4;
pub const NF_INET_NUMHOOKS: ::c_int = 5;
+pub const NF_INET_INGRESS: ::c_int = NF_INET_NUMHOOKS;
+
+pub const NF_NETDEV_INGRESS: ::c_int = 0;
+pub const NF_NETDEV_EGRESS: ::c_int = 1;
+pub const NF_NETDEV_NUMHOOKS: ::c_int = 2;
// Some NFPROTO are not compatible with musl and are defined in submodules.
pub const NFPROTO_UNSPEC: ::c_int = 0;
+pub const NFPROTO_INET: ::c_int = 1;
pub const NFPROTO_IPV4: ::c_int = 2;
pub const NFPROTO_ARP: ::c_int = 3;
+pub const NFPROTO_NETDEV: ::c_int = 5;
pub const NFPROTO_BRIDGE: ::c_int = 7;
pub const NFPROTO_IPV6: ::c_int = 10;
pub const NFPROTO_DECNET: ::c_int = 12;
pub const NFPROTO_NUMPROTO: ::c_int = 13;
-pub const NFPROTO_INET: ::c_int = 1;
-pub const NFPROTO_NETDEV: ::c_int = 5;
-pub const NF_NETDEV_INGRESS: ::c_int = 0;
-pub const NF_NETDEV_NUMHOOKS: ::c_int = 1;
+// linux/netfilter_arp.h
+pub const NF_ARP: ::c_int = 0;
+pub const NF_ARP_IN: ::c_int = 0;
+pub const NF_ARP_OUT: ::c_int = 1;
+pub const NF_ARP_FORWARD: ::c_int = 2;
+pub const NF_ARP_NUMHOOKS: ::c_int = 3;
+
+// linux/netfilter_bridge.h
+pub const NF_BR_PRE_ROUTING: ::c_int = 0;
+pub const NF_BR_LOCAL_IN: ::c_int = 1;
+pub const NF_BR_FORWARD: ::c_int = 2;
+pub const NF_BR_LOCAL_OUT: ::c_int = 3;
+pub const NF_BR_POST_ROUTING: ::c_int = 4;
+pub const NF_BR_BROUTING: ::c_int = 5;
+pub const NF_BR_NUMHOOKS: ::c_int = 6;
+
+pub const NF_BR_PRI_FIRST: ::c_int = ::INT_MIN;
+pub const NF_BR_PRI_NAT_DST_BRIDGED: ::c_int = -300;
+pub const NF_BR_PRI_FILTER_BRIDGED: ::c_int = -200;
+pub const NF_BR_PRI_BRNF: ::c_int = 0;
+pub const NF_BR_PRI_NAT_DST_OTHER: ::c_int = 100;
+pub const NF_BR_PRI_FILTER_OTHER: ::c_int = 200;
+pub const NF_BR_PRI_NAT_SRC: ::c_int = 300;
+pub const NF_BR_PRI_LAST: ::c_int = ::INT_MAX;
// linux/netfilter_ipv4.h
pub const NF_IP_PRE_ROUTING: ::c_int = 0;
@@ -3360,6 +3420,7 @@ pub const NF_IP_POST_ROUTING: ::c_int = 4;
pub const NF_IP_NUMHOOKS: ::c_int = 5;
pub const NF_IP_PRI_FIRST: ::c_int = ::INT_MIN;
+pub const NF_IP_PRI_RAW_BEFORE_DEFRAG: ::c_int = -450;
pub const NF_IP_PRI_CONNTRACK_DEFRAG: ::c_int = -400;
pub const NF_IP_PRI_RAW: ::c_int = -300;
pub const NF_IP_PRI_SELINUX_FIRST: ::c_int = -225;
@@ -3383,6 +3444,7 @@ pub const NF_IP6_POST_ROUTING: ::c_int = 4;
pub const NF_IP6_NUMHOOKS: ::c_int = 5;
pub const NF_IP6_PRI_FIRST: ::c_int = ::INT_MIN;
+pub const NF_IP6_PRI_RAW_BEFORE_DEFRAG: ::c_int = -450;
pub const NF_IP6_PRI_CONNTRACK_DEFRAG: ::c_int = -400;
pub const NF_IP6_PRI_RAW: ::c_int = -300;
pub const NF_IP6_PRI_SELINUX_FIRST: ::c_int = -225;
@@ -5324,6 +5386,30 @@ f! {
pub fn BPF_JUMP(code: ::__u16, k: ::__u32, jt: ::__u8, jf: ::__u8) -> sock_filter {
sock_filter{code: code, jt: jt, jf: jf, k: k}
}
+
+ pub fn ELF32_R_SYM(val: Elf32_Word) -> Elf32_Word {
+ val >> 8
+ }
+
+ pub fn ELF32_R_TYPE(val: Elf32_Word) -> Elf32_Word {
+ val & 0xff
+ }
+
+ pub fn ELF32_R_INFO(sym: Elf32_Word, t: Elf32_Word) -> Elf32_Word {
+ sym << 8 + t & 0xff
+ }
+
+ pub fn ELF64_R_SYM(val: Elf64_Xword) -> Elf64_Xword {
+ val >> 32
+ }
+
+ pub fn ELF64_R_TYPE(val: Elf64_Xword) -> Elf64_Xword {
+ val & 0xffffffff
+ }
+
+ pub fn ELF64_R_INFO(sym: Elf64_Xword, t: Elf64_Xword) -> Elf64_Xword {
+ sym << 32 + t
+ }
}
safe_f! {
diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs
index 978423b0f2a0d..bfdbb0f0bad59 100644
--- a/src/unix/linux_like/linux/musl/mod.rs
+++ b/src/unix/linux_like/linux/musl/mod.rs
@@ -993,6 +993,13 @@ extern "C" {
actions: *mut ::posix_spawn_file_actions_t,
fd: ::c_int,
) -> ::c_int;
+
+ pub fn getutxent() -> *mut utmpx;
+ pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
+ pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
+ pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
+ pub fn setutxent();
+ pub fn endutxent();
}
// Alias <foo> to <foo>64 to mimic glibc's LFS64 support
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index ce2f75eb312aa..511e166d364ce 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -232,6 +232,7 @@ fn test_apple(target: &str) {
"netinet/ip.h",
"netinet/tcp.h",
"netinet/udp.h",
+ "netinet6/in6_var.h",
"os/clock.h",
"os/lock.h",
"os/signpost.h",
@@ -401,6 +402,7 @@ fn test_apple(target: &str) {
("__darwin_arm_neon_state64", "__v") => true,
("ifreq", "ifr_ifru") => true,
+ ("in6_ifreq", "ifr_ifru") => true,
("ifkpi", "ifk_data") => true,
("ifconf", "ifc_ifcu") => true,
// FIXME: this field has been incorporated into a resized `rmx_filler` array.
@@ -1789,6 +1791,8 @@ fn test_android(target: &str) {
"linux/netfilter/nfnetlink_log.h",
"linux/netfilter/nfnetlink_queue.h",
"linux/netfilter/nf_tables.h",
+ "linux/netfilter_arp.h",
+ "linux/netfilter_bridge.h",
"linux/netfilter_ipv4.h",
"linux/netfilter_ipv6.h",
"linux/netfilter_ipv6/ip6_tables.h",
@@ -1858,6 +1862,7 @@ fn test_android(target: &str) {
// These are tested in the `linux_elf.rs` file.
"Elf64_Phdr" | "Elf32_Phdr" => true,
+
// These are intended to be opaque
"posix_spawn_file_actions_t" => true,
"posix_spawnattr_t" => true,
@@ -2463,7 +2468,7 @@ fn test_freebsd(target: &str) {
true
}
- // Added in in FreeBSD 13.0 (r367776 and r367287)
+ // Added in FreeBSD 13.0 (r367776 and r367287)
"SCM_CREDS2" | "LOCAL_CREDS_PERSISTENT" if Some(13) > freebsd_ver => true,
// Added in FreeBSD 14
@@ -2593,6 +2598,13 @@ fn test_freebsd(target: &str) {
true
}
+ // Added in FreeBSD 14.1
+ "KCMP_FILE" | "KCMP_FILEOBJ" | "KCMP_FILES" | "KCMP_SIGHAND" | "KCMP_VM"
+ if Some(14) > freebsd_ver =>
+ {
+ true
+ }
+
// FIXME: Removed in FreeBSD 15:
"LOCAL_CONNWAIT" if freebsd_ver >= Some(15) => true,
@@ -2713,6 +2725,9 @@ fn test_freebsd(target: &str) {
true
}
+ // Those are introduced in FreeBSD 14.1.
+ "kcmp" => true,
+
_ => false,
}
});
@@ -3591,6 +3606,8 @@ fn test_linux(target: &str) {
"linux/netfilter/nfnetlink_log.h",
"linux/netfilter/nfnetlink_queue.h",
"linux/netfilter/nf_tables.h",
+ "linux/netfilter_arp.h",
+ "linux/netfilter_bridge.h",
"linux/netfilter_ipv4.h",
"linux/netfilter_ipv6.h",
"linux/netfilter_ipv6/ip6_tables.h",
@@ -3678,6 +3695,14 @@ fn test_linux(target: &str) {
});
cfg.skip_type(move |ty| {
+ // FIXME: very recent additions to musl, not yet released.
+ // also apparently some glibc versions
+ if ty == "Elf32_Relr" || ty == "Elf64_Relr" {
+ return true;
+ }
+ if sparc64 && (ty == "Elf32_Rela" || ty == "Elf64_Rela") {
+ return true;
+ }
match ty {
// FIXME: `sighandler_t` type is incorrect, see:
// https://github.com/rust-lang/libc/issues/1359
@@ -4112,9 +4137,15 @@ fn test_linux(target: &str) {
| "MINSIGSTKSZ"
if gnu => true,
- // FIXME: Linux >= 5.16 changed its value:
+ // FIXME: Linux >= 5.10:
+ // https://github.com/torvalds/linux/commit/d25e2e9388eda61b6e298585024ee3355f50c493
+ "NF_INET_INGRESS" if musl => true,
+
+ // FIXME: Linux >= 5.16:
// https://github.com/torvalds/linux/commit/42df6e1d221dddc0f2acf2be37e68d553ad65f96
- "NF_NETDEV_NUMHOOKS" => true,
+ "NF_NETDEV_EGRESS" if musl || sparc64 => true,
+ // value changed
+ "NF_NETDEV_NUMHOOKS" if musl || sparc64 => true,
// FIXME: requires Linux >= 5.6:
| "RESOLVE_BENEATH"
diff --git a/libc-test/semver/TODO-linux.txt b/libc-test/semver/TODO-linux.txt
index 7855498efafcf..8427cf1ea12c8 100644
--- a/libc-test/semver/TODO-linux.txt
+++ b/libc-test/semver/TODO-linux.txt
@@ -1,4 +1,4 @@
-# The following symbols are not not available in some combinations of
+# The following symbols are not available in some combinations of
# musl/gnu/android and/or architecture.
KEYCTL_CAPABILITIES
KEYCTL_CAPS0_BIG_KEY
diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt
index b679acdcf28ed..2c49d75c4466f 100644
--- a/libc-test/semver/android.txt
+++ b/libc-test/semver/android.txt
@@ -1,6 +1,3 @@
-
-
-
ABS_CNT
ABS_MAX
ADDR_COMPAT_LAYOUT
@@ -1692,8 +1689,29 @@ NFULNL_COPY_PACKET
NFULNL_MSG_CONFIG
NFULNL_MSG_PACKET
NF_ACCEPT
+NF_ARP
+NF_ARP_FORWARD
+NF_ARP_IN
+NF_ARP_NUMHOOKS
+NF_ARP_OUT
+NF_BR_BROUTING
+NF_BR_FORWARD
+NF_BR_LOCAL_IN
+NF_BR_LOCAL_OUT
+NF_BR_NUMHOOKS
+NF_BR_POST_ROUTING
+NF_BR_PRE_ROUTING
+NF_BR_PRI_BRNF
+NF_BR_PRI_FILTER_BRIDGED
+NF_BR_PRI_FILTER_OTHER
+NF_BR_PRI_FIRST
+NF_BR_PRI_LAST
+NF_BR_PRI_NAT_DST_BRIDGED
+NF_BR_PRI_NAT_DST_OTHER
+NF_BR_PRI_NAT_SRC
NF_DROP
NF_INET_FORWARD
+NF_INET_INGRESS
NF_INET_LOCAL_IN
NF_INET_LOCAL_OUT
NF_INET_NUMHOOKS
@@ -1715,6 +1733,7 @@ NF_IP6_PRI_MANGLE
NF_IP6_PRI_NAT_DST
NF_IP6_PRI_NAT_SRC
NF_IP6_PRI_RAW
+NF_IP6_PRI_RAW_BEFORE_DEFRAG
NF_IP6_PRI_SECURITY
NF_IP6_PRI_SELINUX_FIRST
NF_IP6_PRI_SELINUX_LAST
@@ -1735,10 +1754,12 @@ NF_IP_PRI_MANGLE
NF_IP_PRI_NAT_DST
NF_IP_PRI_NAT_SRC
NF_IP_PRI_RAW
+NF_IP_PRI_RAW_BEFORE_DEFRAG
NF_IP_PRI_SECURITY
NF_IP_PRI_SELINUX_FIRST
NF_IP_PRI_SELINUX_LAST
NF_MAX_VERDICT
+NF_NETDEV_EGRESS
NF_NETDEV_INGRESS
NF_NETDEV_NUMHOOKS
NF_QUEUE
diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt
index 36faea40179a5..1b278d66a15b5 100644
--- a/libc-test/semver/apple.txt
+++ b/libc-test/semver/apple.txt
@@ -2003,6 +2003,7 @@ globfree
host_cpu_load_info
host_cpu_load_info_data_t
host_cpu_load_info_t
+icmp6_ifstat
iconv
iconv_close
iconv_open
@@ -2018,6 +2019,9 @@ ifconf
ifkpi
ifreq
image_offset
+in6_addrlifetime
+in6_ifreq
+in6_ifstat
in6_pktinfo
in_pktinfo
initgroups
@@ -2338,6 +2342,7 @@ timeval32
timex
truncate
ttyname_r
+u_quad_t
ucontext_t
unmount
useconds_t
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt
index ba4902ee780a2..853e4c0043ddc 100644
--- a/libc-test/semver/freebsd.txt
+++ b/libc-test/semver/freebsd.txt
@@ -689,6 +689,11 @@ JAIL_SYS_DISABLE
JAIL_SYS_INHERIT
JAIL_SYS_NEW
JAIL_UPDATE
+KCMP_FILE
+KCMP_FILEOBJ
+KCMP_FILES
+KCMP_SIGHAND
+KCMP_VM
KENV_DUMP
KENV_DUMP_LOADER
KENV_DUMP_STATIC
@@ -2007,6 +2012,7 @@ jail_get
jail_remove
jail_set
jrand48
+kcmp
kevent
key_t
killpg
diff --git a/libc-test/semver/linux-aarch64.txt b/libc-test/semver/linux-aarch64.txt
index 7e2566b6f0b1a..9dceaeccb819b 100644
--- a/libc-test/semver/linux-aarch64.txt
+++ b/libc-test/semver/linux-aarch64.txt
@@ -38,6 +38,8 @@ BPF_W
BPF_X
BPF_XOR
CIBAUD
+Elf32_Rela
+Elf64_Rela
FICLONE
FICLONERANGE
MADV_SOFT_OFFLINE
diff --git a/libc-test/semver/linux-i686.txt b/libc-test/semver/linux-i686.txt
index 73d4ca3554321..d914ca7f9285d 100644
--- a/libc-test/semver/linux-i686.txt
+++ b/libc-test/semver/linux-i686.txt
@@ -15,6 +15,8 @@ EFL
EIP
ES
ESI
+Elf32_Rela
+Elf64_Rela
FS
GS
KEYCTL_CAPABILITIES
diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt
index b307f90353ef0..62b188dac8288 100644
--- a/libc-test/semver/linux-musl.txt
+++ b/libc-test/semver/linux-musl.txt
@@ -78,11 +78,15 @@ copy_file_range
ctermid
dirname
eaccess
+endutxent
euidaccess
explicit_bzero
futimes
getauxval
getloadavg
+getutxent
+getutxid
+getutxline
lio_listio
ntptimeval
open_wmemstream
@@ -94,8 +98,10 @@ prlimit
prlimit64
process_vm_readv
process_vm_writev
+pututxline
pwritev2
pwritev64
reallocarray
+setutxent
tcp_info
timex
diff --git a/libc-test/semver/linux-powerpc64.txt b/libc-test/semver/linux-powerpc64.txt
index 99be508e6bd59..77718d9ce47f0 100644
--- a/libc-test/semver/linux-powerpc64.txt
+++ b/libc-test/semver/linux-powerpc64.txt
@@ -2,6 +2,8 @@ B2500000
B3000000
B3500000
B4000000
+Elf32_Rela
+Elf64_Rela
KEYCTL_CAPABILITIES
KEYCTL_CAPS0_BIG_KEY
KEYCTL_CAPS0_CAPABILITIES
diff --git a/libc-test/semver/linux-riscv64gc.txt b/libc-test/semver/linux-riscv64gc.txt
index 28a115b234638..13f5b85196790 100644
--- a/libc-test/semver/linux-riscv64gc.txt
+++ b/libc-test/semver/linux-riscv64gc.txt
@@ -10,6 +10,8 @@ COMPAT_HWCAP_ISA_F
COMPAT_HWCAP_ISA_I
COMPAT_HWCAP_ISA_M
COMPAT_HWCAP_ISA_V
+Elf32_Rela
+Elf64_Rela
KEYCTL_CAPABILITIES
KEYCTL_CAPS0_BIG_KEY
KEYCTL_CAPS0_CAPABILITIES
diff --git a/libc-test/semver/linux-x86_64.txt b/libc-test/semver/linux-x86_64.txt
index a26f63d6d5a6c..f1ed29b8f299d 100644
--- a/libc-test/semver/linux-x86_64.txt
+++ b/libc-test/semver/linux-x86_64.txt
@@ -41,6 +41,8 @@ CIBAUD
CS
DS
ES
+Elf32_Rela
+Elf64_Rela
FS
GS
MADV_SOFT_OFFLINE
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index 5b0fca57b3e11..f549c977a60ba 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -418,6 +418,12 @@ EL2HLT
EL2NSYNC
EL3HLT
EL3RST
+ELF32_R_INFO
+ELF32_R_SYM
+ELF32_R_TYPE
+ELF64_R_INFO
+ELF64_R_SYM
+ELF64_R_TYPE
ELFCLASS32
ELFCLASS64
ELFCLASSNONE
@@ -697,17 +703,24 @@ Elf32_Ehdr
Elf32_Half
Elf32_Off
Elf32_Phdr
+Elf32_Rel
+Elf32_Relr
Elf32_Section
Elf32_Shdr
+Elf32_Sword
Elf32_Sym
Elf32_Word
+Elf32_Xword
Elf64_Addr
Elf64_Ehdr
Elf64_Half
Elf64_Off
Elf64_Phdr
+Elf64_Rel
+Elf64_Relr
Elf64_Section
Elf64_Shdr
+Elf64_Sword
Elf64_Sxword
Elf64_Sym
Elf64_Word
@@ -1852,8 +1865,29 @@ NFULNL_COPY_PACKET
NFULNL_MSG_CONFIG
NFULNL_MSG_PACKET
NF_ACCEPT
+NF_ARP
+NF_ARP_FORWARD
+NF_ARP_IN
+NF_ARP_NUMHOOKS
+NF_ARP_OUT
+NF_BR_BROUTING
+NF_BR_FORWARD
+NF_BR_LOCAL_IN
+NF_BR_LOCAL_OUT
+NF_BR_NUMHOOKS
+NF_BR_POST_ROUTING
+NF_BR_PRE_ROUTING
+NF_BR_PRI_BRNF
+NF_BR_PRI_FILTER_BRIDGED
+NF_BR_PRI_FILTER_OTHER
+NF_BR_PRI_FIRST
+NF_BR_PRI_LAST
+NF_BR_PRI_NAT_DST_BRIDGED
+NF_BR_PRI_NAT_DST_OTHER
+NF_BR_PRI_NAT_SRC
NF_DROP
NF_INET_FORWARD
+NF_INET_INGRESS
NF_INET_LOCAL_IN
NF_INET_LOCAL_OUT
NF_INET_NUMHOOKS
@@ -1875,6 +1909,7 @@ NF_IP6_PRI_MANGLE
NF_IP6_PRI_NAT_DST
NF_IP6_PRI_NAT_SRC
NF_IP6_PRI_RAW
+NF_IP6_PRI_RAW_BEFORE_DEFRAG
NF_IP6_PRI_SECURITY
NF_IP6_PRI_SELINUX_FIRST
NF_IP6_PRI_SELINUX_LAST
@@ -1895,10 +1930,12 @@ NF_IP_PRI_MANGLE
NF_IP_PRI_NAT_DST
NF_IP_PRI_NAT_SRC
NF_IP_PRI_RAW
+NF_IP_PRI_RAW_BEFORE_DEFRAG
NF_IP_PRI_SECURITY
NF_IP_PRI_SELINUX_FIRST
NF_IP_PRI_SELINUX_LAST
NF_MAX_VERDICT
+NF_NETDEV_EGRESS
NF_QUEUE
NF_REPEAT
NF_STOLEN
|
utmp function family missing on musl
Hello,
functions like getutxent, setutxent, endutxent, struct utmpx, etc. are missing from the musl implementation ( src/unix/linux_like/linux/musl/mod.rs ), even though those functions are implemented in musl (see https://git.musl-libc.org/cgit/musl/tree/include/utmpx.h ).
As reference, see this [commit](https://github.com/rust-lang/libc/commit/98fd3188e7d46db84d321475344f2f82d958b0c7) which added the function for solaris, as well as the man page: https://linux.die.net/man/3/endutxent
Libc-test fails on linux due to Undeclared symbols Elf32_Relr and Elf64_Relr
`cargo test -p libc-test` fails on linux.
I've attached `cargo test -p libc-test`
The libc-test work on windows. For linux and mac, they fail.
On linux rust version = 1.79 nightly.
[libc-test-p_linux_rust_179.txt](https://github.com/rust-lang/libc/files/14820415/libc-test-p_linux_rust_179.txt)
On windows rust version = 1.75 stable.
It ran 753 tests in tests/makedev.rs and all of them passed.
[libc-test-pwindowspass.txt](https://github.com/rust-lang/libc/files/14820416/libc-test-pwindowspass.txt)
|
Why is this trying to change O_LARGEFILE?
@joshtriplett did you mean to ask this in the pull-request?
@Ecordonnier Yes, thank you.
These changes have been merged in, but have not been included in any subsequent releases:
```
diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs
index a4c1f708afd50..d8b2767669309 100644
--- a/src/unix/linux_like/linux/musl/mod.rs
+++ b/src/unix/linux_like/linux/musl/mod.rs
@@ -900,6 +900,13 @@ extern "C" {
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
+
+ pub fn getutxent() -> *mut utmpx;
+ pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
+ pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
+ pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
+ pub fn setutxent();
+ pub fn endutxent();
}
// Alias <foo> to <foo>64 to mimic glibc's LFS64 support
```
https://github.com/rust-lang/libc/pull/3213/commits/e3caaf6b0ea08ae294e25a861022c256a7535ec4#r1431346483
Is this waiting on version 0.3 (https://github.com/rust-lang/libc/pull/3213#issuecomment-1851732478)?
Yes or is waiting on 0.3 (which was renamed to 1.0, see https://github.com/rust-lang/libc/issues/3248 )
`libc-test` works in recent debian sid. I suggest running in recent Linux, for example, inside Docker
@safinaskar Please share the info on C library that you are using, the Debian OS version info, along with the libc test log.
Generally speaking, the libc tests will only pass on the specific linux release that we use in our docker containers. If you run the test with `run-docker.sh` then they should all pass.
@Amanieu David @devnexen created a PR removing Elf32relr and Elf64relr tests for all systems including linux. Libc -tests worked on mysystem after that.
|
2024-11-17T07:53:53Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 4,033
|
rust-lang__libc-4033
|
[
"4031"
] |
3a0b0444d7206aa3feb30297c005597a960d0b33
|
diff --git a/src/unix/solarish/illumos.rs b/src/unix/solarish/illumos.rs
index 121b5fa06fe7b..62a07f6279030 100644
--- a/src/unix/solarish/illumos.rs
+++ b/src/unix/solarish/illumos.rs
@@ -10,6 +10,19 @@ pub type lgrp_rsrc_t = ::c_int;
pub type lgrp_affinity_t = ::c_int;
s! {
+ pub struct aiocb {
+ pub aio_fildes: ::c_int,
+ pub aio_buf: *mut ::c_void,
+ pub aio_nbytes: ::size_t,
+ pub aio_offset: ::off_t,
+ pub aio_reqprio: ::c_int,
+ pub aio_sigevent: ::sigevent,
+ pub aio_lio_opcode: ::c_int,
+ pub aio_resultp: ::aio_result_t,
+ pub aio_state: ::c_int,
+ pub aio__pad: [::c_int; 1],
+ }
+
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs
index a2db25aa1a221..64bedf88b73c9 100644
--- a/src/unix/solarish/mod.rs
+++ b/src/unix/solarish/mod.rs
@@ -420,6 +420,11 @@ s! {
pub portnfy_user: *mut ::c_void,
}
+ pub struct aio_result_t {
+ pub aio_return: ::ssize_t,
+ pub aio_errno: ::c_int,
+ }
+
pub struct exit_status {
e_termination: ::c_short,
e_exit: ::c_short,
@@ -1123,9 +1128,19 @@ pub const SIG_BLOCK: ::c_int = 1;
pub const SIG_UNBLOCK: ::c_int = 2;
pub const SIG_SETMASK: ::c_int = 3;
+pub const AIO_CANCELED: ::c_int = 0;
+pub const AIO_ALLDONE: ::c_int = 1;
+pub const AIO_NOTCANCELED: ::c_int = 2;
+pub const LIO_NOP: ::c_int = 0;
+pub const LIO_READ: ::c_int = 1;
+pub const LIO_WRITE: ::c_int = 2;
+pub const LIO_NOWAIT: ::c_int = 0;
+pub const LIO_WAIT: ::c_int = 1;
+
pub const SIGEV_NONE: ::c_int = 1;
pub const SIGEV_SIGNAL: ::c_int = 2;
pub const SIGEV_THREAD: ::c_int = 3;
+pub const SIGEV_PORT: ::c_int = 4;
pub const CLD_EXITED: ::c_int = 1;
pub const CLD_KILLED: ::c_int = 2;
@@ -3035,6 +3050,30 @@ extern "C" {
pub fn sync();
+ pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+ pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
+ pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+ pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
+ pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
+ pub fn aio_suspend(
+ aiocb_list: *const *const aiocb,
+ nitems: ::c_int,
+ timeout: *const ::timespec,
+ ) -> ::c_int;
+ pub fn aio_waitn(
+ aiocb_list: *mut *mut aiocb,
+ nent: ::c_uint,
+ nwait: *mut ::c_uint,
+ timeout: *const ::timespec,
+ ) -> ::c_int;
+ pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
+ pub fn lio_listio(
+ mode: ::c_int,
+ aiocb_list: *const *mut aiocb,
+ nitems: ::c_int,
+ sevp: *mut sigevent,
+ ) -> ::c_int;
+
pub fn __major(version: ::c_int, devnum: ::dev_t) -> ::major_t;
pub fn __minor(version: ::c_int, devnum: ::dev_t) -> ::minor_t;
pub fn __makedev(version: ::c_int, majdev: ::major_t, mindev: ::minor_t) -> ::dev_t;
diff --git a/src/unix/solarish/solaris.rs b/src/unix/solarish/solaris.rs
index 26bbe38b3e208..2ca6281f495ba 100644
--- a/src/unix/solarish/solaris.rs
+++ b/src/unix/solarish/solaris.rs
@@ -20,6 +20,21 @@ e! {
}
s! {
+ pub struct aiocb {
+ pub aio_fildes: ::c_int,
+ pub aio_buf: *mut ::c_void,
+ pub aio_nbytes: ::size_t,
+ pub aio_offset: ::off_t,
+ pub aio_reqprio: ::c_int,
+ pub aio_sigevent: ::sigevent,
+ pub aio_lio_opcode: ::c_int,
+ pub aio_resultp: ::aio_result_t,
+ pub aio_state: ::c_char,
+ pub aio_returned: ::c_char,
+ pub aio__pad1: [::c_char; 2],
+ pub aio_flags: ::c_int,
+ }
+
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 48f952f9f7c83..29763626b34d3 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -786,6 +786,7 @@ fn test_solarish(target: &str) {
headers! {
cfg:
+ "aio.h",
"ctype.h",
"dirent.h",
"dlfcn.h",
@@ -948,6 +949,11 @@ fn test_solarish(target: &str) {
}
});
+ cfg.skip_field_type(move |struct_, field| {
+ // aio_buf is "volatile void*"
+ struct_ == "aiocb" && field == "aio_buf"
+ });
+
cfg.skip_field(move |s, field| {
match s {
// C99 sizing on this is tough
@@ -1026,6 +1032,12 @@ fn test_solarish(target: &str) {
// excluded from the tests.
"getifaddrs" if is_illumos => true,
+ // FIXME: Our API is unsound. The Rust API allows aliasing
+ // pointers, but the C API requires pointers not to alias.
+ // We should probably be at least using `&`/`&mut` here, see:
+ // https://github.com/gnzlbg/ctest/issues/68
+ "lio_listio" => true,
+
_ => false,
}
});
diff --git a/libc-test/semver/solarish.txt b/libc-test/semver/solarish.txt
index a17ec146bb456..2dcebd06e3399 100644
--- a/libc-test/semver/solarish.txt
+++ b/libc-test/semver/solarish.txt
@@ -1,3 +1,6 @@
+AIO_ALLDONE
+AIO_CANCELED
+AIO_NOTCANCELED
IPV6_DONTFRAG
IPV6_PKTINFO
IPV6_RECVTCLASS
@@ -6,12 +9,29 @@ IP_DONTFRAG
IP_PKTINFO
IP_TOS
IP_TTL
+LIO_NOP
+LIO_NOWAIT
+LIO_READ
+LIO_WAIT
+LIO_WRITE
PIPE_BUF
+SIGEV_PORT
+aio_cancel
+aio_error
+aio_fsync
+aio_read
+aio_result_t
+aio_return
+aio_suspend
+aio_waitn
+aio_write
+aiocb
arc4random
arc4random_buf
arc4random_uniform
bind
in6_pktinfo
in_pktinfo
+lio_listio
recvmsg
sendmsg
|
API request: AIO methods for illumos & solaris
I would like:
* aiocb
* aio_read
* aio_write
* aio_fsync
* aio_error
* aio_return
* aio_cancel
* SIGEV_PORT
... for illumos & solaris.
|
2024-11-13T13:00:37Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,966
|
rust-lang__libc-3966
|
[
"3688"
] |
42d1000bc82fc608749f9df19f3d699d2b548ed6
|
diff --git a/README.md b/README.md
index 395b94ce0c8f3..3d5b5ec583457 100644
--- a/README.md
+++ b/README.md
@@ -11,10 +11,14 @@ This crate exports all underlying platform types, functions, and constants under
the crate root, so all items are accessible as `libc::foo`. The types and values
of all the exported APIs match the platform that libc is compiled for.
+Windows API bindings are not included in this crate. If you are looking for WinAPI
+bindings, consider using crates like [windows-sys].
+
More detailed information about the design of this library can be found in its
[associated RFC][rfc].
[rfc]: https://github.com/rust-lang/rfcs/blob/HEAD/text/1291-promote-libc.md
+[windows-sys]: https://docs.rs/windows-sys
## v0.3 Roadmap
diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs
index 1dc607496a2ad..11a16aa7afa41 100644
--- a/src/unix/linux_like/emscripten/mod.rs
+++ b/src/unix/linux_like/emscripten/mod.rs
@@ -1776,6 +1776,21 @@ extern "C" {
) -> ::c_int;
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::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;
+ pub fn getpwuid_r(
+ uid: ::uid_t,
+ pwd: *mut passwd,
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ result: *mut *mut passwd,
+ ) -> ::c_int;
}
// Alias <foo> to <foo>64 to mimic glibc's LFS64 support
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index 75d150c90d58a..7fd7fb190ca9d 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -454,6 +454,55 @@ s! {
pub aio_flags: ::__u32,
pub aio_resfd: ::__u32,
}
+
+ // netinet/tcp.h
+
+ pub struct tcp_info {
+ pub tcpi_state: u8,
+ pub tcpi_ca_state: u8,
+ pub tcpi_retransmits: u8,
+ pub tcpi_probes: u8,
+ pub tcpi_backoff: u8,
+ pub tcpi_options: u8,
+ /// This contains the bitfields `tcpi_snd_wscale` and `tcpi_rcv_wscale`.
+ /// Each is 4 bits.
+ pub tcpi_snd_rcv_wscale: u8,
+ pub tcpi_rto: u32,
+ pub tcpi_ato: u32,
+ pub tcpi_snd_mss: u32,
+ pub tcpi_rcv_mss: u32,
+ pub tcpi_unacked: u32,
+ pub tcpi_sacked: u32,
+ pub tcpi_lost: u32,
+ pub tcpi_retrans: u32,
+ pub tcpi_fackets: u32,
+ pub tcpi_last_data_sent: u32,
+ pub tcpi_last_ack_sent: u32,
+ pub tcpi_last_data_recv: u32,
+ pub tcpi_last_ack_recv: u32,
+ pub tcpi_pmtu: u32,
+ pub tcpi_rcv_ssthresh: u32,
+ pub tcpi_rtt: u32,
+ pub tcpi_rttvar: u32,
+ pub tcpi_snd_ssthresh: u32,
+ pub tcpi_snd_cwnd: u32,
+ pub tcpi_advmss: u32,
+ pub tcpi_reordering: u32,
+ pub tcpi_rcv_rtt: u32,
+ pub tcpi_rcv_space: u32,
+ pub tcpi_total_retrans: u32,
+ }
+
+ pub struct fanotify_event_info_pidfd {
+ pub hdr: ::fanotify_event_info_header,
+ pub pidfd: ::__s32,
+ }
+
+ pub struct fanotify_event_info_error {
+ pub hdr: ::fanotify_event_info_header,
+ pub error: ::__s32,
+ pub error_count: ::__u32,
+ }
}
impl siginfo_t {
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index a7815ddfc3c14..3ca4446e66ef1 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -16,6 +16,7 @@ pub type loff_t = ::c_longlong;
pub type pthread_key_t = ::c_uint;
pub type pthread_once_t = ::c_int;
pub type pthread_spinlock_t = ::c_int;
+pub type __kernel_fsid_t = __c_anonymous__kernel_fsid_t;
pub type __u8 = ::c_uchar;
pub type __u16 = ::c_ushort;
@@ -548,6 +549,20 @@ s! {
pub sh_entsize: Elf64_Xword,
}
+ pub struct __c_anonymous_elf32_rel {
+ pub r_offset: Elf32_Addr,
+ pub r_info: Elf32_Word,
+ }
+
+ pub struct __c_anonymous_elf64_rel {
+ pub r_offset: Elf64_Addr,
+ pub r_info: Elf64_Xword,
+ }
+
+ pub struct __c_anonymous__kernel_fsid_t {
+ pub val: [::c_int; 2],
+ }
+
pub struct ucred {
pub pid: ::pid_t,
pub uid: ::uid_t,
@@ -615,6 +630,18 @@ s! {
pub response: __u32,
}
+ pub struct fanotify_event_info_header {
+ pub info_type: __u8,
+ pub pad: __u8,
+ pub len: __u16,
+ }
+
+ pub struct fanotify_event_info_fid {
+ pub hdr: fanotify_event_info_header,
+ pub fsid: ::__kernel_fsid_t,
+ pub handle: [::c_uchar; 0],
+ }
+
pub struct sockaddr_vm {
pub svm_family: ::sa_family_t,
pub svm_reserved1: ::c_ushort,
diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs
index a4c8f79c35cad..d102d5de2cfed 100644
--- a/src/unix/linux_like/linux/musl/mod.rs
+++ b/src/unix/linux_like/linux/musl/mod.rs
@@ -348,6 +348,73 @@ s! {
pub len: ::__u32,
pub options: ::__u32,
}
+
+ // netinet/tcp.h
+
+ pub struct tcp_info {
+ pub tcpi_state: u8,
+ pub tcpi_ca_state: u8,
+ pub tcpi_retransmits: u8,
+ pub tcpi_probes: u8,
+ pub tcpi_backoff: u8,
+ pub tcpi_options: u8,
+ /*
+ * FIXME(musl): when musl headers are more up to date
+ /// This contains the bitfields `tcpi_snd_wscale` and `tcpi_rcv_wscale`.
+ /// Each is 4 bits.
+ pub tcpi_snd_rcv_wscale: u8,
+ /// This contains the bitfields `tcpi_delivery_rate_app_limited` (1 bit) and
+ /// `tcpi_fastopen_client_fail` (2 bits).
+ pub tcpi_delivery_fastopen_bitfields: u8,
+ */
+ pub tcpi_rto: u32,
+ pub tcpi_ato: u32,
+ pub tcpi_snd_mss: u32,
+ pub tcpi_rcv_mss: u32,
+ pub tcpi_unacked: u32,
+ pub tcpi_sacked: u32,
+ pub tcpi_lost: u32,
+ pub tcpi_retrans: u32,
+ pub tcpi_fackets: u32,
+ pub tcpi_last_data_sent: u32,
+ pub tcpi_last_ack_sent: u32,
+ pub tcpi_last_data_recv: u32,
+ pub tcpi_last_ack_recv: u32,
+ pub tcpi_pmtu: u32,
+ pub tcpi_rcv_ssthresh: u32,
+ pub tcpi_rtt: u32,
+ pub tcpi_rttvar: u32,
+ pub tcpi_snd_ssthresh: u32,
+ pub tcpi_snd_cwnd: u32,
+ pub tcpi_advmss: u32,
+ pub tcpi_reordering: u32,
+ pub tcpi_rcv_rtt: u32,
+ pub tcpi_rcv_space: u32,
+ pub tcpi_total_retrans: u32,
+ pub tcpi_pacing_rate: u64,
+ pub tcpi_max_pacing_rate: u64,
+ pub tcpi_bytes_acked: u64,
+ pub tcpi_bytes_received: u64,
+ pub tcpi_segs_out: u32,
+ pub tcpi_segs_in: u32,
+ pub tcpi_notsent_bytes: u32,
+ pub tcpi_min_rtt: u32,
+ pub tcpi_data_segs_in: u32,
+ pub tcpi_data_segs_out: u32,
+ pub tcpi_delivery_rate: u64,
+ pub tcpi_busy_time: u64,
+ pub tcpi_rwnd_limited: u64,
+ pub tcpi_sndbuf_limited: u64,
+ pub tcpi_delivered: u32,
+ pub tcpi_delivered_ce: u32,
+ pub tcpi_bytes_sent: u64,
+ pub tcpi_bytes_retrans: u64,
+ pub tcpi_dsack_dups: u32,
+ pub tcpi_reord_seen: u32,
+ // FIXME(musl): to uncomment once CI musl is updated
+ //pub tcpi_rcv_ooopack: u32,
+ //pub tcpi_snd_wnd: u32,
+ }
}
s_no_extra_traits! {
diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs
index 5036f458067b6..ac092a372b576 100644
--- a/src/unix/redox/mod.rs
+++ b/src/unix/redox/mod.rs
@@ -22,7 +22,7 @@ pub type clockid_t = ::c_int;
pub type dev_t = ::c_long;
pub type fsblkcnt_t = ::c_ulong;
pub type fsfilcnt_t = ::c_ulong;
-pub type ino_t = ::c_ulong;
+pub type ino_t = ::c_ulonglong;
pub type mode_t = ::c_int;
pub type nfds_t = ::c_ulong;
pub type nlink_t = ::c_ulong;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index ca1301320b211..fb779daecc123 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -3746,6 +3746,9 @@ fn test_linux(target: &str) {
if musl && ty == "fanout_args" {
return true;
}
+ if sparc64 && ty == "fanotify_event_info_error" {
+ return true;
+ }
match ty {
// These cannot be tested when "resolv.h" is included and are tested
@@ -4480,7 +4483,21 @@ fn test_linux(target: &str) {
// the `ifc_ifcu` field is an anonymous union
(struct_ == "ifconf" && field == "ifc_ifcu") ||
// glibc uses a single array `uregs` instead of individual fields.
- (struct_ == "user_regs" && arm)
+ (struct_ == "user_regs" && arm) ||
+ // the `ifr_ifrn` field is an anonymous union
+ (struct_ == "iwreq" && field == "ifr_ifrn") ||
+ // the `key` field is a zero-sized array
+ (struct_ == "iw_encode_ext" && field == "key") ||
+ // the `tcpi_snd_rcv_wscale` map two bitfield fields stored in a u8
+ (struct_ == "tcp_info" && field == "tcpi_snd_rcv_wscale") ||
+ // the `tcpi_delivery_rate_app_limited` field is a bitfield on musl
+ (musl && struct_ == "tcp_info" && field == "tcpi_delivery_rate_app_limited") ||
+ // the `tcpi_fast_open_client_fail` field is a bitfield on musl
+ (musl && struct_ == "tcp_info" && field == "tcpi_fast_open_client_fail") ||
+ // either fsid_t or int[2] type
+ (struct_ == "fanotify_event_info_fid" && field == "fsid") ||
+ // `handle` is a VLA
+ (struct_ == "fanotify_event_info_fid" && field == "handle")
});
cfg.skip_roundtrip(move |s| match s {
diff --git a/libc-test/semver/emscripten.txt b/libc-test/semver/emscripten.txt
index 6b1df1aab4c7f..d14abae402367 100644
--- a/libc-test/semver/emscripten.txt
+++ b/libc-test/semver/emscripten.txt
@@ -1,2 +1,4 @@
getentropy
posix_fallocate64
+getpwnam_r
+getpwuid_r
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
index ce4f85484eee0..bca6e4fd18ed7 100644
--- a/libc-test/semver/linux-gnu.txt
+++ b/libc-test/semver/linux-gnu.txt
@@ -628,12 +628,15 @@ dlinfo
dlmopen
endutxent
explicit_bzero
+fanotify_event_info_error
+fanotify_event_info_header
+fanotify_event_info_pidfd
+fgetgrent_r
fgetspent_r
futimes
getauxval
getentropy
getgrent_r
-fgetgrent_r
getloadavg
getpt
getpwent_r
@@ -712,3 +715,4 @@ putgrent
execveat
close_range
epoll_pwait2
+tcp_info
diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt
index 5a48357cb79e5..bb8dbb2f9834e 100644
--- a/libc-test/semver/linux-musl.txt
+++ b/libc-test/semver/linux-musl.txt
@@ -80,6 +80,7 @@ process_vm_writev
pwritev2
pwritev64
reallocarray
+tcp_info
timex
euidaccess
eaccess
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index ebbe04d1b7262..d0b966f4f1085 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -3497,6 +3497,7 @@ execvpe
faccessat
fallocate
fallocate64
+fanotify_event_info_fid
fanotify_event_metadata
fanotify_init
fanotify_mark
|
Add struct `fanotify_event_info_fid`
Host triplet: `x86_64-unknown-linux-gnu`
API struct is as follows:
```c
struct fanotify_event_info_fid {
struct fanotify_event_info_header hdr;
__kernel_fsid_t fsid;
unsigned char file_handle[0];
};
```
Man page for more info: https://man7.org/linux/man-pages/man7/fanotify.7.html
Source link: https://github.com/torvalds/linux/blob/dccb07f2914cdab2ac3a5b6c98406f765acab803/include/uapi/linux/fanotify.h#L166
|
2024-10-15T01:50:55Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,952
|
rust-lang__libc-3952
|
[
"3947"
] |
b9e8477fa7c71408bdbc1eed9821af0783f97bdb
|
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index 47b4bd36e6d02..3224ac8fef6e9 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -3843,6 +3843,7 @@ pub const TCP_INFO: ::c_int = 32;
pub const TCP_CONGESTION: ::c_int = 64;
pub const TCP_CCALGOOPT: ::c_int = 65;
pub const TCP_MAXUNACKTIME: ::c_int = 68;
+#[deprecated(since = "0.2.160", note = "Removed in FreeBSD 15")]
pub const TCP_MAXPEAKRATE: ::c_int = 69;
pub const TCP_IDLE_REDUCE: ::c_int = 70;
pub const TCP_REMOTE_UDP_ENCAPS_PORT: ::c_int = 71;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 75dcd14fc83be..b6472b4ea56a8 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2338,6 +2338,9 @@ fn test_freebsd(target: &str) {
// base system anyway.
"CTL_MAXID" | "KERN_MAXID" | "HW_MAXID" | "USER_MAXID" => true,
+ // Deprecated and removed in FreeBSD 15. It was never actually implemented.
+ "TCP_MAXPEAKRATE" => true,
+
// FIXME: This is deprecated - remove in a couple of releases.
// This was removed in FreeBSD 14 (git 1b4701fe1e8) and never
// should've been used anywhere anyway.
@@ -2364,6 +2367,10 @@ fn test_freebsd(target: &str) {
| "PWAIT" | "PLOCK" | "PPAUSE" | "PRI_MIN_TIMESHARE" | "PUSER" | "PI_AV" | "PI_NET"
| "PI_DISK" | "PI_TTY" | "PI_DULL" | "PI_SOFT" => true,
+ // This constant changed in FreeBSD 15 (git 3458bbd397783). It was never intended to
+ // be stable, and probably shouldn't be bound by libc at all.
+ "RLIM_NLIMITS" => true,
+
// This symbol changed in FreeBSD 14 (git 051e7d78b03), but the new
// version should be safe to use on older releases.
"IFCAP_CANTCHANGE" => true,
@@ -2494,7 +2501,6 @@ fn test_freebsd(target: &str) {
// Flags introduced in FreeBSD 14.
"TCP_MAXUNACKTIME"
- | "TCP_MAXPEAKRATE"
| "TCP_IDLE_REDUCE"
| "TCP_REMOTE_UDP_ENCAPS_PORT"
| "TCP_DELACK"
|
CI fails on FreeBSD 15 for TCP_MAXPEAKRATE
CI is currently failing on FreeBSD 15 because TCP_MAXPEAKRATE is unknown. That's because it was recently removed by this commit:
https://github.com/freebsd/freebsd-src/commit/87fbd9fc7fc5f8d79fe5e3dcd13ad02b11a67ef0 . That, and other constants removed by the same commit, should be removed from libc's main branch and deprecated in the libc-0.2 branch.
|
2024-09-29T19:56:41Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,950
|
rust-lang__libc-3950
|
[
"3947"
] |
09d7aa0d84f9b87d1a8bcb96dc5727282084397d
|
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index 3cf1fc1aeeef3..e7239fd965e07 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -3779,7 +3779,6 @@ pub const TCP_INFO: ::c_int = 32;
pub const TCP_CONGESTION: ::c_int = 64;
pub const TCP_CCALGOOPT: ::c_int = 65;
pub const TCP_MAXUNACKTIME: ::c_int = 68;
-pub const TCP_MAXPEAKRATE: ::c_int = 69;
pub const TCP_IDLE_REDUCE: ::c_int = 70;
pub const TCP_REMOTE_UDP_ENCAPS_PORT: ::c_int = 71;
pub const TCP_DELACK: ::c_int = 72;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 938294717eee3..743f9f28404db 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2306,6 +2306,10 @@ fn test_freebsd(target: &str) {
| "PWAIT" | "PLOCK" | "PPAUSE" | "PRI_MIN_TIMESHARE" | "PUSER" | "PI_AV" | "PI_NET"
| "PI_DISK" | "PI_TTY" | "PI_DULL" | "PI_SOFT" => true,
+ // This constant changed in FreeBSD 15 (git 3458bbd397783). It was never intended to
+ // be stable, and probably shouldn't be bound by libc at all.
+ "RLIM_NLIMITS" => true,
+
// This symbol changed in FreeBSD 14 (git 051e7d78b03), but the new
// version should be safe to use on older releases.
"IFCAP_CANTCHANGE" => true,
@@ -2436,7 +2440,6 @@ fn test_freebsd(target: &str) {
// Flags introduced in FreeBSD 14.
"TCP_MAXUNACKTIME"
- | "TCP_MAXPEAKRATE"
| "TCP_IDLE_REDUCE"
| "TCP_REMOTE_UDP_ENCAPS_PORT"
| "TCP_DELACK"
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt
index 933fea0e63e94..70484bbbb9579 100644
--- a/libc-test/semver/freebsd.txt
+++ b/libc-test/semver/freebsd.txt
@@ -1494,7 +1494,6 @@ TCP_KEEPIDLE
TCP_KEEPINIT
TCP_KEEPINTVL
TCP_LOG_LIMIT
-TCP_MAXPEAKRATE
TCP_MAXSEG
TCP_MAXUNACKTIME
TCP_MD5SIG
|
CI fails on FreeBSD 15 for TCP_MAXPEAKRATE
CI is currently failing on FreeBSD 15 because TCP_MAXPEAKRATE is unknown. That's because it was recently removed by this commit:
https://github.com/freebsd/freebsd-src/commit/87fbd9fc7fc5f8d79fe5e3dcd13ad02b11a67ef0 . That, and other constants removed by the same commit, should be removed from libc's main branch and deprecated in the libc-0.2 branch.
|
2024-09-29T18:50:20Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,934
|
rust-lang__libc-3934
|
[
"3748"
] |
ffb7f0c05718643d06bc20b971cedf20d6928d93
|
diff --git a/src/unix/newlib/espidf/mod.rs b/src/unix/newlib/espidf/mod.rs
index a73e85315971f..3a4ce49c5c217 100644
--- a/src/unix/newlib/espidf/mod.rs
+++ b/src/unix/newlib/espidf/mod.rs
@@ -109,6 +109,8 @@ extern "C" {
pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+ pub fn gethostname(name: *mut ::c_char, namelen: ::ssize_t);
+
#[link_name = "lwip_sendmsg"]
pub fn sendmsg(s: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
#[link_name = "lwip_recvmsg"]
|
diff --git a/libc-test/semver/espidf.txt b/libc-test/semver/espidf.txt
new file mode 100644
index 0000000000000..74f0d0cb5266d
--- /dev/null
+++ b/libc-test/semver/espidf.txt
@@ -0,0 +1,49 @@
+AF_INET6
+AF_UNIX
+FIONBIO
+MSG_CTRUNC
+MSG_DONTROUTE
+MSG_DONTWAIT
+MSG_EOR
+MSG_MORE
+MSG_NOSIGNAL
+MSG_OOB
+MSG_PEEK
+MSG_TRUNC
+MSG_WAITALL
+NSIG
+POLLERR
+POLLHUP
+POLLIN
+POLLOUT
+POLLPRI
+POLLRDBAND
+POLLRDNORM
+POLLWRBAND
+POLLWRNORM
+PTHREAD_STACK_MIN
+SIGABRT
+SIGFPE
+SIGHUP
+SIGILL
+SIGINT
+SIGQUIT
+SIGSEGV
+SIGTERM
+SOL_SOCKET
+cmsghdr
+dirent
+eventfd
+gethostname
+getrandom
+msghdr
+pthread_create
+recvmsg
+sendmsg
+sigset_t
+sockaddr
+sockaddr_in
+sockaddr_in6
+sockaddr_storage
+sockaddr_un
+stat
|
Hostname on xtensa esp-idf esp32s3
Hi,
I need to use hostname_max and the function gethostname for xtensa-esp32s3-espidf but they're not supported for this target.
Can anyone give me any suggestion or help?
Thanks
|
PRs are welcome here! Take a look at https://github.com/rust-lang/libc/blob/1ffe0bde929a43ce3d25a8f08b9f95bde8d3e5d8/CONTRIBUTING.md, it should be pretty easy to add the API on those platforms.
I'm interested in picking this up. As far as I can tell, `libc` doesn't currently support that target - support for it in rust was merged as Tier 3 here: https://github.com/rust-lang/rust/pull/126380/. Is there a guide/policy for adding target support to the `libc` crate?
There is no written guide for this target specifically that i am aware off. Though the target ( and all other `-espidf` targets ) are using a version of `newlib` that is directly integrated in the underlying esp-idf system. Depending on the version of the `esp chip` there are parts of this newlib library directly inside the ROM.
[Here](https://github.com/espressif/esp-idf/tree/v5.2.2/components/newlib) you can find the in tree version of newlib that is used in ESP_IDF version 5.2.2.
What actually lives inside the ROM's is tracked inside this [repository](https://github.com/espressif/newlib-esp32)
We have one [outstanding](https://github.com/rust-lang/libc/pull/3920) PR that does a bit of cleanup inside libc with respect to correct constants. There you see for example how the rust libc site and the esp_idf site can be checked against each other.
If you have any target specific questions all the maintainers are also available in our `esp-rs` matrix channel found [here](https://matrix.to/#/#esp-rs:matrix.org)
|
2024-09-18T22:55:32Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 3,885
|
rust-lang__libc-3885
|
[
"3760"
] |
5431bdb756c560b21bce18ea7dff72a2aad9975c
|
diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs
index 1a93c39fd3a0a..c99ac476e5c82 100644
--- a/src/unix/linux_like/linux/musl/mod.rs
+++ b/src/unix/linux_like/linux/musl/mod.rs
@@ -667,6 +667,12 @@ pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
pub const PTRACE_GETSIGMASK: ::c_uint = 0x420a;
pub const PTRACE_SETSIGMASK: ::c_uint = 0x420b;
+pub const RWF_HIPRI: ::c_int = 0x00000001;
+pub const RWF_DSYNC: ::c_int = 0x00000002;
+pub const RWF_SYNC: ::c_int = 0x00000004;
+pub const RWF_NOWAIT: ::c_int = 0x00000008;
+pub const RWF_APPEND: ::c_int = 0x00000010;
+
pub const AF_IB: ::c_int = 27;
pub const AF_MPLS: ::c_int = 28;
pub const AF_NFC: ::c_int = 39;
@@ -857,6 +863,20 @@ extern "C" {
dirfd: ::c_int,
path: *const ::c_char,
) -> ::c_int;
+ pub fn preadv2(
+ fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int,
+ offset: ::off_t,
+ flags: ::c_int,
+ ) -> ::ssize_t;
+ pub fn pwritev2(
+ fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int,
+ offset: ::off_t,
+ flags: ::c_int,
+ ) -> ::ssize_t;
pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
// Added in `musl` 1.1.20
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 9560e07c8cf7e..b9df07b523aed 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -4311,6 +4311,9 @@ fn test_linux(target: &str) {
// FIXME: function pointers changed since Ubuntu 23.10
"strtol" | "strtoll" | "strtoul" | "strtoull" | "fscanf" | "scanf" | "sscanf" => true,
+ // Added in musl 1.2.5
+ "preadv2" | "pwritev2" if musl => true,
+
_ => false,
}
});
diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt
index f6e293aa9b7fc..5c233c1f206e1 100644
--- a/libc-test/semver/linux-musl.txt
+++ b/libc-test/semver/linux-musl.txt
@@ -23,6 +23,11 @@ PF_XDP
PIDFD_NONBLOCK
PR_SET_VMA
PR_SET_VMA_ANON_NAME
+RWF_APPEND
+RWF_DSYNC
+RWF_HIPRI
+RWF_NOWAIT
+RWF_SYNC
SOL_XDP
XDP_SHARED_UMEM
XDP_COPY
@@ -75,12 +80,14 @@ getutxline
lio_listio
ntptimeval
open_wmemstream
+preadv2
preadv64
prlimit
prlimit64
process_vm_readv
process_vm_writev
pututxline
+pwritev2
pwritev64
reallocarray
setutxent
|
preadv2 is not supported on musl libc
The preadv2 function is present on -gnu target, however when compiling on -musl target, which is surprising.
The jobserver-rs would like to use it to optimize it's performance rust-lang/jobserver-rs#90 (the try_acquire optimization has shipped once but reverted, so I opened another PR to use raw syscall directly).
FYI, my motivation is to that this API is used in cc-rs to improve performance.
|
2024-08-29T10:34:24Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,882
|
rust-lang__libc-3882
|
[
"3704"
] |
5431bdb756c560b21bce18ea7dff72a2aad9975c
|
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index 84e725a91cb9d..cf71443d84ddb 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -4147,7 +4147,6 @@ pub const IPV6_RECVHOPLIMIT: ::c_int = 37;
pub const IPV6_PKTINFO: ::c_int = 46;
pub const IPV6_HOPLIMIT: ::c_int = 47;
pub const IPV6_RECVPKTINFO: ::c_int = 61;
-pub const IPV6_DONTFRAG: ::c_int = 62;
pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 70;
pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 71;
pub const IP_BLOCK_SOURCE: ::c_int = 72;
diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs
index 2d401876627d6..af0632882cdbc 100644
--- a/src/unix/bsd/freebsdlike/mod.rs
+++ b/src/unix/bsd/freebsdlike/mod.rs
@@ -973,7 +973,6 @@ pub const IPV6_PKTINFO: ::c_int = 46;
pub const IPV6_HOPLIMIT: ::c_int = 47;
pub const IPV6_RECVTCLASS: ::c_int = 57;
pub const IPV6_TCLASS: ::c_int = 61;
-pub const IPV6_DONTFRAG: ::c_int = 62;
pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 70;
pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 71;
pub const IP_BLOCK_SOURCE: ::c_int = 72;
diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs
index 487547d00540a..61f764d1d2dee 100644
--- a/src/unix/bsd/mod.rs
+++ b/src/unix/bsd/mod.rs
@@ -311,6 +311,7 @@ pub const IPV6_MULTICAST_IF: ::c_int = 9;
pub const IPV6_MULTICAST_HOPS: ::c_int = 10;
pub const IPV6_MULTICAST_LOOP: ::c_int = 11;
pub const IPV6_V6ONLY: ::c_int = 27;
+pub const IPV6_DONTFRAG: ::c_int = 62;
pub const IPTOS_ECN_NOTECT: u8 = 0x00;
pub const IPTOS_ECN_MASK: u8 = 0x03;
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index 3ea931ecb72c1..3e1b83e5adb73 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -2271,6 +2271,8 @@ pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
pub const MFD_CLOEXEC: ::c_uint = 0x0001;
pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
pub const MFD_HUGETLB: ::c_uint = 0x0004;
+pub const MFD_NOEXEC_SEAL: ::c_uint = 0x0008;
+pub const MFD_EXEC: ::c_uint = 0x0010;
pub const MFD_HUGE_64KB: ::c_uint = 0x40000000;
pub const MFD_HUGE_512KB: ::c_uint = 0x4c000000;
pub const MFD_HUGE_1MB: ::c_uint = 0x50000000;
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index e61683fac063a..a47d0618ab230 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -2790,6 +2790,8 @@ pub const CMSPAR: ::tcflag_t = 0o10000000000;
pub const MFD_CLOEXEC: ::c_uint = 0x0001;
pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
pub const MFD_HUGETLB: ::c_uint = 0x0004;
+pub const MFD_NOEXEC_SEAL: ::c_uint = 0x0008;
+pub const MFD_EXEC: ::c_uint = 0x0010;
pub const MFD_HUGE_64KB: ::c_uint = 0x40000000;
pub const MFD_HUGE_512KB: ::c_uint = 0x4c000000;
pub const MFD_HUGE_1MB: ::c_uint = 0x50000000;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 9560e07c8cf7e..d5f753c0d0d8f 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -3839,6 +3839,10 @@ fn test_linux(target: &str) {
if name.starts_with("NI_IDN") {
return true;
}
+ // FIXME: Requires >= 6.3 kernel headers
+ if name == "MFD_NOEXEC_SEAL" || name == "MFD_EXEC" {
+ return true;
+ }
}
match name {
// These constants are not available if gnu headers have been included
@@ -4049,6 +4053,9 @@ fn test_linux(target: &str) {
if musl => true,
"CLONE_CLEAR_SIGHAND" | "CLONE_INTO_CGROUP" => true,
+ // FIXME: Requires >= 6.3 kernel headers
+ "MFD_EXEC" | "MFD_NOEXEC_SEAL" if sparc64 => true,
+
// kernel 6.1 minimum
"MADV_COLLAPSE" => true,
diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt
index 36785e284a48c..df205a82497c1 100644
--- a/libc-test/semver/android.txt
+++ b/libc-test/semver/android.txt
@@ -1252,7 +1252,9 @@ MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE
MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ
MFD_ALLOW_SEALING
MFD_CLOEXEC
+MFD_EXEC
MFD_HUGETLB
+MFD_NOEXEC_SEAL
MINIX2_SUPER_MAGIC
MINIX2_SUPER_MAGIC2
MINIX_SUPER_MAGIC
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index ea0f848017b86..fc7449b91865e 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -1465,7 +1465,9 @@ MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE
MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ
MFD_ALLOW_SEALING
MFD_CLOEXEC
+MFD_EXEC
MFD_HUGETLB
+MFD_NOEXEC_SEAL
MINSIGSTKSZ
MMAP_PAGE_ZERO
MNT_DETACH
diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt
index b82d9cbeca065..838f28f71b5d1 100644
--- a/libc-test/semver/netbsd.txt
+++ b/libc-test/semver/netbsd.txt
@@ -468,6 +468,7 @@ IPTOS_ECN_ECT0
IPTOS_ECN_ECT1
IPTOS_ECN_MASK
IPTOS_ECN_NOTECT
+IPV6_DONTFRAG
IPV6_JOIN_GROUP
IPV6_LEAVE_GROUP
IPV6_PKTINFO
diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt
index 3833884c855c5..019ab53d34ff0 100644
--- a/libc-test/semver/openbsd.txt
+++ b/libc-test/semver/openbsd.txt
@@ -311,6 +311,7 @@ IPTOS_ECN_ECT0
IPTOS_ECN_ECT1
IPTOS_ECN_MASK
IPTOS_ECN_NOTECT
+IPV6_DONTFRAG
IPV6_JOIN_GROUP
IPV6_LEAVE_GROUP
IPV6_PKTINFO
|
Add IPV6_DONTFRAG socket option on OpenBSD
* target triple: x86_64-unknown-openbsd
* Header file: https://github.com/openbsd/src/blob/35659bf2453d7eeb12fd24089cf668ca13361c18/sys/netinet6/in6.h#L330C9-L330C24
According to the git history this symbol has been there for a very long time, so there is probably no need to check the openbsd version.
|
2024-08-29T09:31:41Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,848
|
rust-lang__libc-3848
|
[
"3217"
] |
0e6afd534ed7a0406e9dfc9242c2c9370a5b8d05
|
diff --git a/src/unix/bsd/freebsdlike/freebsd/arm.rs b/src/unix/bsd/freebsdlike/freebsd/arm.rs
index af3c8a7cf6f6c..eb90f3f9030e7 100644
--- a/src/unix/bsd/freebsdlike/freebsd/arm.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/arm.rs
@@ -5,6 +5,8 @@ pub type wchar_t = u32;
pub type time_t = i64;
pub type suseconds_t = i32;
pub type register_t = i32;
+pub type __greg_t = ::c_uint;
+pub type __gregset_t = [::__greg_t; 17];
s! {
pub struct stat {
@@ -36,6 +38,47 @@ s! {
}
}
+s_no_extra_traits! {
+ pub struct mcontext_t {
+ pub __gregs: ::__gregset_t,
+ pub mc_vfp_size: ::__size_t,
+ pub mc_vfp_ptr: *mut ::c_void,
+ pub mc_spare: [::c_uint; 33],
+ }
+}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for mcontext_t {
+ fn eq(&self, other: &mcontext_t) -> bool {
+ self.__gregs == other.__gregs &&
+ self.mc_vfp_size == other.mc_vfp_size &&
+ self.mc_vfp_ptr == other.mc_vfp_ptr &&
+ self.mc_spare.iter().zip(other.mc_spare.iter()).all(|(a, b)| a == b)
+ }
+ }
+ impl Eq for mcontext_t {}
+ impl ::fmt::Debug for mcontext_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("mcontext_t")
+ .field("__gregs", &self.__gregs)
+ .field("mc_vfp_size", &self.mc_vfp_size)
+ .field("mc_vfp_ptr", &self.mc_vfp_ptr)
+ .field("mc_spare", &self.mc_spare)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for mcontext_t {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.__gregs.hash(state);
+ self.mc_vfp_size.hash(state);
+ self.mc_vfp_ptr.hash(state);
+ self.mc_spare.hash(state);
+ }
+ }
+ }
+}
+
pub(crate) const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index 3cf1fc1aeeef3..7017191cc064d 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -1638,6 +1638,15 @@ s_no_extra_traits! {
_kf_cap_spare: u64,
pub kf_path: [::c_char; ::PATH_MAX as usize],
}
+
+ pub struct ucontext_t {
+ pub uc_sigmask: ::sigset_t,
+ pub uc_mcontext: ::mcontext_t,
+ pub uc_link: *mut ::ucontext_t,
+ pub uc_stack: ::stack_t,
+ pub uc_flags: ::c_int,
+ __spare__: [::c_int; 4],
+ }
}
cfg_if! {
@@ -2592,6 +2601,18 @@ cfg_if! {
self.kf_path.hash(state);
}
}
+
+ impl ::fmt::Debug for ucontext_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ucontext_t")
+ .field("uc_sigmask", &self.uc_sigmask)
+ .field("uc_mcontext", &self.uc_mcontext)
+ .field("uc_link", &self.uc_link)
+ .field("uc_stack", &self.uc_stack)
+ .field("uc_flags", &self.uc_flags)
+ .finish()
+ }
+ }
}
}
diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc.rs
index 0900005166a2e..5de61946de3b9 100644
--- a/src/unix/bsd/freebsdlike/freebsd/powerpc.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/powerpc.rs
@@ -32,6 +32,68 @@ s! {
}
}
+s_no_extra_traits! {
+ #[repr(align(16))]
+ pub struct mcontext_t {
+ pub mc_vers: ::c_int,
+ pub mc_flags: ::c_int,
+ pub mc_onstack: ::c_int,
+ pub mc_len: ::c_int,
+ pub mc_avec: [u64; 64],
+ pub mc_av: [u32; 2],
+ pub mc_frame: [::register_t; 42],
+ pub mc_fpreg: [u64; 33],
+ pub mc_vsxfpreg: [u64; 32],
+ }
+}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for mcontext_t {
+ fn eq(&self, other: &mcontext_t) -> bool {
+ self.mc_vers == other.mc_vers &&
+ self.mc_flags == other.mc_flags &&
+ self.mc_onstack == other.mc_onstack &&
+ self.mc_len == other.mc_len &&
+ self.mc_avec == other.mc_avec &&
+ self.mc_av == other.mc_av &&
+ self.mc_frame == other.mc_frame &&
+ self.mc_fpreg == other.mc_fpreg &&
+ self.mc_vsxfpreg == other.mc_vsxfpreg
+ }
+ }
+ impl Eq for mcontext_t {}
+ impl ::fmt::Debug for mcontext_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("mcontext_t")
+ .field("mc_vers", &self.mc_vers)
+ .field("mc_flags", &self.mc_flags)
+ .field("mc_onstack", &self.mc_onstack)
+ .field("mc_len", &self.mc_len)
+ .field("mc_avec", &self.mc_avec)
+ .field("mc_av", &self.mc_av)
+ .field("mc_frame", &self.mc_frame)
+ .field("mc_fpreg", &self.mc_fpreg)
+ .field("mc_vsxfpreg", &self.mc_vsxfpreg)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for mcontext_t {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.mc_vers.hash(state);
+ self.mc_flags.hash(state);
+ self.mc_onstack.hash(state);
+ self.mc_len.hash(state);
+ self.mc_avec.hash(state);
+ self.mc_av.hash(state);
+ self.mc_frame.hash(state);
+ self.mc_fpreg.hash(state);
+ self.mc_vsxfpreg.hash(state);
+ }
+ }
+ }
+}
+
pub(crate) const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs
index 07f2f11cdc9a4..ca9cf5c8524f2 100644
--- a/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs
@@ -32,6 +32,68 @@ s! {
}
}
+s_no_extra_traits! {
+ #[repr(align(16))]
+ pub struct mcontext_t {
+ pub mc_vers: ::c_int,
+ pub mc_flags: ::c_int,
+ pub mc_onstack: ::c_int,
+ pub mc_len: ::c_int,
+ pub mc_avec: [u64; 64],
+ pub mc_av: [u32; 2],
+ pub mc_frame: [::register_t; 42],
+ pub mc_fpreg: [u64; 33],
+ pub mc_vsxfpreg: [u64; 32],
+ }
+}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for mcontext_t {
+ fn eq(&self, other: &mcontext_t) -> bool {
+ self.mc_vers == other.mc_vers &&
+ self.mc_flags == other.mc_flags &&
+ self.mc_onstack == other.mc_onstack &&
+ self.mc_len == other.mc_len &&
+ self.mc_avec == other.mc_avec &&
+ self.mc_av == other.mc_av &&
+ self.mc_frame == other.mc_frame &&
+ self.mc_fpreg == other.mc_fpreg &&
+ self.mc_vsxfpreg == other.mc_vsxfpreg
+ }
+ }
+ impl Eq for mcontext_t {}
+ impl ::fmt::Debug for mcontext_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("mcontext_t")
+ .field("mc_vers", &self.mc_vers)
+ .field("mc_flags", &self.mc_flags)
+ .field("mc_onstack", &self.mc_onstack)
+ .field("mc_len", &self.mc_len)
+ .field("mc_avec", &self.mc_avec)
+ .field("mc_av", &self.mc_av)
+ .field("mc_frame", &self.mc_frame)
+ .field("mc_fpreg", &self.mc_fpreg)
+ .field("mc_vsxfpreg", &self.mc_vsxfpreg)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for mcontext_t {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.mc_vers.hash(state);
+ self.mc_flags.hash(state);
+ self.mc_onstack.hash(state);
+ self.mc_len.hash(state);
+ self.mc_avec.hash(state);
+ self.mc_av.hash(state);
+ self.mc_frame.hash(state);
+ self.mc_fpreg.hash(state);
+ self.mc_vsxfpreg.hash(state);
+ }
+ }
+ }
+}
+
pub(crate) const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
pub const MAP_32BIT: ::c_int = 0x00080000;
diff --git a/src/unix/bsd/freebsdlike/freebsd/x86.rs b/src/unix/bsd/freebsdlike/freebsd/x86.rs
index 3e3e5cc9f34fb..75a900a043d09 100644
--- a/src/unix/bsd/freebsdlike/freebsd/x86.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/x86.rs
@@ -66,15 +66,6 @@ s! {
pub st_birthtime_nsec: ::c_long,
__unused: [u8; 8],
}
-
- pub struct ucontext_t {
- pub uc_sigmask: ::sigset_t,
- pub uc_mcontext: ::mcontext_t,
- pub uc_link: *mut ::ucontext_t,
- pub uc_stack: ::stack_t,
- pub uc_flags: ::c_int,
- __spare__: [::c_int; 4],
- }
}
pub(crate) const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
diff --git a/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs b/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs
index 3a016a0519852..208e7f2c90c0a 100644
--- a/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs
@@ -184,14 +184,3 @@ cfg_if! {
}
}
}
-
-s! {
- pub struct ucontext_t {
- pub uc_sigmask: ::sigset_t,
- pub uc_mcontext: ::mcontext_t,
- pub uc_link: *mut ::ucontext_t,
- pub uc_stack: ::stack_t,
- pub uc_flags: ::c_int,
- __spare__: [::c_int; 4],
- }
-}
|
diff --git a/libc-test/semver/freebsd-x86_64.txt b/libc-test/semver/freebsd-x86_64.txt
index be73d1f7290fe..14ddc25a1b254 100644
--- a/libc-test/semver/freebsd-x86_64.txt
+++ b/libc-test/semver/freebsd-x86_64.txt
@@ -13,8 +13,6 @@ _MC_HASSEGS
fpreg
fpreg32
max_align_t
-mcontext_t
reg
reg32
-ucontext_t
xmmreg
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt
index 933fea0e63e94..f5d9ea2fd15f3 100644
--- a/libc-test/semver/freebsd.txt
+++ b/libc-test/semver/freebsd.txt
@@ -2004,6 +2004,7 @@ mallctl
mallctlbymib
mallctlnametomib
mallocx
+mcontext_t
memmem
memrchr
memset_s
@@ -2334,13 +2335,14 @@ timer_t
timex
truncate
ttyname_r
-uuidgen
+ucontext_t
unmount
useconds_t
uselocale
utimensat
utmpx
utrace
+uuidgen
vm_size_t
vmtotal
wait4
|
ucontext_t is missing on aarch64-unknown-freebsd
2e3999ddf0fa added `mcontext_t` but not `ucontext_t`. FreeBSD `ucontext_t` is machine-independent but libc crate limits it by `target_arch`.
See [ucontext_t definition](https://github.com/freebsd/freebsd-src/blob/releng/13.2/sys/sys/_ucontext.h) vs. [mcontext_t definition](https://github.com/freebsd/freebsd-src/blob/releng/13.2/sys/arm64/include/ucontext.h)
```rust
error[E0412]: cannot find type `ucontext_t` in crate `libc`
--> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:219:57
|
219 | let ucontext = &mut *(context as *mut libc::ucontext_t);
| ^^^^^^^^^^ help: a struct with a similar name exists: `mcontext_t`
|
::: veloren-4b6c5f57e3a9/cargo-crates/libc-0.2.133/src/unix/bsd/freebsdlike/freebsd/aarch64.rs:20:1
|
20 | / s_no_extra_traits! {
21 | | pub struct gpregs {
22 | | pub gp_x: [::register_t; 30],
23 | | pub gp_lr: ::register_t,
.. |
44 | | }
45 | | }
| |_- similarly named struct `mcontext_t` defined here
error[E0412]: cannot find type `ucontext_t` in crate `libc`
--> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:259:45
|
259 | unsafe fn get_pc_sp(context: &libc::ucontext_t) -> (usize, usize) {
| ^^^^^^^^^^ help: a struct with a similar name exists: `mcontext_t`
|
::: veloren-4b6c5f57e3a9/cargo-crates/libc-0.2.133/src/unix/bsd/freebsdlike/freebsd/aarch64.rs:20:1
|
20 | / s_no_extra_traits! {
21 | | pub struct gpregs {
22 | | pub gp_x: [::register_t; 30],
23 | | pub gp_lr: ::register_t,
.. |
44 | | }
45 | | }
| |_- similarly named struct `mcontext_t` defined here
error[E0412]: cannot find type `ucontext_t` in crate `libc`
--> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:314:54
|
314 | unsafe fn update_context(context: &mut libc::ucontext_t, regs: TrapHandlerRegs) {
| ^^^^^^^^^^ help: a struct with a similar name exists: `mcontext_t`
|
::: veloren-4b6c5f57e3a9/cargo-crates/libc-0.2.133/src/unix/bsd/freebsdlike/freebsd/aarch64.rs:20:1
|
20 | / s_no_extra_traits! {
21 | | pub struct gpregs {
22 | | pub gp_x: [::register_t; 30],
23 | | pub gp_lr: ::register_t,
.. |
44 | | }
45 | | }
| |_- similarly named struct `mcontext_t` defined here
error[E0425]: cannot find value `pc` in this scope
--> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:420:59
|
420 | context.uc_mcontext.mc_gpregs.gp_pc = pc as libc::register_t;
| ^^ not found in this scope
error[E0425]: cannot find value `sp` in this scope
--> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:421:59
|
421 | context.uc_mcontext.mc_gpregs.gp_sp = sp as libc::register_t;
| ^^ not found in this scope
error[E0425]: cannot find value `x0` in this scope
--> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:422:61
|
422 | context.uc_mcontext.mc_gpregs.gp_x[0] = x0 as libc::register_t;
| ^^ not found in this scope
error[E0425]: cannot find value `x1` in this scope
--> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:423:61
|
423 | context.uc_mcontext.mc_gpregs.gp_x[1] = x1 as libc::register_t;
| ^^ not found in this scope
error[E0425]: cannot find value `x29` in this scope
--> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:424:62
|
424 | context.uc_mcontext.mc_gpregs.gp_x[29] = x29 as libc::register_t;
| ^^^ not found in this scope
error[E0425]: cannot find value `lr` in this scope
--> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:425:62
|
425 | context.uc_mcontext.mc_gpregs.gp_x[30] = lr as libc::register_t;
| ^^ not found in this scope
Some errors have detailed explanations: E0412, E0425.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `wasmer-vm` due to 9 previous errors
```
|
Thanks for the report, feel free to put up a PR for this!
|
2024-08-17T18:04:05Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 3,846
|
rust-lang__libc-3846
|
[
"1618"
] |
d8ff07b336fd28c58088b718fee4f0f350b0f733
|
diff --git a/src/unix/bsd/apple/b32/mod.rs b/src/unix/bsd/apple/b32/mod.rs
index 4707fa4c99991..c28ad931b4c3c 100644
--- a/src/unix/bsd/apple/b32/mod.rs
+++ b/src/unix/bsd/apple/b32/mod.rs
@@ -54,6 +54,11 @@ s_no_extra_traits! {
__sig: c_long,
__opaque: [::c_char; 36]
}
+
+ pub struct pthread_once_t {
+ __sig: c_long,
+ __opaque: [::c_char; ::__PTHREAD_ONCE_SIZE__],
+ }
}
cfg_if! {
@@ -82,6 +87,29 @@ cfg_if! {
self.__opaque.hash(state);
}
}
+ impl PartialEq for pthread_once_t {
+ fn eq(&self, other: &pthread_once_t) -> bool {
+ self.__sig == other.__sig
+ && self.__opaque
+ .iter()
+ .zip(other.__opaque.iter())
+ .all(|(a,b)| a == b)
+ }
+ }
+ impl Eq for pthread_once_t {}
+ impl ::fmt::Debug for pthread_once_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("pthread_once_t")
+ .field("__sig", &self.__sig)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for pthread_once_t {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.__sig.hash(state);
+ self.__opaque.hash(state);
+ }
+ }
}
}
@@ -92,6 +120,7 @@ pub const NET_RT_MAXID: ::c_int = 10;
pub const __PTHREAD_MUTEX_SIZE__: usize = 40;
pub const __PTHREAD_COND_SIZE__: usize = 24;
pub const __PTHREAD_CONDATTR_SIZE__: usize = 4;
+pub const __PTHREAD_ONCE_SIZE__: usize = 4;
pub const __PTHREAD_RWLOCK_SIZE__: usize = 124;
pub const __PTHREAD_RWLOCKATTR_SIZE__: usize = 12;
@@ -103,6 +132,12 @@ pub const BIOCSRTIMEOUT: ::c_ulong = 0x8008426d;
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4008426e;
pub const BIOCSETFNR: ::c_ulong = 0x8008427e;
+const _PTHREAD_ONCE_SIG_INIT: c_long = 0x30B1BCBA;
+pub const PTHREAD_ONCE_INIT: ::pthread_once_t = ::pthread_once_t {
+ __sig: _PTHREAD_ONCE_SIG_INIT,
+ __opaque: [0; 4],
+};
+
extern "C" {
pub fn exchangedata(
path1: *const ::c_char,
diff --git a/src/unix/bsd/apple/b64/mod.rs b/src/unix/bsd/apple/b64/mod.rs
index 48d94bcd6bfdc..2206210da5575 100644
--- a/src/unix/bsd/apple/b64/mod.rs
+++ b/src/unix/bsd/apple/b64/mod.rs
@@ -54,6 +54,11 @@ s_no_extra_traits! {
__sig: c_long,
__opaque: [::c_char; 56]
}
+
+ pub struct pthread_once_t {
+ __sig: c_long,
+ __opaque: [::c_char; __PTHREAD_ONCE_SIZE__],
+ }
}
cfg_if! {
@@ -82,6 +87,29 @@ cfg_if! {
self.__opaque.hash(state);
}
}
+ impl PartialEq for pthread_once_t {
+ fn eq(&self, other: &pthread_once_t) -> bool {
+ self.__sig == other.__sig
+ && self.__opaque
+ .iter()
+ .zip(other.__opaque.iter())
+ .all(|(a,b)| a == b)
+ }
+ }
+ impl Eq for pthread_once_t {}
+ impl ::fmt::Debug for pthread_once_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("pthread_once_t")
+ .field("__sig", &self.__sig)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for pthread_once_t {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.__sig.hash(state);
+ self.__opaque.hash(state);
+ }
+ }
}
}
@@ -92,6 +120,7 @@ pub const NET_RT_MAXID: ::c_int = 11;
pub const __PTHREAD_MUTEX_SIZE__: usize = 56;
pub const __PTHREAD_COND_SIZE__: usize = 40;
pub const __PTHREAD_CONDATTR_SIZE__: usize = 8;
+pub const __PTHREAD_ONCE_SIZE__: usize = 8;
pub const __PTHREAD_RWLOCK_SIZE__: usize = 192;
pub const __PTHREAD_RWLOCKATTR_SIZE__: usize = 16;
@@ -103,6 +132,12 @@ pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
pub const BIOCSETFNR: ::c_ulong = 0x8010427e;
+const _PTHREAD_ONCE_SIG_INIT: c_long = 0x30B1BCBA;
+pub const PTHREAD_ONCE_INIT: ::pthread_once_t = ::pthread_once_t {
+ __sig: _PTHREAD_ONCE_SIG_INIT,
+ __opaque: [0; 8],
+};
+
extern "C" {
pub fn exchangedata(
path1: *const ::c_char,
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index 48d6edd86aa6c..54735b3f9801b 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -3761,6 +3761,19 @@ pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 2;
pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
pub const PTHREAD_CREATE_JOINABLE: ::c_int = 1;
pub const PTHREAD_CREATE_DETACHED: ::c_int = 2;
+pub const PTHREAD_INHERIT_SCHED: ::c_int = 1;
+pub const PTHREAD_EXPLICIT_SCHED: ::c_int = 2;
+pub const PTHREAD_CANCEL_ENABLE: ::c_int = 0x01;
+pub const PTHREAD_CANCEL_DISABLE: ::c_int = 0x00;
+pub const PTHREAD_CANCEL_DEFERRED: ::c_int = 0x02;
+pub const PTHREAD_CANCEL_ASYNCHRONOUS: ::c_int = 0x00;
+pub const PTHREAD_CANCELED: *mut ::c_void = 1 as *mut ::c_void;
+pub const PTHREAD_SCOPE_SYSTEM: ::c_int = 1;
+pub const PTHREAD_SCOPE_PROCESS: ::c_int = 2;
+pub const PTHREAD_PRIO_NONE: ::c_int = 0;
+pub const PTHREAD_PRIO_INHERIT: ::c_int = 1;
+pub const PTHREAD_PRIO_PROTECT: ::c_int = 2;
+
#[cfg(target_arch = "aarch64")]
pub const PTHREAD_STACK_MIN: ::size_t = 16384;
#[cfg(not(target_arch = "aarch64"))]
@@ -5700,6 +5713,40 @@ extern "C" {
newp: *mut ::c_void,
newlen: ::size_t,
) -> ::c_int;
+ pub fn pthread_once(
+ once_control: *mut ::pthread_once_t,
+ init_routine: ::Option<unsafe extern "C" fn()>,
+ ) -> ::c_int;
+ pub fn pthread_attr_getinheritsched(
+ attr: *const ::pthread_attr_t,
+ inheritsched: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_attr_getschedpolicy(
+ attr: *const ::pthread_attr_t,
+ policy: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_attr_getscope(
+ attr: *const ::pthread_attr_t,
+ contentionscope: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_attr_getstackaddr(
+ attr: *const ::pthread_attr_t,
+ stackaddr: *mut *mut ::c_void,
+ ) -> ::c_int;
+ pub fn pthread_attr_getdetachstate(
+ attr: *const ::pthread_attr_t,
+ detachstate: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_attr_setinheritsched(
+ attr: *mut ::pthread_attr_t,
+ inheritsched: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_attr_setschedpolicy(attr: *mut ::pthread_attr_t, policy: ::c_int) -> ::c_int;
+ pub fn pthread_attr_setscope(attr: *mut ::pthread_attr_t, contentionscope: ::c_int) -> ::c_int;
+ pub fn pthread_attr_setstackaddr(
+ attr: *mut ::pthread_attr_t,
+ stackaddr: *mut ::c_void,
+ ) -> ::c_int;
pub fn pthread_setname_np(name: *const ::c_char) -> ::c_int;
pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn pthread_mach_thread_np(thread: ::pthread_t) -> ::mach_port_t;
|
diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt
index 1b548b594a2cb..ec3791acbfa99 100644
--- a/libc-test/semver/apple.txt
+++ b/libc-test/semver/apple.txt
@@ -1117,16 +1117,29 @@ PROC_CSM_TECS
PROC_PIDTASKALLINFO
PROC_PIDTASKINFO
PROC_PIDTHREADINFO
+PTHREAD_CANCEL_ASYNCHRONOUS
+PTHREAD_CANCEL_DEFERRED
+PTHREAD_CANCEL_DISABLE
+PTHREAD_CANCEL_ENABLE
+PTHREAD_CANCELED
PTHREAD_CREATE_DETACHED
PTHREAD_CREATE_JOINABLE
+PTHREAD_EXPLICIT_SCHED
+PTHREAD_INHERIT_SCHED
PTHREAD_INTROSPECTION_THREAD_CREATE
PTHREAD_INTROSPECTION_THREAD_DESTROY
PTHREAD_INTROSPECTION_THREAD_START
PTHREAD_INTROSPECTION_THREAD_TERMINATE
PTHREAD_MUTEX_DEFAULT
PTHREAD_MUTEX_ERRORCHECK
+PTHREAD_ONCE_INIT
+PTHREAD_PRIO_INHERIT
+PTHREAD_PRIO_NONE
+PTHREAD_PRIO_PROTECT
PTHREAD_PROCESS_PRIVATE
PTHREAD_PROCESS_SHARED
+PTHREAD_SCOPE_PROCESS
+PTHREAD_SCOPE_SYSTEM
PTHREAD_STACK_MIN
PT_ATTACH
PT_ATTACHEXC
@@ -1744,6 +1757,7 @@ _WSTOPPED
__PTHREAD_CONDATTR_SIZE__
__PTHREAD_COND_SIZE__
__PTHREAD_MUTEX_SIZE__
+__PTHREAD_ONCE_SIZE__
__PTHREAD_RWLOCKATTR_SIZE__
__PTHREAD_RWLOCK_SIZE__
__darwin_mcontext64
@@ -2041,8 +2055,18 @@ pseudo_AF_KEY
pseudo_AF_PIP
pseudo_AF_RTIP
pseudo_AF_XTP
+pthread_atfork
+pthread_attr_getdetachstate
+pthread_attr_getinheritsched
pthread_attr_getschedparam
+pthread_attr_getschedpolicy
+pthread_attr_getscope
+pthread_attr_getstackaddr
+pthread_attr_setinheritsched
pthread_attr_setschedparam
+pthread_attr_setschedpolicy
+pthread_attr_setscope
+pthread_attr_setstackaddr
pthread_cancel
pthread_condattr_getpshared
pthread_condattr_setpshared
@@ -2064,6 +2088,8 @@ pthread_kill
pthread_main_np
pthread_mutexattr_getpshared
pthread_mutexattr_setpshared
+pthread_once
+pthread_once_t
pthread_rwlockattr_getpshared
pthread_rwlockattr_setpshared
pthread_setname_np
|
Add posix threads support for macOS
Can we add a possibility to use POSIX threads for the macOS? It seems to be not straightforward to do myself - all the code is mixed across many files. Thanks!
P.S. Maybe it is even better if we share all the POSIX-code among several targets which support it. Right now, for example, the `pthread_setschedprio` function is defined in the `/linux-like/linux` but it shouldn't be Linux-only available.
|
PRs welcome.
|
2024-08-17T08:24:54Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 3,844
|
rust-lang__libc-3844
|
[
"3566"
] |
6eddffbaf0de2ade96f780d940c18168bd281bc6
|
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index 97791e6b5a72e..fa291a3694adb 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -2558,6 +2558,14 @@ pub const NFT_CT_PROTO_DST: ::c_int = 12;
pub const NFT_CT_LABELS: ::c_int = 13;
pub const NFT_CT_PKTS: ::c_int = 14;
pub const NFT_CT_BYTES: ::c_int = 15;
+pub const NFT_CT_AVGPKT: ::c_int = 16;
+pub const NFT_CT_ZONE: ::c_int = 17;
+pub const NFT_CT_EVENTMASK: ::c_int = 18;
+pub const NFT_CT_SRC_IP: ::c_int = 19;
+pub const NFT_CT_DST_IP: ::c_int = 20;
+pub const NFT_CT_SRC_IP6: ::c_int = 21;
+pub const NFT_CT_DST_IP6: ::c_int = 22;
+pub const NFT_CT_ID: ::c_int = 23;
pub const NFT_LIMIT_PKTS: ::c_int = 0;
pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1;
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index 2ce09ed168df8..6f6f4d2ea382e 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -4452,6 +4452,13 @@ pub const NFT_CT_PROTO_DST: ::c_int = 12;
pub const NFT_CT_LABELS: ::c_int = 13;
pub const NFT_CT_PKTS: ::c_int = 14;
pub const NFT_CT_BYTES: ::c_int = 15;
+pub const NFT_CT_AVGPKT: ::c_int = 16;
+pub const NFT_CT_ZONE: ::c_int = 17;
+pub const NFT_CT_EVENTMASK: ::c_int = 18;
+pub const NFT_CT_SRC_IP: ::c_int = 19;
+pub const NFT_CT_DST_IP: ::c_int = 20;
+pub const NFT_CT_SRC_IP6: ::c_int = 21;
+pub const NFT_CT_DST_IP6: ::c_int = 22;
pub const NFT_LIMIT_PKTS: ::c_int = 0;
pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1;
|
diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt
index f2f41be9e83d3..c46c11d75cd9f 100644
--- a/libc-test/semver/android.txt
+++ b/libc-test/semver/android.txt
@@ -1500,11 +1500,16 @@ NFT_CMP_LT
NFT_CMP_LTE
NFT_CMP_NEQ
NFT_CONTINUE
+NFT_CT_AVGPKT
NFT_CT_BYTES
NFT_CT_DIRECTION
NFT_CT_DST
+NFT_CT_DST_IP
+NFT_CT_DST_IP6
+NFT_CT_EVENTMASK
NFT_CT_EXPIRATION
NFT_CT_HELPER
+NFT_CT_ID
NFT_CT_L3PROTOCOL
NFT_CT_LABELS
NFT_CT_MARK
@@ -1514,8 +1519,11 @@ NFT_CT_PROTO_DST
NFT_CT_PROTO_SRC
NFT_CT_SECMARK
NFT_CT_SRC
+NFT_CT_SRC_IP
+NFT_CT_SRC_IP6
NFT_CT_STATE
NFT_CT_STATUS
+NFT_CT_ZONE
NFT_DATA_RESERVED_MASK
NFT_DATA_VALUE
NFT_DATA_VALUE_MAXLEN
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
index 79c051f4c7c50..09dd98a77e5c4 100644
--- a/libc-test/semver/linux-gnu.txt
+++ b/libc-test/semver/linux-gnu.txt
@@ -191,9 +191,13 @@ NFT_CMP_LT
NFT_CMP_LTE
NFT_CMP_NEQ
NFT_CONTINUE
+NFT_CT_AVGPKT
NFT_CT_BYTES
NFT_CT_DIRECTION
NFT_CT_DST
+NFT_CT_DST_IP
+NFT_CT_DST_IP6
+NFT_CT_EVENTMASK
NFT_CT_EXPIRATION
NFT_CT_HELPER
NFT_CT_L3PROTOCOL
@@ -205,8 +209,11 @@ NFT_CT_PROTO_DST
NFT_CT_PROTO_SRC
NFT_CT_SECMARK
NFT_CT_SRC
+NFT_CT_SRC_IP
+NFT_CT_SRC_IP6
NFT_CT_STATE
NFT_CT_STATUS
+NFT_CT_ZONE
NFT_DATA_RESERVED_MASK
NFT_DATA_VALUE
NFT_DATA_VALUE_MAXLEN
|
Add missing definitions from linux/include/uapi/linux/netfilter/nf_tables.h
<!--
Please provide the below information:
* the target triple
* link to the documentation of the API showing the type signatures, how to use
it, etc.
In general, just please consider that the people who can help you are all very
busy, they will be helping you in their free time, there are a lot of people in
need of help so they need to prioritize to which issues they devote their free
time, etc. So try to give most of the information upfront, be concise, show
small self-contained examples (nobody has time to create a new cargo project,
set up dependencies,...), etc. Help us help you.
-->
There are missing definitons from `linux/include/uapi/linux/netfilter/nf_tables.h`. I am opening this ticket due to a missing definitions for `NFT_CT_ZONE`, but upon checking that I realized there are a bunch of definitions from that file missing as well.
This is the header I am referring to: https://github.com/torvalds/linux/blob/master/include/uapi/linux/netfilter/nf_tables.h
This is where the definitions are: https://github.com/rust-lang/libc/blob/ad75ba1f261a33d118d61c066818b60efc1fa6fe/src/unix/linux_like/linux/mod.rs#L4034
If this is just a matter of adding the missing definitions, I'd be happy to do it. Let me know.
|
Feel free I would say !
|
2024-08-16T21:09:24Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 3,843
|
rust-lang__libc-3843
|
[
"3689"
] |
fc282833449475d9e7a4a56b9caa1f3e938435b5
|
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index 8984e097b968c..7b39e4784f96d 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -896,6 +896,7 @@ extern "C" {
pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long;
pub fn pipe(fds: *mut ::c_int) -> ::c_int;
pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int;
+ pub fn aligned_alloc(alignment: ::size_t, size: ::size_t) -> *mut ::c_void;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "read$UNIX2003"
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 16964b75e1d62..26b1c550de22c 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -1936,6 +1936,9 @@ fn test_android(target: &str) {
// Added in API level 28, but some tests use level 24.
"fread_unlocked" | "fwrite_unlocked" | "fgets_unlocked" | "fflush_unlocked" => true,
+ // Added in API level 28, but some tests use level 24.
+ "aligned_alloc" => true,
+
// FIXME: bad function pointers:
"isalnum" | "isalpha" | "iscntrl" | "isdigit" | "isgraph" | "islower" | "isprint"
| "ispunct" | "isspace" | "isupper" | "isxdigit" | "isblank" | "tolower"
diff --git a/libc-test/semver/unix.txt b/libc-test/semver/unix.txt
index ac28806ab52e0..062d867b8530c 100644
--- a/libc-test/semver/unix.txt
+++ b/libc-test/semver/unix.txt
@@ -452,6 +452,7 @@ accept
access
addrinfo
alarm
+aligned_alloc
atexit
atof
atoi
|
Missing function: aligned_alloc
This function is part of the [C standard](https://en.cppreference.com/w/c/memory/aligned_alloc). I don't know the full set of targets that support it.
- Linux: [glibc has it](https://www.gnu.org/software/libc/manual/html_node/Aligned-Memory-Blocks.html), and I found it in [musl](https://git.musl-libc.org/cgit/musl/tree/src/malloc/mallocng/aligned_alloc.c?h=v1.2.2), too (but that uses `malloc` + offset -- no idea how they're making sure that you can `free` the resulting pointer)
- FreeBSD also [seems to have it](https://man.freebsd.org/cgi/man.cgi?query=aligned_alloc&apropos=0&sektion=3&manpath=FreeBSD+9-current&format=html)
- macOS: available since 10.15 according to [this](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92143) (but buggy until today... but that's not libc's concern)
- Solaris seems to [have it](https://docs.oracle.com/cd/E88353_01/html/E37843/aligned-alloc-3c.html), and same for [Illumos](https://illumos.org/man/3C/aligned_alloc) (again, [buggy](https://www.illumos.org/issues/16545)...)
- The function is mentioned [here](https://android.googlesource.com/platform/bionic/+/master/docs/status.md) so I assume (recent enough) Android also has it.
|
2024-08-16T20:39:05Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,831
|
rust-lang__libc-3831
|
[
"3696"
] |
bc3c8cb3d32a1df087311ab23af6287098d5fc11
|
diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs
index 35a8c0255be69..29f54b92cd48b 100644
--- a/src/unix/bsd/netbsdlike/mod.rs
+++ b/src/unix/bsd/netbsdlike/mod.rs
@@ -92,6 +92,11 @@ s! {
pub piod_addr: *mut ::c_void,
pub piod_len: ::size_t,
}
+
+ pub struct mmsghdr {
+ pub msg_hdr: ::msghdr,
+ pub msg_len: ::c_uint,
+ }
}
pub const D_T_FMT: ::nl_item = 0;
@@ -847,6 +852,20 @@ extern "C" {
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
+
+ pub fn sendmmsg(
+ sockfd: ::c_int,
+ mmsg: *mut ::mmsghdr,
+ vlen: ::c_uint,
+ flags: ::c_int,
+ ) -> ::c_int;
+ pub fn recvmmsg(
+ sockfd: ::c_int,
+ mmsg: *mut ::mmsghdr,
+ vlen: ::c_uint,
+ flags: ::c_int,
+ timeout: *mut ::timespec,
+ ) -> ::c_int;
}
cfg_if! {
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index 7c58e85c4434c..f919b73e5c2f4 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -401,11 +401,6 @@ s! {
pub sdl_data: [::c_char; 12],
}
- pub struct mmsghdr {
- pub msg_hdr: ::msghdr,
- pub msg_len: ::c_uint,
- }
-
pub struct __exit_status {
pub e_termination: u16,
pub e_exit: u16,
@@ -2759,20 +2754,6 @@ extern "C" {
pub fn kqueue1(flags: ::c_int) -> ::c_int;
- 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;
-
pub fn _lwp_self() -> lwpid_t;
pub fn memmem(
haystack: *const ::c_void,
|
diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt
index afb8afa7f50f0..3833884c855c5 100644
--- a/libc-test/semver/openbsd.txt
+++ b/libc-test/semver/openbsd.txt
@@ -1131,6 +1131,7 @@ mknodat
mkostemp
mkostemps
mkstemps
+mmsghdr
mount_info
mrand48
msdosfs_args
@@ -1210,6 +1211,7 @@ readlinkat
reallocarray
reboot
recvmsg
+recvmmsg
regcomp
regerror
regex_t
@@ -1231,6 +1233,7 @@ sem_init
sem_open
sem_timedwait
sem_unlink
+sendmmsg
sendmsg
setdomainname
setgrent
|
Add `recvmmsg` and `sendmmsg` on OpenBSD (*-unknown-openbsd)
`recvmmsg` is supported on OpenBSD since OpenBSD 7.2: https://www.openbsd.org/72.html
Same for `sendmmsg`.
Documentation is here:
- https://man.openbsd.org/OpenBSD-7.2/recvmmsg
- https://man.openbsd.org/OpenBSD-7.2/sendmmsg
Related PR made at the time when OpenBSD did not support these functions yet: https://github.com/rust-lang/libc/pull/1231
|
2024-08-15T21:29:19Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,771
|
rust-lang__libc-3771
|
[
"3767"
] |
ce2ccd5c624eaf2aa05a1f692a167cf4a7def0f3
|
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index 4d235ba0ad951..6d5deb6b24abd 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -826,6 +826,9 @@ pub const TMP_MAX: ::c_uint = 238328;
pub const FOPEN_MAX: ::c_uint = 16;
pub const FILENAME_MAX: ::c_uint = 4096;
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
+pub const _CS_GNU_LIBC_VERSION: ::c_int = 2;
+pub const _CS_GNU_LIBPTHREAD_VERSION: ::c_int = 3;
+pub const _CS_PATH: ::c_int = 0;
pub const _SC_EQUIV_CLASS_MAX: ::c_int = 41;
pub const _SC_CHARCLASS_NAME_MAX: ::c_int = 45;
pub const _SC_PII: ::c_int = 53;
@@ -1485,6 +1488,7 @@ extern "C" {
) -> ::size_t;
pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char;
+ pub fn confstr(name: ::c_int, buf: *mut ::c_char, len: ::size_t) -> ::size_t;
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
/// POSIX version of `basename(3)`, defined in `libgen.h`.
#[link_name = "__xpg_basename"]
|
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
index 0c0d77888e4d5..79c051f4c7c50 100644
--- a/libc-test/semver/linux-gnu.txt
+++ b/libc-test/semver/linux-gnu.txt
@@ -511,6 +511,9 @@ XSK_UNALIGNED_BUF_ADDR_MASK
XDP_PKT_CONTD
XENFS_SUPER_MAGIC
XFS_SUPER_MAGIC
+_CS_GNU_LIBC_VERSION
+_CS_GNU_LIBPTHREAD_VERSION
+_CS_PATH
_SC_2_C_VERSION
_SC_BASE
_SC_CHARCLASS_NAME_MAX
@@ -611,6 +614,7 @@ aio_write
aiocb
backtrace
clock_adjtime
+confstr
copy_file_range
ctermid
dlinfo
|
Missing POSIX confstr and _CS_* symbols on Linux.
Apple Darwin provides the POSIX standard `confstr(3)` function and associated `_CS_*` symbols. Tested on Darwin and is working.
Requesting the same for Linux.
Quoting src/unix/bsd/apple/mod.rs:
```
// `confstr` keys (only the values guaranteed by `man confstr`).
pub const _CS_PATH: ::c_int = 1;
pub const _CS_DARWIN_USER_DIR: ::c_int = 65536;
pub const _CS_DARWIN_USER_TEMP_DIR: ::c_int = 65537;
pub const _CS_DARWIN_USER_CACHE_DIR: ::c_int = 65538;
...
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "confstr$UNIX2003"
)]
pub fn confstr(name: ::c_int, buf: *mut ::c_char, len: ::size_t) -> ::size_t
```
The Linux version for this crate should be very similar. The Linux man page for `confstr(3)` also helpfully lists the few key `_CS_*` symbols that the developer should expect to be available:
```
_CS_GNU_LIBC_VERSION (GNU C library only; since glibc 2.3.2)
_CS_GNU_LIBPTHREAD_VERSION (GNU C library only; since glibc 2.3.2)
_CS_PATH
```
|
Would you be pleased to create a PR ?
@devnexen I gave it a shot with #3771, but I do not understand why the arm test is failing, so I'm a bit stuck.
|
2024-07-11T00:25:54Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 3,762
|
rust-lang__libc-3762
|
[
"3760"
] |
251a968b712a2c274f66605095d5ee820f4243c2
|
diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs
index 36d8c20381432..699c8181f8466 100644
--- a/src/unix/linux_like/linux/musl/mod.rs
+++ b/src/unix/linux_like/linux/musl/mod.rs
@@ -671,6 +671,12 @@ pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
pub const PTRACE_GETSIGMASK: ::c_uint = 0x420a;
pub const PTRACE_SETSIGMASK: ::c_uint = 0x420b;
+pub const RWF_HIPRI: ::c_int = 0x00000001;
+pub const RWF_DSYNC: ::c_int = 0x00000002;
+pub const RWF_SYNC: ::c_int = 0x00000004;
+pub const RWF_NOWAIT: ::c_int = 0x00000008;
+pub const RWF_APPEND: ::c_int = 0x00000010;
+
pub const AF_IB: ::c_int = 27;
pub const AF_MPLS: ::c_int = 28;
pub const AF_NFC: ::c_int = 39;
@@ -862,6 +868,20 @@ extern "C" {
dirfd: ::c_int,
path: *const ::c_char,
) -> ::c_int;
+ pub fn preadv2(
+ fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int,
+ offset: ::off_t,
+ flags: ::c_int,
+ ) -> ::ssize_t;
+ pub fn pwritev2(
+ fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int,
+ offset: ::off_t,
+ flags: ::c_int,
+ ) -> ::ssize_t;
pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
// Added in `musl` 1.1.20
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 30af90fc8844c..a847f46448938 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -4307,6 +4307,9 @@ fn test_linux(target: &str) {
// FIXME: function pointers changed since Ubuntu 23.10
"strtol" | "strtoll" | "strtoul" | "strtoull" | "fscanf" | "scanf" | "sscanf" => true,
+ // Added in musl 1.2.5
+ "preadv2" | "pwritev2" if musl => true,
+
_ => false,
}
});
diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt
index 7e5a81194bdf8..5a48357cb79e5 100644
--- a/libc-test/semver/linux-musl.txt
+++ b/libc-test/semver/linux-musl.txt
@@ -23,6 +23,11 @@ PF_XDP
PIDFD_NONBLOCK
PR_SET_VMA
PR_SET_VMA_ANON_NAME
+RWF_APPEND
+RWF_DSYNC
+RWF_HIPRI
+RWF_NOWAIT
+RWF_SYNC
SOL_XDP
XDP_SHARED_UMEM
XDP_COPY
@@ -66,11 +71,13 @@ getloadavg
lio_listio
ntptimeval
open_wmemstream
+preadv2
preadv64
prlimit
prlimit64
process_vm_readv
process_vm_writev
+pwritev2
pwritev64
reallocarray
timex
|
preadv2 is not supported on musl libc
The preadv2 function is present on -gnu target, however when compiling on -musl target, which is surprising.
The jobserver-rs would like to use it to optimize it's performance rust-lang/jobserver-rs#90 (the try_acquire optimization has shipped once but reverted, so I opened another PR to use raw syscall directly).
FYI, my motivation is to that this API is used in cc-rs to improve performance.
|
2024-06-28T19:20:10Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,745
|
rust-lang__libc-3745
|
[
"3730"
] |
e209061f6eaf5a3aa6af70d247c76b16462f27f6
|
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index a2942913b95d1..53f1f7adcaffd 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -5534,6 +5534,12 @@ extern "C" {
idx1: ::c_ulong,
idx2: ::c_ulong,
) -> ::c_int;
+
+ pub fn execvpe(
+ file: *const ::c_char,
+ argv: *const *const ::c_char,
+ envp: *const *const ::c_char,
+ ) -> ::c_int;
}
#[link(name = "memstat")]
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index f2c6c3ccddf5a..09dc440400590 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2489,6 +2489,8 @@ fn test_freebsd(target: &str) {
cfg.skip_fn(move |name| {
// skip those that are manually verified
match name {
+ // This is introduced in FreeBSD 14.1
+ "execvpe" => true,
// The `uname` function in the `utsname.h` FreeBSD header is a C
// inline function (has no symbol) that calls the `__xuname` symbol.
// Therefore the function pointer comparison does not make sense for it.
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt
index 5a049d102114e..bb6d67c6d0079 100644
--- a/libc-test/semver/freebsd.txt
+++ b/libc-test/semver/freebsd.txt
@@ -1873,6 +1873,7 @@ eui64_hostton
eui64_ntoa
eui64_ntohost
exect
+execvpe
execvP
explicit_bzero
extattr_delete_fd
|
Missing execvpe on FreeBSD >= 14.1
Target: `x86_64-unknown-freebsd`
API: [GNU-compatible](https://github.com/freebsd/freebsd-src/commit/0667d0e0e365)
Test case: [nix](https://github.com/nix-rust/nix/blob/1939f922431c2009cc726a9ff260e978a2b15fd7/src/unistd.rs#L885), [pager](https://gitlab.com/imp/pager-rs/-/commit/6efe69c173fa), [libafl](https://github.com/AFLplusplus/LibAFL/blob/0f9c82f893b0bb8e91b78c5c17f8d1c8d452669e/utils/noaslr/libnoaslr/src/lib.rs#L188)
|
2024-06-09T09:46:40Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,716
|
rust-lang__libc-3716
|
[
"3704"
] |
1333dcfd8df024a16b9309748d3fc4b8bc83b666
|
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index 9a672fae7ee68..84143e1986bfb 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -4153,7 +4153,6 @@ pub const IPV6_RECVHOPLIMIT: ::c_int = 37;
pub const IPV6_PKTINFO: ::c_int = 46;
pub const IPV6_HOPLIMIT: ::c_int = 47;
pub const IPV6_RECVPKTINFO: ::c_int = 61;
-pub const IPV6_DONTFRAG: ::c_int = 62;
pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 70;
pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 71;
pub const IP_BLOCK_SOURCE: ::c_int = 72;
diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs
index 4d1d32c725287..d9da55d028ec6 100644
--- a/src/unix/bsd/freebsdlike/mod.rs
+++ b/src/unix/bsd/freebsdlike/mod.rs
@@ -980,7 +980,6 @@ pub const IPV6_PKTINFO: ::c_int = 46;
pub const IPV6_HOPLIMIT: ::c_int = 47;
pub const IPV6_RECVTCLASS: ::c_int = 57;
pub const IPV6_TCLASS: ::c_int = 61;
-pub const IPV6_DONTFRAG: ::c_int = 62;
pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 70;
pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 71;
pub const IP_BLOCK_SOURCE: ::c_int = 72;
diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs
index 6ee2a3de44035..7acda9076d1f0 100644
--- a/src/unix/bsd/mod.rs
+++ b/src/unix/bsd/mod.rs
@@ -311,6 +311,7 @@ pub const IPV6_MULTICAST_IF: ::c_int = 9;
pub const IPV6_MULTICAST_HOPS: ::c_int = 10;
pub const IPV6_MULTICAST_LOOP: ::c_int = 11;
pub const IPV6_V6ONLY: ::c_int = 27;
+pub const IPV6_DONTFRAG: ::c_int = 62;
pub const IPTOS_ECN_NOTECT: u8 = 0x00;
pub const IPTOS_ECN_MASK: u8 = 0x03;
|
diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt
index 353b1e7356ff5..35d64153f2650 100644
--- a/libc-test/semver/netbsd.txt
+++ b/libc-test/semver/netbsd.txt
@@ -468,6 +468,7 @@ IPTOS_ECN_ECT0
IPTOS_ECN_ECT1
IPTOS_ECN_MASK
IPTOS_ECN_NOTECT
+IPV6_DONTFRAG
IPV6_JOIN_GROUP
IPV6_LEAVE_GROUP
IPV6_PKTINFO
diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt
index fd4563212d60d..6f07fec590ff5 100644
--- a/libc-test/semver/openbsd.txt
+++ b/libc-test/semver/openbsd.txt
@@ -311,6 +311,7 @@ IPTOS_ECN_ECT0
IPTOS_ECN_ECT1
IPTOS_ECN_MASK
IPTOS_ECN_NOTECT
+IPV6_DONTFRAG
IPV6_JOIN_GROUP
IPV6_LEAVE_GROUP
IPV6_PKTINFO
|
Add IPV6_DONTFRAG socket option on OpenBSD
* target triple: x86_64-unknown-openbsd
* Header file: https://github.com/openbsd/src/blob/35659bf2453d7eeb12fd24089cf668ca13361c18/sys/netinet6/in6.h#L330C9-L330C24
According to the git history this symbol has been there for a very long time, so there is probably no need to check the openbsd version.
|
You re in the luck, seems [it is already there](https://github.com/rust-lang/libc/blob/libc-0.2/src/unix/bsd/netbsdlike/mod.rs#L504).
Huh, totally true. I'm afraid I mixed up the symbol, I am looking for IPV6_DONTFRAG:
https://github.com/openbsd/src/blob/35659bf2453d7eeb12fd24089cf668ca13361c18/sys/netinet6/in6.h#L336
Also has been there since forever in OpenBSD, but I don't think is defined by the libc crate.
|
2024-05-21T19:23:49Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 3,714
|
rust-lang__libc-3714
|
[
"3711"
] |
113efbf2f2c01bfc125807e85608ae1d9b6b6865
|
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index 54735b3f9801b..9c12439e54cbd 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -4914,22 +4914,11 @@ pub const XATTR_SHOWCOMPRESSION: ::c_int = 0x0020;
pub const NET_RT_IFLIST2: ::c_int = 0x0006;
// net/route.h
-pub const RTF_UP: ::c_int = 0x1;
-pub const RTF_GATEWAY: ::c_int = 0x2;
-pub const RTF_HOST: ::c_int = 0x4;
-pub const RTF_REJECT: ::c_int = 0x8;
-pub const RTF_DYNAMIC: ::c_int = 0x10;
-pub const RTF_MODIFIED: ::c_int = 0x20;
-pub const RTF_DONE: ::c_int = 0x40;
pub const RTF_DELCLONE: ::c_int = 0x80;
pub const RTF_CLONING: ::c_int = 0x100;
pub const RTF_XRESOLVE: ::c_int = 0x200;
pub const RTF_LLINFO: ::c_int = 0x400;
-pub const RTF_STATIC: ::c_int = 0x800;
-pub const RTF_BLACKHOLE: ::c_int = 0x1000;
pub const RTF_NOIFREF: ::c_int = 0x2000;
-pub const RTF_PROTO2: ::c_int = 0x4000;
-pub const RTF_PROTO1: ::c_int = 0x8000;
pub const RTF_PRCLONING: ::c_int = 0x10000;
pub const RTF_WASCLONED: ::c_int = 0x20000;
pub const RTF_PROTO3: ::c_int = 0x40000;
@@ -4948,13 +4937,6 @@ pub const RTF_GLOBAL: ::c_int = 0x40000000;
pub const RTM_VERSION: ::c_int = 5;
// Message types
-pub const RTM_ADD: ::c_int = 0x1;
-pub const RTM_DELETE: ::c_int = 0x2;
-pub const RTM_CHANGE: ::c_int = 0x3;
-pub const RTM_GET: ::c_int = 0x4;
-pub const RTM_LOSING: ::c_int = 0x5;
-pub const RTM_REDIRECT: ::c_int = 0x6;
-pub const RTM_MISS: ::c_int = 0x7;
pub const RTM_LOCK: ::c_int = 0x8;
pub const RTM_OLDADD: ::c_int = 0x9;
pub const RTM_OLDDEL: ::c_int = 0xa;
@@ -4978,25 +4960,6 @@ pub const RTV_SSTHRESH: ::c_int = 0x20;
pub const RTV_RTT: ::c_int = 0x40;
pub const RTV_RTTVAR: ::c_int = 0x80;
-// Bitmask values for rtm_addrs.
-pub const RTA_DST: ::c_int = 0x1;
-pub const RTA_GATEWAY: ::c_int = 0x2;
-pub const RTA_NETMASK: ::c_int = 0x4;
-pub const RTA_GENMASK: ::c_int = 0x8;
-pub const RTA_IFP: ::c_int = 0x10;
-pub const RTA_IFA: ::c_int = 0x20;
-pub const RTA_AUTHOR: ::c_int = 0x40;
-pub const RTA_BRD: ::c_int = 0x80;
-
-// Index offsets for sockaddr array for alternate internal encoding.
-pub const RTAX_DST: ::c_int = 0;
-pub const RTAX_GATEWAY: ::c_int = 1;
-pub const RTAX_NETMASK: ::c_int = 2;
-pub const RTAX_GENMASK: ::c_int = 3;
-pub const RTAX_IFP: ::c_int = 4;
-pub const RTAX_IFA: ::c_int = 5;
-pub const RTAX_AUTHOR: ::c_int = 6;
-pub const RTAX_BRD: ::c_int = 7;
pub const RTAX_MAX: ::c_int = 8;
pub const KERN_PROCARGS2: ::c_int = 49;
diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
index 489b82adb84b9..e00e60290369d 100644
--- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -1522,6 +1522,19 @@ pub const NGROUPS: usize = 16;
pub const RB_PAUSE: ::c_int = 0x40000;
pub const RB_VIDEO: ::c_int = 0x20000000;
+// net/route.h
+pub const RTF_CLONING: ::c_int = 0x100;
+pub const RTF_PRCLONING: ::c_int = 0x10000;
+pub const RTF_WASCLONED: ::c_int = 0x20000;
+pub const RTF_MPLSOPS: ::c_int = 0x1000000;
+
+pub const RTM_VERSION: ::c_int = 7;
+
+pub const RTAX_MPLS1: ::c_int = 8;
+pub const RTAX_MPLS2: ::c_int = 9;
+pub const RTAX_MPLS3: ::c_int = 10;
+pub const RTAX_MAX: ::c_int = 11;
+
const_fn! {
{const} fn _CMSG_ALIGN(n: usize) -> usize {
(n + (::mem::size_of::<::c_long>() - 1)) & !(::mem::size_of::<::c_long>() - 1)
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index fc01d8e5463b8..0905d3c94f7f4 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -4697,6 +4697,14 @@ pub const CPU_WHICH_CPUSET: ::c_int = 3;
pub const CPU_WHICH_IRQ: ::c_int = 4;
pub const CPU_WHICH_JAIL: ::c_int = 5;
+// net/route.h
+pub const RTF_LLDATA: ::c_int = 0x400;
+pub const RTF_FIXEDMTU: ::c_int = 0x80000;
+
+pub const RTM_VERSION: ::c_int = 5;
+
+pub const RTAX_MAX: ::c_int = 8;
+
// sys/signal.h
pub const SIGTHR: ::c_int = 32;
pub const SIGLWP: ::c_int = SIGTHR;
diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs
index af0632882cdbc..5ce3600d94ac9 100644
--- a/src/unix/bsd/freebsdlike/mod.rs
+++ b/src/unix/bsd/freebsdlike/mod.rs
@@ -1009,6 +1009,25 @@ pub const SO_TYPE: ::c_int = 0x1008;
pub const LOCAL_PEERCRED: ::c_int = 1;
+// net/route.h
+pub const RTF_XRESOLVE: ::c_int = 0x200;
+pub const RTF_LLINFO: ::c_int = 0x400;
+pub const RTF_PROTO3: ::c_int = 0x40000;
+pub const RTF_PINNED: ::c_int = 0x100000;
+pub const RTF_LOCAL: ::c_int = 0x200000;
+pub const RTF_BROADCAST: ::c_int = 0x400000;
+pub const RTF_MULTICAST: ::c_int = 0x800000;
+
+pub const RTM_LOCK: ::c_int = 0x8;
+pub const RTM_RESOLVE: ::c_int = 0xb;
+pub const RTM_NEWADDR: ::c_int = 0xc;
+pub const RTM_DELADDR: ::c_int = 0xd;
+pub const RTM_IFINFO: ::c_int = 0xe;
+pub const RTM_NEWMADDR: ::c_int = 0xf;
+pub const RTM_DELMADDR: ::c_int = 0x10;
+pub const RTM_IFANNOUNCE: ::c_int = 0x11;
+pub const RTM_IEEE80211: ::c_int = 0x12;
+
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
pub const SHUT_RDWR: ::c_int = 2;
diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs
index 61f764d1d2dee..918007159862e 100644
--- a/src/unix/bsd/mod.rs
+++ b/src/unix/bsd/mod.rs
@@ -543,6 +543,49 @@ pub const ITIMER_REAL: ::c_int = 0;
pub const ITIMER_VIRTUAL: ::c_int = 1;
pub const ITIMER_PROF: ::c_int = 2;
+// net/route.h
+
+pub const RTF_UP: ::c_int = 0x1;
+pub const RTF_GATEWAY: ::c_int = 0x2;
+pub const RTF_HOST: ::c_int = 0x4;
+pub const RTF_REJECT: ::c_int = 0x8;
+pub const RTF_DYNAMIC: ::c_int = 0x10;
+pub const RTF_MODIFIED: ::c_int = 0x20;
+pub const RTF_DONE: ::c_int = 0x40;
+pub const RTF_STATIC: ::c_int = 0x800;
+pub const RTF_BLACKHOLE: ::c_int = 0x1000;
+pub const RTF_PROTO2: ::c_int = 0x4000;
+pub const RTF_PROTO1: ::c_int = 0x8000;
+
+// Message types
+pub const RTM_ADD: ::c_int = 0x1;
+pub const RTM_DELETE: ::c_int = 0x2;
+pub const RTM_CHANGE: ::c_int = 0x3;
+pub const RTM_GET: ::c_int = 0x4;
+pub const RTM_LOSING: ::c_int = 0x5;
+pub const RTM_REDIRECT: ::c_int = 0x6;
+pub const RTM_MISS: ::c_int = 0x7;
+
+// Bitmask values for rtm_addrs.
+pub const RTA_DST: ::c_int = 0x1;
+pub const RTA_GATEWAY: ::c_int = 0x2;
+pub const RTA_NETMASK: ::c_int = 0x4;
+pub const RTA_GENMASK: ::c_int = 0x8;
+pub const RTA_IFP: ::c_int = 0x10;
+pub const RTA_IFA: ::c_int = 0x20;
+pub const RTA_AUTHOR: ::c_int = 0x40;
+pub const RTA_BRD: ::c_int = 0x80;
+
+// Index offsets for sockaddr array for alternate internal encoding.
+pub const RTAX_DST: ::c_int = 0;
+pub const RTAX_GATEWAY: ::c_int = 1;
+pub const RTAX_NETMASK: ::c_int = 2;
+pub const RTAX_GENMASK: ::c_int = 3;
+pub const RTAX_IFP: ::c_int = 4;
+pub const RTAX_IFA: ::c_int = 5;
+pub const RTAX_AUTHOR: ::c_int = 6;
+pub const RTAX_BRD: ::c_int = 7;
+
f! {
pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr {
if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() {
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index 318557daf52b8..0921d56912cd2 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -2402,6 +2402,33 @@ pub const fn MAP_ALIGNED(alignment: ::c_int) -> ::c_int {
alignment << MAP_ALIGNMENT_SHIFT
}
+// net/route.h
+pub const RTF_MASK: ::c_int = 0x80;
+pub const RTF_CONNECTED: ::c_int = 0x100;
+pub const RTF_ANNOUNCE: ::c_int = 0x20000;
+pub const RTF_SRC: ::c_int = 0x10000;
+pub const RTF_LOCAL: ::c_int = 0x40000;
+pub const RTF_BROADCAST: ::c_int = 0x80000;
+pub const RTF_UPDATING: ::c_int = 0x100000;
+pub const RTF_DONTCHANGEIFA: ::c_int = 0x200000;
+
+pub const RTM_VERSION: ::c_int = 4;
+pub const RTM_LOCK: ::c_int = 0x8;
+pub const RTM_IFANNOUNCE: ::c_int = 0x10;
+pub const RTM_IEEE80211: ::c_int = 0x11;
+pub const RTM_SETGATE: ::c_int = 0x12;
+pub const RTM_LLINFO_UPD: ::c_int = 0x13;
+pub const RTM_IFINFO: ::c_int = 0x14;
+pub const RTM_OCHGADDR: ::c_int = 0x15;
+pub const RTM_NEWADDR: ::c_int = 0x16;
+pub const RTM_DELADDR: ::c_int = 0x17;
+pub const RTM_CHGADDR: ::c_int = 0x18;
+
+pub const RTA_TAG: ::c_int = 0x100;
+
+pub const RTAX_TAG: ::c_int = 8;
+pub const RTAX_MAX: ::c_int = 9;
+
const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
(p + _ALIGNBYTES) & !_ALIGNBYTES
diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs
index 357662547b8e3..9e14e89515e47 100644
--- a/src/unix/bsd/netbsdlike/openbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs
@@ -1881,6 +1881,54 @@ pub const RB_RESET: ::c_int = 0x08000;
pub const RB_GOODRANDOM: ::c_int = 0x10000;
pub const RB_UNHIBERNATE: ::c_int = 0x20000;
+// net/route.h
+pub const RTF_CLONING: ::c_int = 0x100;
+pub const RTF_MULTICAST: ::c_int = 0x200;
+pub const RTF_LLINFO: ::c_int = 0x400;
+pub const RTF_PROTO3: ::c_int = 0x2000;
+pub const RTF_ANNOUNCE: ::c_int = ::RTF_PROTO2;
+
+pub const RTF_CLONED: ::c_int = 0x10000;
+pub const RTF_CACHED: ::c_int = 0x20000;
+pub const RTF_MPATH: ::c_int = 0x40000;
+pub const RTF_MPLS: ::c_int = 0x100000;
+pub const RTF_LOCAL: ::c_int = 0x200000;
+pub const RTF_BROADCAST: ::c_int = 0x400000;
+pub const RTF_CONNECTED: ::c_int = 0x800000;
+pub const RTF_BFD: ::c_int = 0x1000000;
+pub const RTF_FMASK: ::c_int = b'\\' as _;
+
+pub const RTM_VERSION: ::c_int = 5;
+pub const RTM_RESOLVE: ::c_int = 0xb;
+pub const RTM_NEWADDR: ::c_int = 0xc;
+pub const RTM_DELADDR: ::c_int = 0xd;
+pub const RTM_IFINFO: ::c_int = 0xe;
+pub const RTM_IFANNOUNCE: ::c_int = 0xf;
+pub const RTM_DESYNC: ::c_int = 0x10;
+pub const RTM_INVALIDATE: ::c_int = 0x11;
+pub const RTM_BFD: ::c_int = 0x12;
+pub const RTM_PROPOSAL: ::c_int = 0x13;
+pub const RTM_CHGADDRATTR: ::c_int = 0x14;
+pub const RTM_80211INFO: ::c_int = 0x15;
+pub const RTM_SOURCE: ::c_int = 0x16;
+
+pub const RTA_SRC: ::c_int = 0x100;
+pub const RTA_SRCMASK: ::c_int = 0x200;
+pub const RTA_LABEL: ::c_int = 0x400;
+pub const RTA_BFD: ::c_int = 0x800;
+pub const RTA_DNS: ::c_int = 0x1000;
+pub const RTA_STATIC: ::c_int = 0x2000;
+pub const RTA_SEARCH: ::c_int = 0x4000;
+
+pub const RTAX_SRC: ::c_int = 8;
+pub const RTAX_SRCMASK: ::c_int = 9;
+pub const RTAX_LABEL: ::c_int = 10;
+pub const RTAX_BFD: ::c_int = 11;
+pub const RTAX_DNS: ::c_int = 12;
+pub const RTAX_STATIC: ::c_int = 13;
+pub const RTAX_SEARCH: ::c_int = 14;
+pub const RTAX_MAX: ::c_int = 15;
+
const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
(p + _ALIGNBYTES) & !_ALIGNBYTES
|
diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt
index b9ccffb681ad3..e01fe55d72ff3 100644
--- a/libc-test/semver/dragonfly.txt
+++ b/libc-test/semver/dragonfly.txt
@@ -873,6 +873,31 @@ RLIMIT_STACK
RLIMIT_VMEM
RLIM_INFINITY
RLIM_NLIMITS
+RTF_XRESOLVE
+RTF_LLINFO
+RTF_PROTO3
+RTF_PINNED
+RTF_LOCAL
+RTF_BROADCAST
+RTF_MULTICAST
+RTM_LOCK
+RTM_RESOLVE
+RTM_NEWADDR
+RTM_DELADDR
+RTM_IFINFO
+RTM_NEWMADDR
+RTM_DELMADDR
+RTM_IFANNOUNCE
+RTM_IEEE80211
+RTF_CLONING
+RTF_PRCLONING
+RTF_WASCLONED
+RTF_MPLSOPS
+RTM_VERSION
+RTAX_MPLS1
+RTAX_MPLS2
+RTAX_MPLS3
+RTAX_MAX
RTLD_NEXT
RTLD_NODELETE
RTLD_NOLOAD
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt
index cb36429fb36ab..5d4253029e5e6 100644
--- a/libc-test/semver/freebsd.txt
+++ b/libc-test/semver/freebsd.txt
@@ -1222,6 +1222,26 @@ RLIMIT_UMTXP
RLIMIT_VMEM
RLIM_INFINITY
RLIM_NLIMITS
+RTF_XRESOLVE
+RTF_LLINFO
+RTF_PROTO3
+RTF_PINNED
+RTF_LOCAL
+RTF_BROADCAST
+RTF_MULTICAST
+RTM_LOCK
+RTM_RESOLVE
+RTM_NEWADDR
+RTM_DELADDR
+RTM_IFINFO
+RTM_NEWMADDR
+RTM_DELMADDR
+RTM_IFANNOUNCE
+RTM_IEEE80211
+RTF_LLDATA
+RTF_FIXEDMTU
+RTM_VERSION
+RTAX_MAX
RTLD_NEXT
RTLD_NODELETE
RTLD_NOLOAD
diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt
index e07a7dbf08ae6..cfde7caca0c55 100644
--- a/libc-test/semver/netbsd.txt
+++ b/libc-test/semver/netbsd.txt
@@ -929,6 +929,28 @@ RLIM_INFINITY
RLIM_NLIMITS
RLIM_SAVED_CUR
RLIM_SAVED_MAX
+RTF_MASK
+RTF_CONNECTED
+RTF_ANNOUNCE
+RTF_SRC
+RTF_LOCAL
+RTF_BROADCAST
+RTF_UPDATING
+RTF_DONTCHANGEIFA
+RTM_VERSION
+RTM_LOCK
+RTM_IFANNOUNCE
+RTM_IEEE80211
+RTM_SETGATE
+RTM_LLINFO_UPD
+RTM_IFINFO
+RTM_OCHGADDR
+RTM_NEWADDR
+RTM_DELADDR
+RTM_CHGADDR
+RTA_TAG
+RTAX_TAG
+RTAX_MAX
RTLD_NEXT
RTLD_NOLOAD
RTLD_SELF
diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt
index 019ab53d34ff0..9297c4ac4b81e 100644
--- a/libc-test/semver/openbsd.txt
+++ b/libc-test/semver/openbsd.txt
@@ -761,8 +761,50 @@ RLIM_INFINITY
RLIM_NLIMITS
RLIM_SAVED_CUR
RLIM_SAVED_MAX
+RTA_BFD
+RTA_DNS
+RTA_LABEL
+RTA_SEARCH
+RTA_SRC
+RTA_SRCMASK
+RTA_STATIC
+RTAX_BFD
+RTAX_DNS
+RTAX_LABEL
+RTAX_MAX
+RTAX_SEARCH
+RTAX_SRC
+RTAX_SRCMASK
+RTAX_STATIC
+RTF_ANNOUNCE
+RTF_BFD
+RTF_BROADCAST
+RTF_CACHED
+RTF_CLONED
+RTF_CLONING
+RTF_CONNECTED
+RTF_FMASK
+RTF_LLINFO
+RTF_LOCAL
+RTF_MPATH
+RTF_MPLS
+RTF_MULTICAST
+RTF_PROTO3
RTLD_NEXT
RTLD_SELF
+RTM_80211INFO
+RTM_BFD
+RTM_CHGADDRATTR
+RTM_DELADDR
+RTM_DESYNC
+RTM_IFANNOUNCE
+RTM_IFINFO
+RTM_INVALIDATE
+RTM_NEWADDR
+RTM_PROPOSAL
+RTM_RESOLVE
+RTM_SOURCE
+RTM_VERSION
RUSAGE_CHILDREN
RUSAGE_SELF
RUSAGE_THREAD
|
Missing RTF_*, RTA_*, RTAX_*, RTM_* definitions on BSDs
Target: `x86_64-unknown-dragonfly`, `x86_64-unknown-freebsd`, `x86_64-unknown-netbsd`, `x86_64-unknown-openbsd`
API: [BSD 4.3 Reno](https://github.com/dspinellis/unix-history-repo/blob/BSD-4_3_Reno/usr/src/sys/net/route.h) (historic), [DragonFly](https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/net/route.h), [FreeBSD](https://github.com/freebsd/freebsd-src/blob/main/sys/net/route.h), [NetBSD](https://github.com/netbsd/src/blob/trunk/sys/net/route.h), [OpenBSD](https://github.com/openbsd/src/blob/master/sys/net/route.h)
Test case: https://github.com/n0-computer/iroh/issues/2306
See also: [downstream fix](https://github.com/freebsd/freebsd-ports/blob/78ad38f04f51/games/jumpy/files/patch-libc), copy-pasted from macOS and likely incorrect/incomplete
|
2024-05-19T16:09:04Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,695
|
rust-lang__libc-3695
|
[
"3688"
] |
2899529e27b303af0029624813823fd89a7ba605
|
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index a7dd919399fd9..5a350b7a57d84 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -491,6 +491,17 @@ s! {
pub tcpi_rcv_space: u32,
pub tcpi_total_retrans: u32,
}
+
+ pub struct fanotify_event_info_pidfd {
+ pub hdr: ::fanotify_event_info_header,
+ pub pidfd: ::__s32,
+ }
+
+ pub struct fanotify_event_info_error {
+ pub hdr: ::fanotify_event_info_header,
+ pub error: ::__s32,
+ pub error_count: ::__u32,
+ }
}
impl siginfo_t {
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index a47d0618ab230..616e2e7c7d466 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -16,6 +16,7 @@ pub type loff_t = ::c_longlong;
pub type pthread_key_t = ::c_uint;
pub type pthread_once_t = ::c_int;
pub type pthread_spinlock_t = ::c_int;
+pub type __kernel_fsid_t = __c_anonymous__kernel_fsid_t;
pub type __u8 = ::c_uchar;
pub type __u16 = ::c_ushort;
@@ -590,6 +591,10 @@ s! {
pub r_info: Elf64_Xword,
}
+ pub struct __c_anonymous__kernel_fsid_t {
+ pub val: [::c_int; 2],
+ }
+
pub struct ucred {
pub pid: ::pid_t,
pub uid: ::uid_t,
@@ -657,6 +662,18 @@ s! {
pub response: __u32,
}
+ pub struct fanotify_event_info_header {
+ pub info_type: __u8,
+ pub pad: __u8,
+ pub len: __u16,
+ }
+
+ pub struct fanotify_event_info_fid {
+ pub hdr: fanotify_event_info_header,
+ pub fsid: ::__kernel_fsid_t,
+ pub handle: [::c_uchar; 0],
+ }
+
pub struct sockaddr_vm {
pub svm_family: ::sa_family_t,
pub svm_reserved1: ::c_ushort,
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index eeb119e9549a9..da12acade8f00 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -3700,6 +3700,9 @@ fn test_linux(target: &str) {
if musl && ty == "fanout_args" {
return true;
}
+ if sparc64 && ty == "fanotify_event_info_error" {
+ return true;
+ }
match ty {
// These cannot be tested when "resolv.h" is included and are tested
@@ -4449,7 +4452,11 @@ fn test_linux(target: &str) {
// the `tcpi_delivery_rate_app_limited` field is a bitfield on musl
(musl && struct_ == "tcp_info" && field == "tcpi_delivery_rate_app_limited") ||
// the `tcpi_fast_open_client_fail` field is a bitfield on musl
- (musl && struct_ == "tcp_info" && field == "tcpi_fast_open_client_fail")
+ (musl && struct_ == "tcp_info" && field == "tcpi_fast_open_client_fail") ||
+ // either fsid_t or int[2] type
+ (struct_ == "fanotify_event_info_fid" && field == "fsid") ||
+ // `handle` is a VLA
+ (struct_ == "fanotify_event_info_fid" && field == "handle")
});
cfg.skip_roundtrip(move |s| match s {
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
index f775994cd6725..5b079941bb970 100644
--- a/libc-test/semver/linux-gnu.txt
+++ b/libc-test/semver/linux-gnu.txt
@@ -628,6 +628,9 @@ dlinfo
dlmopen
endutxent
explicit_bzero
+fanotify_event_info_error
+fanotify_event_info_header
+fanotify_event_info_pidfd
fgetgrent_r
fgetspent_r
futimes
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index 2e928030486d4..402241df1d033 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -3540,6 +3540,7 @@ execvpe
faccessat
fallocate
fallocate64
+fanotify_event_info_fid
fanotify_event_metadata
fanotify_init
fanotify_mark
|
Add struct `fanotify_event_info_fid`
Host triplet: `x86_64-unknown-linux-gnu`
API struct is as follows:
```c
struct fanotify_event_info_fid {
struct fanotify_event_info_header hdr;
__kernel_fsid_t fsid;
unsigned char file_handle[0];
};
```
Man page for more info: https://man7.org/linux/man-pages/man7/fanotify.7.html
Source link: https://github.com/torvalds/linux/blob/dccb07f2914cdab2ac3a5b6c98406f765acab803/include/uapi/linux/fanotify.h#L166
|
2024-05-11T13:19:32Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,690
|
rust-lang__libc-3690
|
[
"3608",
"3677"
] |
76462771b6f8a6889ba6becadb53418df5515370
|
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index ce8e9782c49a0..fb0b06701507c 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -48,6 +48,10 @@ pub type Elf64_Xword = u64;
pub type eventfd_t = u64;
+// these structs sit behind a heap allocation on Android
+pub type posix_spawn_file_actions_t = *mut ::c_void;
+pub type posix_spawnattr_t = *mut ::c_void;
+
s! {
pub struct stack_t {
pub ss_sp: *mut ::c_void,
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 2b15c958d2d51..f8d797f126736 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -1613,6 +1613,7 @@ fn test_android(target: &str) {
"sched.h",
"semaphore.h",
"signal.h",
+ "spawn.h",
"stddef.h",
"stdint.h",
"stdio.h",
@@ -1767,6 +1768,9 @@ fn test_android(target: &str) {
// These are tested in the `linux_elf.rs` file.
"Elf64_Phdr" | "Elf32_Phdr" => true,
+ // These are intended to be opaque
+ "posix_spawn_file_actions_t" => true,
+ "posix_spawnattr_t" => true,
_ => false,
}
});
|
[libc-0.2] `posix_spawn_file_actions_t` cannot be used on Linux after #3602
We found an issue when updating ferrocene's libc submodule (ferrocene/ferrocene#356) to revision 947a1855124bdd13029d322ae6ab2b4f0451db9b . the only change included in our libc update was PR #3602 .
when building stage 2 of libstd to x86_64-linux the build failed to execute the build script of the `quote` crate with the following error:
``` text
thread 'main' panicked at library/std/src/sys_common/process.rs:155:17:
called Result::unwrap() on an Err value: Os { code: 9, kind: Uncategorized, message: "Bad file descriptor" }
```
where the mentioned line corresponds to [this revision](https://github.com/ferrocene/ferrocene/blob/46faebf340ed558b70026eaad44ca32d36d1542b/library/std/src/sys_common/process.rs#L155).
Tracking down the error led us to this usage of [the `posix_spawn` API](https://github.com/ferrocene/ferrocene/blob/46faebf340ed558b70026eaad44ca32d36d1542b/library/std/src/sys/pal/unix/process/process_unix.rs#L585-L586):
``` rust
let mut file_actions = MaybeUninit::uninit();
cvt_nz(libc::posix_spawn_file_actions_init(file_actions.as_mut_ptr()))?;
```
This code allocates a `posix_spawn_file_actions_init` type *on the stack*. before #3602, the `file_actions` stack variable had the correct size and alignment but after #3602, it now has a size and alignment of `*mut c_void` (8 bytes on x86_64) and that results in UB when `posix_spawn_file_actions_init` is called.
GLIBC implements `posix_spawn_file_actions_init` as [a memset operation](https://sourceware.org/git/?p=glibc.git;a=blob;f=posix/spawn_faction_init.c;h=09ee703d33bd6ce9af090ef38bc3921622380783;hb=b6e3898194bbae78910bbe9cd086937014961e45#l51) that zeroes the struct. In Rust syntax, that would be more or less this code:
``` rust
#[repr(C)]
struct posix_spawn_file_actions_t {
// fields and padding here
}
unsafe fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int {
ptr::write_bytes(actions, 0, 1);
0
}
```
Bionic implements `posix_spawn_file_actions_init` differently. It uses a heap allocation as indirection. The Rust version of the bionic implementation looks roughly like this:
``` rust
#[repr(C)]
struct __actual_posix_spawn_file_actions_t {
// fields and padding here
}
type posix_spawn_file_actions_t = *mut c_void;
unsafe fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int {
let mut alloc = Box::new(MaybeUninit::<__actual_posix_spawn_file_actions_t>::uninit());
ptr::write_bytes(alloc.as_mut_ptr(), 0, 1);
*actions = Box::into_raw(alloc).cast();
0
}
```
This usage of `posix_spawn_file_actions_t` in libstd:
``` rust
let mut file_actions = MaybeUninit::uninit();
cvt_nz(libc::posix_spawn_file_actions_init(file_actions.as_mut_ptr()))?;
```
is compatible with both GLIBC and Bionic but the `libc` crate needs to provide the correct size and alignment on Linux.
So, the conditional code should produce this on Linux
``` rust
pub struct posix_spawn_file_actions_t {
__allocated: ::c_int,
__used: ::c_int,
__actions: *mut ::c_int,
__pad: [::c_int; 16],
}
```
but this on Android
``` rust
pub type posix_spawn_file_actions_t = *mut ::c_void;
```
---
All this probably also applies to the `posix_spawnattr_t` type but I have yet to look into the details of the GLIBC code around that type.
I'll send up a fix PR after I have done some more testing.
Recent changes to posix spawn seems to cause a segfault in std::process::Command
Hi.
The CI of rustc_codegen_gcc suddendly started failing.
After investigation, it seems to be caused by recent changes to libc, regarding posix spawn stuff (so possibly related to [this change](https://github.com/rust-lang/libc/pull/3629)).
My target triple is: `x86_64-unknown-linux-gnu`.
Here's the code (inspired by `std::process::Command`) that works with libc 0.2.153, but segfaults with 0.2.154 (it doesn't reproduce in the playground since [it still uses version 0.2.153](https://github.com/rust-lang/rust-playground/blob/main/compiler/base/Cargo.toml#L692)):
```rust
use std::{ffi::OsStr, io};
use std::ffi::{c_int, c_ulong, c_short};
use libc::{gid_t, pid_t, uid_t};
//use std::os::unix::raw::{uid_t, gid_t, pid_t};
mod imp {
use std::{ffi::{CString, OsStr}, io, os::unix::ffi::OsStrExt, process::Stdio};
use libc::{gid_t, pid_t, uid_t};
//use std::os::unix::raw::{uid_t, gid_t, pid_t};
pub struct Command {
pub program: CString,
args: Vec<CString>,
cwd: Option<CString>,
pub uid: Option<uid_t>,
pub gid: Option<gid_t>,
saw_nul: bool,
pub closures: Vec<Box<dyn FnMut() -> io::Result<()> + Send + Sync>>,
pub groups: Option<Box<[gid_t]>>,
stdin: Option<Stdio>,
stdout: Option<Stdio>,
stderr: Option<Stdio>,
#[cfg(target_os = "linux")]
pub create_pidfd: bool,
pub pgroup: Option<pid_t>,
}
fn os2c(s: &OsStr, saw_nul: &mut bool) -> CString {
CString::new(s.as_bytes()).unwrap_or_else(|_e| {
*saw_nul = true;
CString::new("<string-with-nul>").unwrap()
})
}
impl Command {
pub fn new(program: &OsStr) -> Command {
let mut saw_nul = false;
let program = os2c(program, &mut saw_nul);
Command {
args: vec![program.clone()],
program,
cwd: None,
uid: None,
gid: None,
saw_nul,
closures: Vec::new(),
groups: None,
stdin: None,
stdout: None,
stderr: None,
create_pidfd: false,
pgroup: None,
}
}
}
}
pub fn cvt_nz(error: c_int) -> io::Result<()> {
if error == 0 {
return Ok(())
}
panic!();
}
pub struct Command {
inner: imp::Command,
}
impl Command {
pub fn new<S: AsRef<OsStr>>(program: S) -> Command {
Command { inner: imp::Command::new(program.as_ref()) }
}
pub fn get_pgroup(&self) -> Option<pid_t> {
self.inner.pgroup
}
pub fn get_create_pidfd(&self) -> bool {
self.inner.create_pidfd
}
pub fn get_uid(&self) -> Option<uid_t> {
self.inner.uid
}
pub fn get_gid(&self) -> Option<gid_t> {
self.inner.gid
}
pub fn env_saw_path(&self) -> bool {
false
}
pub fn program_is_path(&self) -> bool {
self.inner.program.to_bytes().contains(&b'/')
}
pub fn get_closures(&mut self) -> &mut Vec<Box<dyn FnMut() -> io::Result<()> + Send + Sync>> {
&mut self.inner.closures
}
pub fn get_groups(&self) -> Option<&[gid_t]> {
self.inner.groups.as_deref()
}
fn posix_spawn(
&mut self,
) -> io::Result<Option<i32>> {
use std::mem::MaybeUninit;
if self.get_gid().is_some()
|| self.get_uid().is_some()
|| (self.env_saw_path() && !self.program_is_path())
|| !self.get_closures().is_empty()
|| self.get_groups().is_some()
|| self.get_create_pidfd()
{
return Ok(None);
}
#[repr(C)]
struct sched_param {
sched_priority: c_int,
}
#[repr(C)]
struct sigset_t {
__val: [c_ulong; 16],
}
#[repr(C)]
pub struct posix_spawnattr_t {
__flags: c_short,
__pgrp: pid_t,
__sd: sigset_t,
__ss: sigset_t,
#[cfg(any(target_env = "musl", target_env = "ohos"))]
__prio: c_int,
#[cfg(not(any(target_env = "musl", target_env = "ohos")))]
__sp: sched_param,
__policy: c_int,
__pad: [c_int; 16],
}
extern "C" {
fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> c_int;
}
unsafe {
let mut attrs = MaybeUninit::uninit();
//cvt_nz(posix_spawnattr_init(attrs.as_mut_ptr()))?; // This works.
cvt_nz(libc::posix_spawnattr_init(attrs.as_mut_ptr()))?; // This segfaults.
Ok(None)
}
}
}
fn main() {
let mut command = Command::new("ls");
command.posix_spawn().unwrap();
}
```
It seems there's stack corruption.
It could be interesting to run the std tests in the CI to check if changes to libc breaks anything.
Thanks.
**Edit:** Pinning to the version 0.2.153 fixes the CI in rustc_codegen_gcc: https://github.com/rust-lang/rustc_codegen_gcc/pull/512
|
@JohnTitor: This is blocking [updating `libc` in the standard library](https://github.com/rust-lang/rust/pull/124560), specifically because Cargo build scripts seem to break.
The problematic PR has been reverted in https://github.com/rust-lang/libc/pull/3678.
Note that #3608 exists since 0.2.153, #3678 just fixes #3677. We still have to merge https://github.com/rust-lang/libc/pull/3609.
After wasting a day, I also found out that posix_spawnattr_init is fine in 0.2.153, but 0.2.154 causes Segmentation fault......
https://github.com/rust-lang/libc/pull/3602 should be related (note that the changes to v0.2 exist on the libc-0.2 branch).
I'm going to revert that PR as a quick fix: https://github.com/rust-lang/libc/pull/3678
+1 we're also seeing segfaults after updating libc to 0.2.154 with code [that uses posix_spawn directly](https://github.com/evmar/n2/blob/117dfc642a5c724b629dc0d4ab768278803d4395/src/process_posix.rs).
Edit: Same conclusion as in #3608
Linux [`posix_spawnattr_init`](https://github.com/bminor/glibc/blob/ea73eb5f581ef5931fd67005aa0c526ba43366c9/posix/spawnattr_init.c#L23) really is just an wrapper for memset an value of type `posix_spawnattr_t`. #3602 changed `posix_spawnattr_t` to `*mut c_void`, and that caused a buffer overflow.
```rust
unsafe {
let mut attrs = <MaybeUninit<*mut c_void>>::uninit();
let ptr = attrs.as_mut_ptr();
memset(ptr as _, 0, size_of::<libc::posix_spawnattr_t>());
}
```
On Android (with Bionic libc), `posix_spawnattr_init` calls an `calloc` that [allocates](https://github.com/aosp-mirror/platform_bionic/blob/b1f23829ee8a6fc2762ae80b350ac0638197bf4b/libc/bionic/spawn.cpp#L225)
a new `posix_spawnattr_t`. Which is valid on that target.
I propose maintainers to yank libc v0.2.154.
|
2024-05-09T14:02:03Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 3,617
|
rust-lang__libc-3617
|
[
"3611"
] |
7d7151c51285bf238d2d02dc736c64b3c6dfbcc8
|
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index ea19b71366cf8..d19c0e9dd9cea 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -37,6 +37,8 @@ pub type rusage_info_t = *mut ::c_void;
pub type vm_offset_t = ::uintptr_t;
pub type vm_size_t = ::uintptr_t;
pub type vm_address_t = vm_offset_t;
+pub type quad_t = i64;
+pub type u_quad_t = u64;
pub type posix_spawnattr_t = *mut ::c_void;
pub type posix_spawn_file_actions_t = *mut ::c_void;
@@ -1136,6 +1138,77 @@ s! {
pub tcpi_rxoutoforderbytes: u64,
pub tcpi_rxretransmitpackets: u64,
}
+
+ pub struct in6_addrlifetime {
+ pub ia6t_expire: time_t,
+ pub ia6t_preferred: time_t,
+ pub ia6t_vltime: u32,
+ pub ia6t_pltime: u32,
+ }
+
+ pub struct in6_ifstat {
+ pub ifs6_in_receive: ::u_quad_t,
+ pub ifs6_in_hdrerr: ::u_quad_t,
+ pub ifs6_in_toobig: ::u_quad_t,
+ pub ifs6_in_noroute: ::u_quad_t,
+ pub ifs6_in_addrerr: ::u_quad_t,
+ pub ifs6_in_protounknown: ::u_quad_t,
+ pub ifs6_in_truncated: ::u_quad_t,
+ pub ifs6_in_discard: ::u_quad_t,
+ pub ifs6_in_deliver: ::u_quad_t,
+ pub ifs6_out_forward: ::u_quad_t,
+ pub ifs6_out_request: ::u_quad_t,
+ pub ifs6_out_discard: ::u_quad_t,
+ pub ifs6_out_fragok: ::u_quad_t,
+ pub ifs6_out_fragfail: ::u_quad_t,
+ pub ifs6_out_fragcreat: ::u_quad_t,
+ pub ifs6_reass_reqd: ::u_quad_t,
+ pub ifs6_reass_ok: ::u_quad_t,
+ pub ifs6_atmfrag_rcvd: ::u_quad_t,
+ pub ifs6_reass_fail: ::u_quad_t,
+ pub ifs6_in_mcast: ::u_quad_t,
+ pub ifs6_out_mcast: ::u_quad_t,
+ pub ifs6_cantfoward_icmp6: ::u_quad_t,
+ pub ifs6_addr_expiry_cnt: ::u_quad_t,
+ pub ifs6_pfx_expiry_cnt: ::u_quad_t,
+ pub ifs6_defrtr_expiry_cnt: ::u_quad_t,
+ }
+ pub struct icmp6_ifstat {
+ pub ifs6_in_msg: ::u_quad_t,
+ pub ifs6_in_error: ::u_quad_t,
+ pub ifs6_in_dstunreach: ::u_quad_t,
+ pub ifs6_in_adminprohib: ::u_quad_t,
+ pub ifs6_in_timeexceed: ::u_quad_t,
+ pub ifs6_in_paramprob: ::u_quad_t,
+ pub ifs6_in_pkttoobig: ::u_quad_t,
+ pub ifs6_in_echo: ::u_quad_t,
+ pub ifs6_in_echoreply: ::u_quad_t,
+ pub ifs6_in_routersolicit: ::u_quad_t,
+ pub ifs6_in_routeradvert: ::u_quad_t,
+ pub ifs6_in_neighborsolicit: ::u_quad_t,
+ pub ifs6_in_neighboradvert: ::u_quad_t,
+ pub ifs6_in_redirect: ::u_quad_t,
+ pub ifs6_in_mldquery: ::u_quad_t,
+ pub ifs6_in_mldreport: ::u_quad_t,
+ pub ifs6_in_mlddone: ::u_quad_t,
+ pub ifs6_out_msg: ::u_quad_t,
+ pub ifs6_out_error: ::u_quad_t,
+ pub ifs6_out_dstunreach: ::u_quad_t,
+ pub ifs6_out_adminprohib: ::u_quad_t,
+ pub ifs6_out_timeexceed: ::u_quad_t,
+ pub ifs6_out_paramprob: ::u_quad_t,
+ pub ifs6_out_pkttoobig: ::u_quad_t,
+ pub ifs6_out_echo: ::u_quad_t,
+ pub ifs6_out_echoreply: ::u_quad_t,
+ pub ifs6_out_routersolicit: ::u_quad_t,
+ pub ifs6_out_routeradvert: ::u_quad_t,
+ pub ifs6_out_neighborsolicit: ::u_quad_t,
+ pub ifs6_out_neighboradvert: ::u_quad_t,
+ pub ifs6_out_redirect: ::u_quad_t,
+ pub ifs6_out_mldquery: ::u_quad_t,
+ pub ifs6_out_mldreport: ::u_quad_t,
+ pub ifs6_out_mlddone: ::u_quad_t,
+ }
}
s_no_extra_traits! {
@@ -1473,6 +1546,25 @@ s_no_extra_traits! {
pub ifcu_buf: *mut ::c_char,
pub ifcu_req: *mut ifreq,
}
+
+ pub union __c_anonymous_ifr_ifru6 {
+ pub ifru_addr: ::sockaddr_in6,
+ pub ifru_dstaddr: ::sockaddr_in6,
+ pub ifru_flags: ::c_int,
+ pub ifru_flags6: ::c_int,
+ pub ifru_metrics: ::c_int,
+ pub ifru_intval: ::c_int,
+ pub ifru_data: *mut ::c_char,
+ pub ifru_lifetime: in6_addrlifetime,
+ pub ifru_stat: in6_ifstat,
+ pub ifru_icmp6stat: icmp6_ifstat,
+ pub ifru_scope_id: [u32; SCOPE6_ID_MAX],
+ }
+
+ pub struct in6_ifreq {
+ pub ifr_name: [::c_char; ::IFNAMSIZ],
+ pub ifr_ifru: __c_anonymous_ifr_ifru6,
+ }
}
impl siginfo_t {
@@ -3021,6 +3113,74 @@ cfg_if! {
unsafe { self.ifcu_req.hash(state) };
}
}
+
+ impl PartialEq for __c_anonymous_ifr_ifru6 {
+ fn eq(&self, other: &__c_anonymous_ifr_ifru6) -> bool {
+ unsafe {
+ self.ifru_addr == other.ifru_addr
+ && self.ifru_dstaddr == other.ifru_dstaddr
+ && self.ifru_flags == other.ifru_flags
+ && self.ifru_flags6 == other.ifru_flags6
+ && self.ifru_metrics == other.ifru_metrics
+ && self.ifru_intval == other.ifru_intval
+ && self.ifru_data == other.ifru_data
+ && self.ifru_scope_id
+ .iter()
+ .zip(other.ifru_scope_id.iter())
+ .all(|(a,b)| a == b)
+ }
+ }
+ }
+
+ impl Eq for __c_anonymous_ifr_ifru6 {}
+
+ impl ::fmt::Debug for __c_anonymous_ifr_ifru6 {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("__c_anonymous_ifr_ifru6")
+ .field("ifru_addr", unsafe { &self.ifru_addr })
+ .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
+ .field("ifru_flags", unsafe { &self.ifru_flags })
+ .field("ifru_flags6", unsafe { &self.ifru_flags6 })
+ .field("ifru_metrics", unsafe { &self.ifru_metrics })
+ .field("ifru_intval", unsafe { &self.ifru_intval })
+ .field("ifru_data", unsafe { &self.ifru_data })
+ .field("ifru_scope_id", unsafe { &self.ifru_scope_id })
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for __c_anonymous_ifr_ifru6 {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ unsafe {
+ self.ifru_addr.hash(state);
+ self.ifru_dstaddr.hash(state);
+ self.ifru_flags.hash(state);
+ self.ifru_flags6.hash(state);
+ self.ifru_metrics.hash(state);
+ self.ifru_intval.hash(state);
+ self.ifru_data.hash(state);
+ self.ifru_scope_id.hash(state);
+ }
+ }
+ }
+
+ impl PartialEq for in6_ifreq {
+ fn eq(&self, other: &in6_ifreq) -> bool {
+ self.ifr_name == other.ifr_name
+ && self.ifr_ifru == other.ifr_ifru
+ }
+ }
+
+ impl Eq for in6_ifreq {}
+
+ impl ::fmt::Debug for in6_ifreq {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("in6_ifreq")
+ .field("ifr_name", &self.ifr_name)
+ .field("ifr_ifru", &self.ifr_ifru)
+ .finish()
+ }
+ }
}
}
@@ -4085,6 +4245,8 @@ pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
+pub const SCOPE6_ID_MAX: ::size_t = 16;
+
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
pub const SHUT_RDWR: ::c_int = 2;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 29636554bd5e3..126fd3bd763bc 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -213,6 +213,7 @@ fn test_apple(target: &str) {
"netinet/ip.h",
"netinet/tcp.h",
"netinet/udp.h",
+ "netinet6/in6_var.h",
"os/lock.h",
"os/signpost.h",
"poll.h",
@@ -351,6 +352,7 @@ fn test_apple(target: &str) {
// MAXPATHLEN is too big for auto-derive traits on arrays.
("vnode_info_path", "vip_path") => true,
("ifreq", "ifr_ifru") => true,
+ ("in6_ifreq", "ifr_ifru") => true,
("ifkpi", "ifk_data") => true,
("ifconf", "ifc_ifcu") => true,
_ => false,
diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt
index bd076264a1212..b4e91dd083463 100644
--- a/libc-test/semver/apple.txt
+++ b/libc-test/semver/apple.txt
@@ -1861,6 +1861,7 @@ getxattr
glob
glob_t
globfree
+icmp6_ifstat
iconv_t
id_t
idtype_t
@@ -1874,6 +1875,9 @@ ifkpi
ifreq
image_offset
in6_pktinfo
+in6_addrlifetime
+in6_ifreq
+in6_ifstat
in_pktinfo
initgroups
integer_t
@@ -2157,6 +2161,7 @@ timeval32
timex
truncate
ttyname_r
+u_quad_t
ucontext_t
unmount
useconds_t
|
Why in6_ifreq does not exist on macOS
<!--
Please provide the below information:
* the target triple
* link to the documentation of the API showing the type signatures, how to use
it, etc.
In general, just please consider that the people who can help you are all very
busy, they will be helping you in their free time, there are a lot of people in
need of help so they need to prioritize to which issues they devote their free
time, etc. So try to give most of the information upfront, be concise, show
small self-contained examples (nobody has time to create a new cargo project,
set up dependencies,...), etc. Help us help you.
-->
https://github.com/apple-oss-distributions/xnu/blob/main/bsd/netinet6/in6_var.h
It seems that all related ipv6 structures in this header file do not exist
|
2024-03-10T23:14:34Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,604
|
rust-lang__libc-3604
|
[
"3598"
] |
6f47f51387d88d8f394d2a4ca9f1d1bbe1f9d91c
|
diff --git a/src/unix/linux_like/android/b32/mod.rs b/src/unix/linux_like/android/b32/mod.rs
index 1f4f796f2a94a..aa29267f9db50 100644
--- a/src/unix/linux_like/android/b32/mod.rs
+++ b/src/unix/linux_like/android/b32/mod.rs
@@ -9,6 +9,7 @@ pub type sigset_t = ::c_ulong;
pub type socklen_t = i32;
pub type time64_t = i64;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
s! {
pub struct sigaction {
diff --git a/src/unix/linux_like/android/b64/aarch64/mod.rs b/src/unix/linux_like/android/b64/aarch64/mod.rs
index 1deb3586d8cef..46cde40ae4c73 100644
--- a/src/unix/linux_like/android/b64/aarch64/mod.rs
+++ b/src/unix/linux_like/android/b64/aarch64/mod.rs
@@ -1,6 +1,7 @@
pub type c_char = u8;
pub type wchar_t = u32;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
s! {
pub struct stat {
diff --git a/src/unix/linux_like/android/b64/riscv64/mod.rs b/src/unix/linux_like/android/b64/riscv64/mod.rs
index 5142b3d4fca44..405b9ac005439 100644
--- a/src/unix/linux_like/android/b64/riscv64/mod.rs
+++ b/src/unix/linux_like/android/b64/riscv64/mod.rs
@@ -2,6 +2,7 @@ pub type c_char = i8;
pub type wchar_t = u32;
pub type greg_t = i64;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
s! {
pub struct stat {
diff --git a/src/unix/linux_like/android/b64/x86_64/mod.rs b/src/unix/linux_like/android/b64/x86_64/mod.rs
index ee12fa7cc1ca3..9062e2feea701 100644
--- a/src/unix/linux_like/android/b64/x86_64/mod.rs
+++ b/src/unix/linux_like/android/b64/x86_64/mod.rs
@@ -2,6 +2,7 @@ pub type c_char = i8;
pub type wchar_t = i32;
pub type greg_t = i64;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
s! {
pub struct stat {
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index 31f84c106a590..ef8c2ccaa4fde 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -510,8 +510,40 @@ s! {
pub ifr6_addr: ::in6_addr,
pub ifr6_prefixlen: u32,
pub ifr6_ifindex: ::c_int,
- }
+ }
+
+ pub struct statx {
+ pub stx_mask: ::__u32,
+ pub stx_blksize: ::__u32,
+ pub stx_attributes: ::__u64,
+ pub stx_nlink: ::__u32,
+ pub stx_uid: ::__u32,
+ pub stx_gid: ::__u32,
+ pub stx_mode: ::__u16,
+ __statx_pad1: [::__u16; 1],
+ pub stx_ino: ::__u64,
+ pub stx_size: ::__u64,
+ pub stx_blocks: ::__u64,
+ pub stx_attributes_mask: ::__u64,
+ pub stx_atime: ::statx_timestamp,
+ pub stx_btime: ::statx_timestamp,
+ pub stx_ctime: ::statx_timestamp,
+ pub stx_mtime: ::statx_timestamp,
+ pub stx_rdev_major: ::__u32,
+ pub stx_rdev_minor: ::__u32,
+ pub stx_dev_major: ::__u32,
+ pub stx_dev_minor: ::__u32,
+ pub stx_mnt_id: ::__u64,
+ pub stx_dio_mem_align: ::__u32,
+ pub stx_dio_offset_align: ::__u32,
+ __statx_pad3: [::__u64; 12],
+ }
+ pub struct statx_timestamp {
+ pub tv_sec: ::__s64,
+ pub tv_nsec: ::__u32,
+ pub __reserved: ::__s32,
+ }
}
s_no_extra_traits! {
@@ -4014,6 +4046,22 @@ extern "C" {
) -> ::size_t;
pub fn fflush_unlocked(stream: *mut ::FILE) -> ::c_int;
pub fn fgets_unlocked(buf: *mut ::c_char, size: ::c_int, stream: *mut ::FILE) -> *mut ::c_char;
+
+ pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
+ pub fn renameat2(
+ olddirfd: ::c_int,
+ oldpath: *const ::c_char,
+ newdirfd: ::c_int,
+ newpath: *const ::c_char,
+ flags: ::c_uint,
+ ) -> ::c_int;
+ pub fn statx(
+ dirfd: ::c_int,
+ pathname: *const c_char,
+ flags: ::c_int,
+ mask: ::c_uint,
+ statxbuf: *mut statx,
+ ) -> ::c_int;
}
cfg_if! {
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 1a72e195f23c4..7b3aa70a406d9 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -1913,7 +1913,7 @@ fn test_android(target: &str) {
"__system_property_wait" => true,
// Added in API level 30, but tests use level 28.
- "mlock2" => true,
+ "memfd_create" | "mlock2" | "renameat2" | "statx" | "statx_timestamp" => true,
// Added in glibc 2.25.
"getentropy" => true,
diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt
index 1a5321d4b486a..9fb550325d511 100644
--- a/libc-test/semver/android.txt
+++ b/libc-test/semver/android.txt
@@ -3370,6 +3370,7 @@ memalign
memchr
memcmp
memcpy
+memfd_create
memmem
memmove
memrchr
@@ -3385,6 +3386,7 @@ mknodat
mkstemp
mktime
mlock
+mlock2
mlockall
mmap
mmap64
@@ -3574,6 +3576,7 @@ remove
removexattr
rename
renameat
+renameat2
res_init
rewind
rewinddir
@@ -3698,6 +3701,8 @@ statfs
statfs64
statvfs
statvfs64
+statx
+statx_timestamp
strcasecmp
strcasestr
strcat
|
memfd_create on android api level 30 and above
<!--
Please provide the below information:
* the target triple
* link to the documentation of the API showing the type signatures, how to use
it, etc.
In general, just please consider that the people who can help you are all very
busy, they will be helping you in their free time, there are a lot of people in
need of help so they need to prioritize to which issues they devote their free
time, etc. So try to give most of the information upfront, be concise, show
small self-contained examples (nobody has time to create a new cargo project,
set up dependencies,...), etc. Help us help you.
-->
Looks like this function is now available in android libc for api level 30 and above. check the bionic libc status [docs](https://android.googlesource.com/platform/bionic/+/master/docs/status.md). There are few other functions listed there too but this is the only one I tested by building a rust program against the latest ndk(r26c).
prototype is
```
pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
```
|
2024-02-29T20:06:40Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,583
|
rust-lang__libc-3583
|
[
"3577"
] |
3d0b15bbcc21d13219124cd74e2ff2d652f2f392
|
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index eea0fed6a08b5..125a4129ef61f 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -27,6 +27,8 @@ pub type Elf32_Half = u16;
pub type Elf32_Word = u32;
pub type Elf32_Off = u32;
pub type Elf32_Addr = u32;
+pub type Elf32_Xword = u64;
+pub type Elf32_Sword = i32;
pub type Elf64_Half = u16;
pub type Elf64_Word = u32;
@@ -34,10 +36,23 @@ pub type Elf64_Off = u64;
pub type Elf64_Addr = u64;
pub type Elf64_Xword = u64;
pub type Elf64_Sxword = i64;
+pub type Elf64_Sword = i32;
pub type Elf32_Section = u16;
pub type Elf64_Section = u16;
+pub type Elf32_Relr = Elf32_Word;
+pub type Elf64_Relr = Elf32_Xword;
+pub type Elf32_Rel = __c_anonymous_elf32_rel;
+pub type Elf64_Rel = __c_anonymous_elf64_rel;
+
+cfg_if! {
+ if #[cfg(not(target_arch = "sparc64"))] {
+ pub type Elf32_Rela = __c_anonymous_elf32_rela;
+ pub type Elf64_Rela = __c_anonymous_elf64_rela;
+ }
+}
+
// linux/can.h
pub type canid_t = u32;
@@ -564,6 +579,16 @@ s! {
pub sh_entsize: Elf64_Xword,
}
+ pub struct __c_anonymous_elf32_rel {
+ pub r_offset: Elf32_Addr,
+ pub r_info: Elf32_Word,
+ }
+
+ pub struct __c_anonymous_elf64_rel {
+ pub r_offset: Elf64_Addr,
+ pub r_info: Elf64_Xword,
+ }
+
pub struct ucred {
pub pid: ::pid_t,
pub uid: ::uid_t,
@@ -1014,6 +1039,17 @@ cfg_if! {
pub src_addr: ::sockaddr,
pub tsc: [__u8; IW_ENCODE_SEQ_MAX_SIZE],
}
+ pub struct __c_anonymous_elf32_rela {
+ pub r_offset: Elf32_Addr,
+ pub r_info: Elf32_Word,
+ pub r_addend: Elf32_Sword,
+ }
+
+ pub struct __c_anonymous_elf64_rela {
+ pub r_offset: Elf64_Addr,
+ pub r_info: Elf64_Xword,
+ pub r_addend: Elf64_Sxword,
+ }
}
}
}
@@ -5214,6 +5250,30 @@ f! {
pub fn BPF_JUMP(code: ::__u16, k: ::__u32, jt: ::__u8, jf: ::__u8) -> sock_filter {
sock_filter{code: code, jt: jt, jf: jf, k: k}
}
+
+ pub fn ELF32_R_SYM(val: Elf32_Word) -> Elf32_Word {
+ val >> 8
+ }
+
+ pub fn ELF32_R_TYPE(val: Elf32_Word) -> Elf32_Word {
+ val & 0xff
+ }
+
+ pub fn ELF32_R_INFO(sym: Elf32_Word, t: Elf32_Word) -> Elf32_Word {
+ sym << 8 + t & 0xff
+ }
+
+ pub fn ELF64_R_SYM(val: Elf64_Xword) -> Elf64_Xword {
+ val >> 32
+ }
+
+ pub fn ELF64_R_TYPE(val: Elf64_Xword) -> Elf64_Xword {
+ val & 0xffffffff
+ }
+
+ pub fn ELF64_R_INFO(sym: Elf64_Xword, t: Elf64_Xword) -> Elf64_Xword {
+ sym << 32 + t
+ }
}
safe_f! {
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 7d3dfb88e1221..33c9dd59cf911 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -3532,6 +3532,13 @@ fn test_linux(target: &str) {
});
cfg.skip_type(move |ty| {
+ // FIXME: very recent additions to musl, not yet released.
+ if musl && (ty == "Elf32_Relr" || ty == "Elf64_Relr") {
+ return true;
+ }
+ if sparc64 && (ty == "Elf32_Rela" || ty == "Elf64_Rela") {
+ return true;
+ }
match ty {
// FIXME: `sighandler_t` type is incorrect, see:
// https://github.com/rust-lang/libc/issues/1359
diff --git a/libc-test/semver/linux-aarch64.txt b/libc-test/semver/linux-aarch64.txt
index a4ab1b2e568e0..6c92db32d8104 100644
--- a/libc-test/semver/linux-aarch64.txt
+++ b/libc-test/semver/linux-aarch64.txt
@@ -38,6 +38,8 @@ BPF_W
BPF_X
BPF_XOR
CIBAUD
+Elf32_Rela
+Elf64_Rela
FICLONE
FICLONERANGE
MADV_SOFT_OFFLINE
diff --git a/libc-test/semver/linux-i686.txt b/libc-test/semver/linux-i686.txt
index a14498adc8396..aa379e1dcec62 100644
--- a/libc-test/semver/linux-i686.txt
+++ b/libc-test/semver/linux-i686.txt
@@ -13,6 +13,8 @@ EDI
EDX
EFL
EIP
+Elf32_Rela
+Elf64_Rela
ES
ESI
FS
diff --git a/libc-test/semver/linux-powerpc64.txt b/libc-test/semver/linux-powerpc64.txt
index 99be508e6bd59..77718d9ce47f0 100644
--- a/libc-test/semver/linux-powerpc64.txt
+++ b/libc-test/semver/linux-powerpc64.txt
@@ -2,6 +2,8 @@ B2500000
B3000000
B3500000
B4000000
+Elf32_Rela
+Elf64_Rela
KEYCTL_CAPABILITIES
KEYCTL_CAPS0_BIG_KEY
KEYCTL_CAPS0_CAPABILITIES
diff --git a/libc-test/semver/linux-riscv64gc.txt b/libc-test/semver/linux-riscv64gc.txt
index b4d07fcbab7fd..e4e547571aa4d 100644
--- a/libc-test/semver/linux-riscv64gc.txt
+++ b/libc-test/semver/linux-riscv64gc.txt
@@ -3,6 +3,8 @@ B3000000
B3500000
B4000000
CIBAUD
+Elf32_Rela
+Elf64_Rela
KEYCTL_CAPABILITIES
KEYCTL_CAPS0_BIG_KEY
KEYCTL_CAPS0_CAPABILITIES
diff --git a/libc-test/semver/linux-x86_64.txt b/libc-test/semver/linux-x86_64.txt
index 6ad111e7308cc..8ae1037764e84 100644
--- a/libc-test/semver/linux-x86_64.txt
+++ b/libc-test/semver/linux-x86_64.txt
@@ -40,6 +40,8 @@ BPF_XOR
CIBAUD
CS
DS
+Elf32_Rela
+Elf64_Rela
ES
FS
GS
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index 38db9aaf3ca58..9deef2a074fa5 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -415,8 +415,14 @@ EKEYREJECTED
EKEYREVOKED
EL2HLT
EL2NSYNC
+ELF32_R_SYM
+ELF32_R_TYPE
+ELF32_R_INFO
EL3HLT
EL3RST
+ELF64_R_SYM
+ELF64_R_TYPE
+ELF64_R_INFO
ELFCLASS32
ELFCLASS64
ELFCLASSNONE
@@ -694,17 +700,24 @@ Elf32_Ehdr
Elf32_Half
Elf32_Off
Elf32_Phdr
+Elf32_Rel
+Elf32_Relr
Elf32_Section
Elf32_Shdr
Elf32_Sym
+Elf32_Sword
Elf32_Word
+Elf32_Xword
Elf64_Addr
Elf64_Ehdr
Elf64_Half
Elf64_Off
Elf64_Phdr
+Elf64_Rel
+Elf64_Relr
Elf64_Section
Elf64_Shdr
+Elf64_Sword
Elf64_Sxword
Elf64_Sym
Elf64_Word
|
Missing Elf64_Rela type
<!--
Please provide the below information:
* the target triple
* link to the documentation of the API showing the type signatures, how to use
it, etc.
In general, just please consider that the people who can help you are all very
busy, they will be helping you in their free time, there are a lot of people in
need of help so they need to prioritize to which issues they devote their free
time, etc. So try to give most of the information upfront, be concise, show
small self-contained examples (nobody has time to create a new cargo project,
set up dependencies,...), etc. Help us help you.
-->
Target triple: x86_64-pc-linux-gnu
It seems that Elf64_Rela from elf.h is unimplemented, where many other Elf64_* structures are. Is there a particular reason for this?
|
2024-02-13T19:53:29Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,526
|
rust-lang__libc-3526
|
[
"3097"
] |
b55a097c9354b043df6c5e93ceb11491f479ed3f
|
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index 2e7827231e65f..d4d39b9419ece 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -6492,22 +6492,6 @@ cfg_if! {
}
}
-// These require a dependency on `libiconv`, and including this when built as
-// part of `std` means every Rust program gets it. Ideally we would have a link
-// modifier to only include these if they are used, but we do not.
-#[cfg_attr(not(feature = "rustc-dep-of-std"), link(name = "iconv"))]
-extern "C" {
- pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
- pub fn iconv(
- cd: iconv_t,
- inbuf: *mut *mut ::c_char,
- inbytesleft: *mut ::size_t,
- outbuf: *mut *mut ::c_char,
- outbytesleft: *mut ::size_t,
- ) -> ::size_t;
- pub fn iconv_close(cd: iconv_t) -> ::c_int;
-}
-
cfg_if! {
if #[cfg(target_pointer_width = "32")] {
mod b32;
|
diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt
index ce9c6097bbb88..e33b84e746769 100644
--- a/libc-test/semver/apple.txt
+++ b/libc-test/semver/apple.txt
@@ -1951,9 +1951,6 @@ getxattr
glob
glob_t
globfree
-iconv
-iconv_close
-iconv_open
iconv_t
id_t
idtype_t
|
Hide `iconv` functions on Apple devices behind a feature flag
See #2870 and #2944 for context. I believe the comment in the code explains the changes well enough, but if you'd like me to add a description to the commit as well (or adjust any wording etc.), let me know.
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) soon.
Please see [the contribution instructions](https://github.com/rust-lang/libc/blob/master/CONTRIBUTING.md) for more information.
What would be the best path forward for `libc-test`? Should I just add the `apple-iconv` to its dependency on `libc`, or do something more complex?
Uhm, I hesitate to add a platform feature flag as we support a lot of platforms and the flag management can be complex easily 😱(we've done a similar thing to Rust versions and it introduces a ton of complexity, huh).
Perhaps we should have asked that those functions be separated into a platform-specific crate rather than added to the libc crate.
@rust-lang/crate-maintainers Any thoughts on this?
(By the way, this is a breaking change and I'd like to ship it in a major release.)
I still don't understand what the problem is with linking against `iconv` on apple targets. This library is guaranteed to always be present, so it shouldn't cause any issues?
@Amanieu See @thomcc's excellent comment [here](https://github.com/rust-lang/libc/issues/2870#issuecomment-1271104762) for some info.
:+1: for just dropping these functions entirely in a subsequent major release, if we ever make a major release.
@JohnTitor @joshtriplett Do you think there's any chance of a major release happening within, say, a few months? A year? Just curious, I appreciate your insights, thanks! 😊
We're going to make a major change to musl in https://github.com/rust-lang/libc/pull/3068 and I guess we could publish this along with that PR. It will be merged once [FCP](https://github.com/rust-lang/libc/pull/3068#issuecomment-1381151618) passes.
I cannot tell the exact date and time for that, as it requires agreement by team members, but it could happen within a few months (hopefully).
> See @thomcc's excellent comment
That was about `libstd`'s usage. I'd don't love that we link to it in `libc`, but there are reasons I haven't pursued this.
> I still don't understand what the problem is with linking against `iconv` on apple targets. This library is guaranteed to always be present, so it shouldn't cause any issues?
It's mostly compelling since it's practically unused[^2], and linking with it means it must be available on the host, which breaks some minimalist (or perhaps naïve) cross-compilation setups, where a full SDK is not available, but a linker and a libSystem stub are (for example, this is the case with `zig`'s cross compilation support, unless you bring along the `.tbd` files you need). IOW, the library is guaranteed to be present on the target, but not on the host, and it is needed in both places (as linking a mach-o requires the linker know which dylib provides each symbol).
Concretely, this probably is one of the first things hit by folks who try to cross compile rust to macOS by using `zig {cc,ld}` directly. I'm unsure how reasonable it is to expect cross compilation to work in such cases, and users will probably hit something after this anyway, and are likely better off with something like `cargo-zigbuild` anyway, which shaves off these kinds of sharp edges (it [bundles](https://github.com/rust-cross/cargo-zigbuild/blob/0b7a8ee3acd9a11adc55d654eb44fc18f13901be/src/macos/libiconv.tbd) `libiconv.tbd` for this reason).
---
In any case, I don't think we should removing the items (even if they're nearly unused), and I *really* don't think we should add a feature flag for this. I do think it's annoying that Rust users may have to cart around semi-vestigial `libiconv.tbd` in their cross compilation setup, even if they don't need it (but perhaps if it weren't that it might be something else[^3]). So, I have two thoughts here:
1. If we care about that kind of use case, then we should just change the PR to remove the `#[link]` attribute and deprecate the items (with a message explaining a fix). I don't know if this is technically breaking, but it seems like it unlikely to break anybody.
2. If we don't care, then we probably should wait until `raw-dylib` is supported on macOS (which sadly seems [stalled](https://github.com/rust-lang/rust/pull/100703)). At that point, we could change the attribute to `#[link(name = "iconv", kind = "raw-dylib")]`. Then (IIUC) we'll generate the tbd automatically when compiling, avoiding such problems. That said, it may be quite a while before that is available on stable.
I do think the hassle this causes in practice is not nearly worth it given how few people (if any) depend on it, but I also think libc should not make the breaking API changes it does (altho I'm unsure how much the `link` removal would count...). So I don't know.
[^2]: [virtually nobody on github](https://cs.github.com/?scopeName=All+repos&scope=&q=libc%3A%3Aiconv+language%3Arust) use libc's declarations, and a large amount of the code that does want to call `iconv` seems to [explicitly link anyway](https://cs.github.com/?scopeName=All+repos&scope=&q=%2Fname%5Cs*%3D%5Cs*%22iconv%22%2F+language%3Arust). Of course, neither of those searches are absolute proof of anything, but it's a ballpark idea of usage.
[^3]: IOW, perhaps it's better that cross compilation does not work out of the box. I don't think we want to make any guarantees that it will (even in `std`), nor do we want the bug reports that could come if it worked and then we began linking to another system library.
That's insightful, thank you!
> 1. If we care about that kind of use case, then we should just change the PR to remove the `#[link]` attribute and deprecate the items (with a message explaining a fix).
Do you mean we should deprecate items first and then remove them? If so, how about deprecating on 0.2.x and removing on 0.3.x (along with time64 change)?
Given that it seems much more likely that we will be pushing out a 0.3 release sometime "soon" (highly relatively speaking): Yeah, we should probably instead do a deprecation and `doc(hidden)`.
|
2024-01-07T19:37:07Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 3,489
|
rust-lang__libc-3489
|
[
"1592"
] |
bb4eae618a73787c6208dd7c714ea0505f1195d0
|
diff --git a/.github/workflows/bors.yml b/.github/workflows/bors.yml
index 77f236c033e07..6ecf7c83ffe74 100644
--- a/.github/workflows/bors.yml
+++ b/.github/workflows/bors.yml
@@ -73,12 +73,10 @@ jobs:
ARCH_BITS: 64
ARCH: x86_64
- target: x86_64-pc-windows-msvc
- # Disabled because broken:
- # https://github.com/rust-lang/libc/issues/1592
- #- target: i686-pc-windows-gnu
- # env:
- # ARCH_BITS: 32
- # ARCH: i686
+ - target: i686-pc-windows-gnu
+ env:
+ ARCH_BITS: 32
+ ARCH: i686
- target: i686-pc-windows-msvc
steps:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index eaf4ffec2ad3c..c7784fc117df9 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -58,12 +58,10 @@ jobs:
ARCH_BITS: 64
ARCH: x86_64
- target: x86_64-pc-windows-msvc
- # Disabled because broken:
- # https://github.com/rust-lang/libc/issues/1592
- #- target: i686-pc-windows-gnu
- # env:
- # ARCH_BITS: 32
- # ARCH: i686
+ - target: i686-pc-windows-gnu
+ env:
+ ARCH_BITS: 32
+ ARCH: i686
- target: i686-pc-windows-msvc
steps:
- uses: actions/checkout@v4
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 3b50438c6c672..7f4778ee1f113 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -618,6 +618,7 @@ fn test_openbsd(target: &str) {
fn test_windows(target: &str) {
assert!(target.contains("windows"));
let gnu = target.contains("gnu");
+ let i686 = target.contains("i686");
let mut cfg = ctest_cfg();
if target.contains("msvc") {
@@ -684,6 +685,8 @@ fn test_windows(target: &str) {
cfg.skip_type(move |name| match name {
"SSIZE_T" if !gnu => true,
"ssize_t" if !gnu => true,
+ // FIXME: The size and alignment of this type are incorrect
+ "time_t" if gnu && i686 => true,
_ => false,
});
@@ -691,7 +694,11 @@ fn test_windows(target: &str) {
if ty.starts_with("__c_anonymous_") {
return true;
}
- return false;
+ match ty {
+ // FIXME: The size and alignment of this struct are incorrect
+ "timespec" if gnu && i686 => true,
+ _ => false,
+ }
});
cfg.skip_const(move |name| {
|
i686-pc-windows-gnu broken on CI
The i686-pc-windows-gnu target has been disabled on CI because it fails with the following segmentation fault:
```
error: test failed, to rerun pass '--test main'
Caused by:
process didn't exit successfully: `D:\a\1\s\target\i686-pc-windows-gnu\debug\deps\main-65866843958a68e7.exe` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)
./ci/run.sh: line 93: 1846 Segmentation fault cargo test -vv $opt --no-default-features --manifest-path libc-test/Cargo.toml --target "${TARGET}"
```
For example, see: https://dev.azure.com/rust-lang2/libc/_build/results?buildId=608
This issue tracks re-enabling CI for this target. Even though this is a tier-1 target, it has been broken for a sufficiently long time that new releases of libc won't be tested against it, and probably rust-lang/rust libc version will be updated to one of those sooner or later. Without a debugger, there is not much I can do here.
cc @mati865 @retep998 (feel free to ping windows users that might be able to investigate)
|
<del>Latest nightly has fix for i686 miscompilation: https://github.com/rust-lang/rust/pull/66318
Can you retry the build?</del>
It doesn't help.
Hopefully useful:
```
(lldb) r
Process 11012 launched: 'D:\msys64\tmp\libc\target\i686-pc-windows-gnu\debug\deps\main-fc7d8e49f1073eac.exe' (i686)
RUNNING ALL TESTS
Process 11012 stopped
* thread #1, stop reason = Exception 0xc0000005 encountered at address 0x4adab0: Access violation writing location 0x2ef71bd1
frame #0: 0x004adab0 main-fc7d8e49f1073eac.exe`__test_roundtrip_max_align_t(value=max_align_t @ 0x009bfa90, rust_size=1996201872, error=0x2ef71bd1, pad="") at main.c:4583:28
4580 "size of max_align_t is %d in C and %d in Rust\n",
4581 (int)size, (int)rust_size
4582 );
-> 4583 *error = 1;
^
4584 return value;
4585 }
4586 int i = 0;
(lldb) bt
(lldb) bt
* thread #1, stop reason = Exception 0xc0000005 encountered at address 0x4adab0: Access violation writing location 0x2ef71bd1
* frame #0: 0x004adab0 main-fc7d8e49f1073eac.exe`__test_roundtrip_max_align_t
(value=max_align_t @ 0x009bfa90, rust_size=1996201872, error=0x2ef71bd1, pad="") at main.c:4583:28
frame #1: 0x00437768 main-fc7d8e49f1073eac.exe`main::roundtrip_max_align_t::h65d307f4f71a6fd7 at main.rs:10705:30
frame #2: 0x00438309 main-fc7d8e49f1073eac.exe`main::run_all::h3dd94fce5ecf1967 at main.rs:11128:1
frame #3: 0x0040726b main-fc7d8e49f1073eac.exe`main::main::hdad19dffed1e8e93 at main.rs:10:17
frame #4: 0x00401709 main-fc7d8e49f1073eac.exe`std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h88bbd130d597fbb4 at rt.rs:67:34
frame #5: 0x0045bb17 main-fc7d8e49f1073eac.exe`std::sys_common::backtrace::__rust_begin_short_backtrace::ha765656654808a54 [inlined] std::rt::lang_start_internal::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h1cb0c3cf3d0f3b7b at rt.rs:52:73
frame #6: 0x0045bb13 main-fc7d8e49f1073eac.exe`std::sys_common::backtrace::__rust_begin_short_backtrace::ha765656654808a54 at backtrace.rs:130
frame #7: 0x0045f459 main-fc7d8e49f1073eac.exe`std::rt::lang_start_internal::h848f63bc4d320e91 [inlined] std::rt::lang_start_internal::_$u7b$$u7b$closure$u7d$$u7d$::h99b24a7dbe4a88ad at rt.rs:52:13
frame #8: 0x0045f450 main-fc7d8e49f1073eac.exe`std::rt::lang_start_internal::h848f63bc4d320e91 [inlined] std::panicking::try::do_call::hf91bc4678426bdd4 at panicking.rs:331
frame #9: 0x0045f450 main-fc7d8e49f1073eac.exe`std::rt::lang_start_internal::h848f63bc4d320e91 [inlined] std::panicking::try::hee89baf923f68bc0 at panicking.rs:274
frame #10: 0x0045f450 main-fc7d8e49f1073eac.exe`std::rt::lang_start_internal::h848f63bc4d320e91 [inlined] std::panic::catch_unwind::h64b2c4628ae51fc5 at panic.rs:394
frame #11: 0x0045f450 main-fc7d8e49f1073eac.exe`std::rt::lang_start_internal::h848f63bc4d320e91 at rt.rs:51
frame #12: 0x004016f0 main-fc7d8e49f1073eac.exe`std::rt::lang_start::h1dda6c3e8dc7faa1(main=(main-fc7d8e49f1073eac.exe`main::main::hdad19dffed1e8e93 at main.rs:8), argc=1, argv=0x01412d08) at rt.rs:67:5
frame #13: 0x00438643 main-fc7d8e49f1073eac.exe`_main + 51
frame #14: 0x00401386 main-fc7d8e49f1073eac.exe`__tmainCRTStartup at crtexe.c:339:15
frame #15: 0x74926359 kernel32.dll`BaseThreadInitThunk + 25
frame #16: 0x76fa7b74 ntdll.dll`RtlGetAppContainerNamedObjectPath + 228
frame #17: 0x76fa7b44 ntdll.dll`RtlGetAppContainerNamedObjectPath + 180
```
[main.c.txt](https://github.com/rust-lang/libc/files/4450598/main.c.txt)
When built with Clang it prints this before crash:
```
bad max_align_t size: rust: 48 (0x30) != c 24 (0x18)
bad max_align_t align: rust: 16 (0x10) != c 8 (0x8)
```
EDIT: It does *not* crash when built by Clang with max_align_t size = 24 and max_align_t align = 8
|
2023-12-19T12:42:19Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 3,486
|
rust-lang__libc-3486
|
[
"3485"
] |
05d807fa5b997ed3bf67e0519f5d60f27d6175e2
|
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index 3ee3d62667956..9af519e9077df 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -3,6 +3,7 @@ pub type __priority_which_t = ::c_uint;
pub type __rlimit_resource_t = ::c_uint;
pub type Lmid_t = ::c_long;
pub type regoff_t = ::c_int;
+pub type __kernel_rwf_t = ::c_int;
cfg_if! {
if #[cfg(doc)] {
@@ -432,6 +433,27 @@ s! {
pub len: ::__u32,
pub options: ::__u32,
}
+
+ pub struct iocb {
+ pub aio_data: ::__u64,
+ #[cfg(target_endian = "little")]
+ pub aio_key: ::__u32,
+ #[cfg(target_endian = "little")]
+ pub aio_rw_flags: ::__kernel_rwf_t,
+ #[cfg(target_endian = "big")]
+ pub aio_rw_flags: ::__kernel_rwf_t,
+ #[cfg(target_endian = "big")]
+ pub aio_key: ::__u32,
+ pub aio_lio_opcode: ::__u16,
+ pub aio_reqprio: ::__s16,
+ pub aio_fildes: ::__u32,
+ pub aio_buf: ::__u64,
+ pub aio_nbytes: ::__u64,
+ pub aio_offset: ::__s64,
+ aio_reserved2: ::__u64,
+ pub aio_flags: ::__u32,
+ pub aio_resfd: ::__u32,
+ }
}
impl siginfo_t {
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index a9d04ca81cc15..3b50438c6c672 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -3406,6 +3406,7 @@ fn test_linux(target: &str) {
headers! {
cfg:
"asm/mman.h",
+ [gnu]: "linux/aio_abi.h",
"linux/can.h",
"linux/can/raw.h",
// FIXME: requires kernel headers >= 5.4.1.
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
index 591b2447dbab7..9bbdee0771b60 100644
--- a/libc-test/semver/linux-gnu.txt
+++ b/libc-test/semver/linux-gnu.txt
@@ -638,6 +638,7 @@ glob64
glob64_t
globfree
globfree64
+iocb
lio_listio
mallinfo
mallinfo2
|
request impl the `io_submit` binding.
<!--
Please provide the below information:
* the target triple
* link to the documentation of the API showing the type signatures, how to use
it, etc.
In general, just please consider that the people who can help you are all very
busy, they will be helping you in their free time, there are a lot of people in
need of help so they need to prioritize to which issues they devote their free
time, etc. So try to give most of the information upfront, be concise, show
small self-contained examples (nobody has time to create a new cargo project,
set up dependencies,...), etc. Help us help you.
-->
There is no binding that implements this function https://man7.org/linux/man-pages/man2/io_submit.2.html
|
2023-12-18T13:45:39Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,483
|
rust-lang__libc-3483
|
[
"3459"
] |
ccdae50206ce9c64c308200c9976fd7b470e6ede
|
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index c7169a2274769..7d27777232842 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -5604,12 +5604,6 @@ extern "C" {
pub fn asctime(tm: *const ::tm) -> *mut ::c_char;
pub fn ctime(clock: *const time_t) -> *mut ::c_char;
pub fn getdate(datestr: *const ::c_char) -> *mut ::tm;
- pub fn strftime(
- buf: *mut ::c_char,
- maxsize: ::size_t,
- format: *const ::c_char,
- timeptr: *const ::tm,
- ) -> ::size_t;
pub fn strptime(
buf: *const ::c_char,
format: *const ::c_char,
diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs
index 6ce041357ebee..1dd21c7adaeb0 100644
--- a/src/unix/bsd/mod.rs
+++ b/src/unix/bsd/mod.rs
@@ -899,6 +899,20 @@ extern "C" {
longopts: *const option,
longindex: *mut ::c_int,
) -> ::c_int;
+
+ pub fn strftime(
+ buf: *mut ::c_char,
+ maxsize: ::size_t,
+ format: *const ::c_char,
+ timeptr: *const ::tm,
+ ) -> ::size_t;
+ pub fn strftime_l(
+ buf: *mut ::c_char,
+ maxsize: ::size_t,
+ format: *const ::c_char,
+ timeptr: *const ::tm,
+ locale: ::locale_t,
+ ) -> ::size_t;
}
cfg_if! {
|
diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt
index a3e2161ab9ee1..5a34303a157fc 100644
--- a/libc-test/semver/apple.txt
+++ b/libc-test/semver/apple.txt
@@ -2225,6 +2225,7 @@ statfs
strcasecmp
strcasestr
strftime
+strftime_l
strncasecmp
strndup
strptime
diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt
index b9c8e7ee6180c..c1942853289dc 100644
--- a/libc-test/semver/dragonfly.txt
+++ b/libc-test/semver/dragonfly.txt
@@ -1547,6 +1547,8 @@ stack_t
statfs
strcasecmp
strcasestr
+strftime
+strftime_l
strncasecmp
strndup
strsignal
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt
index 9f436ced22a81..914808b08af5e 100644
--- a/libc-test/semver/freebsd.txt
+++ b/libc-test/semver/freebsd.txt
@@ -2204,6 +2204,8 @@ statfs
strcasecmp
strcasestr
strchrnul
+strftime
+strftime_l
strncasecmp
strndup
strsignal
diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt
index 145f02b441cf1..e36d33224aa50 100644
--- a/libc-test/semver/netbsd.txt
+++ b/libc-test/semver/netbsd.txt
@@ -1551,6 +1551,8 @@ stack_t
strcasecmp
strcasestr
string_to_flags
+strftime
+strftime_l
strncasecmp
strndup
strpct
diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt
index 529d9f82472cf..fe3d602f54eb7 100644
--- a/libc-test/semver/openbsd.txt
+++ b/libc-test/semver/openbsd.txt
@@ -1250,6 +1250,8 @@ stack_t
statfs
strcasecmp
strcasestr
+strftime
+strftime_l
strncasecmp
strndup
strsignal
|
Missing strftime on BSDs
Target: `x86_64-unknown-dragonfly`, `x86_64-unknown-freebsd`, `x86_64-unknown-netbsd`, `x86_64-unknown-openbsd`
API: [DragonFly](https://man.dragonflybsd.org/?command=strftime§ion=3), [FreeBSD](https://man.netbsd.org/strftime.3), [NetBSD](https://man.freebsd.org/strftime/3), [OpenBSD](https://man.openbsd.org/strftime.3)
Implementation: [BSD 4.3 Reno](https://github.com/dspinellis/unix-history-repo/blob/BSD-4_3_Reno/usr/src/lib/libc/string/strftime.c) (historic), [DragonFly](https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/lib/libc/stdtime/strftime.c), [FreeBSD](https://github.com/freebsd/freebsd-src/blob/main/lib/libc/stdtime/strftime.c), [NetBSD](https://github.com/netbsd/src/blob/trunk/lib/libc/time/strftime.c), [OpenBSD](https://github.com/openbsd/src/blob/master/lib/libc/time/strftime.c)
Test case: [graf](https://github.com/shua/graf/blob/v0.1.0/src/main.rs#L86), [niri](https://github.com/YaLTeR/niri/blob/v0.1.0-alpha.1/src/utils.rs#L44), [fish-shell](https://github.com/fish-shell/fish-shell/blob/0aa08cf267fe/fish-rust/src/history.rs#L1578) (without `bsd` workaround).
|
2023-12-16T06:27:26Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,478
|
rust-lang__libc-3478
|
[
"3460"
] |
fe5fe49b7d6d62ea5e7a4170d1a602c443cd6f07
|
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index b763ab6261bb9..4e513364a1a1a 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -509,7 +509,8 @@ s! {
pub svm_reserved1: ::c_ushort,
pub svm_port: ::c_uint,
pub svm_cid: ::c_uint,
- pub svm_zero: [u8; 4]
+ pub svm_flags: u8,
+ pub svm_zero: [u8; 3]
}
pub struct regmatch_t {
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index cb28758ad507f..0a1ae705e5863 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -4237,6 +4237,8 @@ fn test_linux(target: &str) {
// Linux >= 5.11 tweaked the `svm_zero` field of the `sockaddr_vm` struct.
// https://github.com/torvalds/linux/commit/dc8eeef73b63ed8988224ba6b5ed19a615163a7f
(struct_ == "sockaddr_vm" && field == "svm_zero") ||
+ // Linux >= 5.11 had added the svm_flags field to the `sockaddr_vm` struct.
+ (struct_ == "sockaddr_vm" && field == "svm_flags") ||
// the `ifr_ifru` field is an anonymous union
(struct_ == "ifreq" && field == "ifr_ifru") ||
// the `ifc_ifcu` field is an anonymous union
|
Missing support for `sockaddr_vm`'s `svm_flags`
<!--
Please provide the below information:
* the target triple
* link to the documentation of the API showing the type signatures, how to use
it, etc.
In general, just please consider that the people who can help you are all very
busy, they will be helping you in their free time, there are a lot of people in
need of help so they need to prioritize to which issues they devote their free
time, etc. So try to give most of the information upfront, be concise, show
small self-contained examples (nobody has time to create a new cargo project,
set up dependencies,...), etc. Help us help you.
-->
`sockaddr_vm` is currently missing the `svm_flags` field. See https://lkml.org/lkml/2020/12/11/249
The structure is defined at https://github.com/rust-lang/libc/blob/b4686c6616788f890050726f5a25b7d54c97fb1b/src/unix/linux_like/linux/mod.rs#L507-L513
See also https://github.com/rust-vsock/vsock-rs/issues/29
|
2023-12-13T20:06:29Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,426
|
rust-lang__libc-3426
|
[
"3403"
] |
bbd3e20e45efe402de818256fe781121ffe3a3c3
|
diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs
index a787ac6db8553..07dc39be54e36 100644
--- a/src/unix/bsd/netbsdlike/mod.rs
+++ b/src/unix/bsd/netbsdlike/mod.rs
@@ -646,6 +646,10 @@ pub const TIOCM_RI: ::c_int = TIOCM_RNG;
pub const TIMER_ABSTIME: ::c_int = 1;
+// sys/reboot.h
+
+pub const RB_AUTOBOOT: ::c_int = 0;
+
#[link(name = "util")]
extern "C" {
pub fn setgrent();
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index c612689a53f06..45f42d74165ee 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -2434,6 +2434,20 @@ pub const GRND_NONBLOCK: ::c_uint = 0x1;
pub const GRND_RANDOM: ::c_uint = 0x2;
pub const GRND_INSECURE: ::c_uint = 0x4;
+// sys/reboot.h
+pub const RB_ASKNAME: ::c_int = 0x000000001;
+pub const RB_SINGLE: ::c_int = 0x000000002;
+pub const RB_NOSYNC: ::c_int = 0x000000004;
+pub const RB_HALT: ::c_int = 0x000000008;
+pub const RB_INITNAME: ::c_int = 0x000000010;
+pub const RB_KDB: ::c_int = 0x000000040;
+pub const RB_RDONLY: ::c_int = 0x000000080;
+pub const RB_DUMP: ::c_int = 0x000000100;
+pub const RB_MINIROOT: ::c_int = 0x000000200;
+pub const RB_STRING: ::c_int = 0x000000400;
+pub const RB_POWERDOWN: ::c_int = RB_HALT | 0x000000800;
+pub const RB_USERCONF: ::c_int = 0x000001000;
+
cfg_if! {
if #[cfg(libc_const_extern_fn)] {
@@ -2984,6 +2998,8 @@ extern "C" {
newfd: ::c_int,
) -> ::c_int;
pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
+
+ pub fn reboot(mode: ::c_int, bootstr: *mut ::c_char) -> ::c_int;
}
#[link(name = "rt")]
diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs
index ab2968091d936..17dfa6571568f 100644
--- a/src/unix/bsd/netbsdlike/openbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs
@@ -1830,6 +1830,25 @@ pub const LC_ALL_MASK: ::c_int = (1 << _LC_LAST) - 2;
pub const LC_GLOBAL_LOCALE: ::locale_t = -1isize as ::locale_t;
+// sys/reboot.h
+pub const RB_ASKNAME: ::c_int = 0x00001;
+pub const RB_SINGLE: ::c_int = 0x00002;
+pub const RB_NOSYNC: ::c_int = 0x00004;
+pub const RB_HALT: ::c_int = 0x00008;
+pub const RB_INITNAME: ::c_int = 0x00010;
+pub const RB_KDB: ::c_int = 0x00040;
+pub const RB_RDONLY: ::c_int = 0x00080;
+pub const RB_DUMP: ::c_int = 0x00100;
+pub const RB_MINIROOT: ::c_int = 0x00200;
+pub const RB_CONFIG: ::c_int = 0x00400;
+pub const RB_TIMEBAD: ::c_int = 0x00800;
+pub const RB_POWERDOWN: ::c_int = 0x01000;
+pub const RB_SERCONS: ::c_int = 0x02000;
+pub const RB_USERREQ: ::c_int = 0x04000;
+pub const RB_RESET: ::c_int = 0x08000;
+pub const RB_GOODRANDOM: ::c_int = 0x10000;
+pub const RB_UNHIBERNATE: ::c_int = 0x20000;
+
const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
(p + _ALIGNBYTES) & !_ALIGNBYTES
@@ -2057,6 +2076,8 @@ extern "C" {
) -> ::c_int;
pub fn mimmutable(addr: *mut ::c_void, len: ::size_t) -> ::c_int;
+
+ pub fn reboot(mode: ::c_int) -> ::c_int;
}
#[link(name = "execinfo")]
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 05ec059bc94c4..32867523aa883 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -518,6 +518,7 @@ fn test_openbsd(target: &str) {
"util.h",
"ufs/ufs/quota.h",
"pthread_np.h",
+ "sys/reboot.h",
"sys/syscall.h",
"sys/shm.h",
"sys/param.h",
@@ -1110,6 +1111,7 @@ fn test_netbsd(target: &str) {
"netinet/dccp.h",
"sys/event.h",
"sys/quota.h",
+ "sys/reboot.h",
"sys/shm.h",
"iconv.h",
}
diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt
index a548a2d77d057..495b56cc3611a 100644
--- a/libc-test/semver/netbsd.txt
+++ b/libc-test/semver/netbsd.txt
@@ -863,6 +863,19 @@ Q_SETQUOTA
Q_SYNC
RADIXCHAR
RAND_MAX
+RB_ASKNAME
+RB_AUTOBOOT
+RB_DUMP
+RB_HALT
+RB_INITNAME
+RB_KDB
+RB_MINIROOT
+RB_NOSYNC
+RB_POWERDOWN
+RB_RDONLY
+RB_SINGLE
+RB_STRING
+RB_USERCONF
REG_ASSERT
REG_ATOI
REG_BACKR
@@ -1466,6 +1479,7 @@ readdir_r
readlinkat
reallocarr
reallocarray
+reboot
recvmmsg
recvmsg
regcomp
diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt
index 0b11c5fdbbc7e..7843f6af10c87 100644
--- a/libc-test/semver/openbsd.txt
+++ b/libc-test/semver/openbsd.txt
@@ -704,6 +704,20 @@ Q_SETQUOTA
Q_SYNC
RADIXCHAR
RAND_MAX
+RB_ASKNAME
+RB_AUTOBOOT
+RB_CONFIG
+RB_DUMP
+RB_GOODRANDOM
+RB_HALT
+RB_KDB
+RB_INITNAME
+RB_POWERDOWN
+RB_RESET
+RB_SERCONS
+RB_TIMEBAD
+RB_UNHIBERNATE
+RB_USERREQ
REG_ASSERT
REG_ATOI
REG_BACKR
@@ -1174,6 +1188,7 @@ rand
readdir_r
readlinkat
reallocarray
+reboot
recvmsg
regcomp
regerror
|
reboot api for openbsd
on openbsd 7.4 trying to build the `nix` crate reboot feature. missing a bunch of stuff from libc. https://man.openbsd.org/reboot.2
can it be added please for amd64?
```
error[E0425]: cannot find value `RB_HALT_SYSTEM` in crate `libc`
--> /nix/src/sys/reboot.rs:17:9
|
17 | RB_HALT_SYSTEM,
| ^^^^^^^^^^^^^^ not found in `libc`
|
help: consider importing this unit variant
|
3 + use crate::sys::reboot::RebootMode::RB_HALT_SYSTEM;
|
error[E0425]: cannot find value `RB_KEXEC` in crate `libc`
--> /nix/src/sys/reboot.rs:20:9
|
20 | RB_KEXEC,
| ^^^^^^^^ not found in `libc`
|
help: consider importing this unit variant
|
3 + use crate::sys::reboot::RebootMode::RB_KEXEC;
|
error[E0425]: cannot find value `RB_POWER_OFF` in crate `libc`
--> /nix/src/sys/reboot.rs:22:9
|
22 | RB_POWER_OFF,
| ^^^^^^^^^^^^ not found in `libc`
|
help: consider importing this unit variant
|
3 + use crate::sys::reboot::RebootMode::RB_POWER_OFF;
|
error[E0425]: cannot find value `RB_AUTOBOOT` in crate `libc`
--> /nix/src/sys/reboot.rs:24:9
|
24 | RB_AUTOBOOT,
| ^^^^^^^^^^^ not found in `libc`
|
help: consider importing this unit variant
|
3 + use crate::sys::reboot::RebootMode::RB_AUTOBOOT;
|
error[E0425]: cannot find value `RB_SW_SUSPEND` in crate `libc`
--> /nix/src/sys/reboot.rs:27:9
|
27 | RB_SW_SUSPEND,
| ^^^^^^^^^^^^^ not found in `libc`
|
help: consider importing this unit variant
|
3 + use crate::sys::reboot::RebootMode::RB_SW_SUSPEND;
|
error[E0425]: cannot find function `reboot` in crate `libc`
--> /nix/src/sys/reboot.rs:33:20
|
33 | unsafe { libc::reboot(how as libc::c_int) };
| ^^^^^^ not found in `libc`
error[E0425]: cannot find value `RB_ENABLE_CAD` in crate `libc`
--> /nix/src/sys/reboot.rs:42:15
|
42 | libc::RB_ENABLE_CAD
| ^^^^^^^^^^^^^ not found in `libc`
error[E0425]: cannot find value `RB_DISABLE_CAD` in crate `libc`
--> /nix/src/sys/reboot.rs:44:15
|
44 | libc::RB_DISABLE_CAD
| ^^^^^^^^^^^^^^ not found in `libc`
error[E0425]: cannot find function `reboot` in crate `libc`
--> /nix/src/sys/reboot.rs:46:30
|
46 | let res = unsafe { libc::reboot(cmd) };
| ^^^^^^ not found in `libc`
For more information about this error, try `rustc --explain E0425`.
error: could not compile `nix` (lib) due to 9 previous errors
```
|
Would you like to file a PR for these missing symbols? Then after a version of libc with these symbols included is released, we can add it to Nix :)
@SteveLauC yes but i wouldnt know where to start with it. so open the issue in case someone does and wants to help in the meantime
Feel free to open a PR, it s mostly a call and a handful of constants, someone will review nonetheless :)
From your error info (which seems to be incomplete though), you have some missing constants and a function `reboot` to add, things for OpenBSD should be added to the files under this [directory](https://github.com/rust-lang/libc/tree/main/src/unix/bsd/netbsdlike/openbsd), if these things are not arch-dependent, then it should be added to `mod.rs`
Missing constants should go to this [area](https://github.com/rust-lang/libc/blob/df3f7c1fa899839d4cbd4e969ce9b4d508e6d4d0/src/unix/bsd/netbsdlike/openbsd/mod.rs#L1028-L1770)
Missing function should go [here](https://github.com/rust-lang/libc/blob/df3f7c1fa899839d4cbd4e969ce9b4d508e6d4d0/src/unix/bsd/netbsdlike/openbsd/mod.rs#L1853-L1999)
|
2023-11-07T21:31:40Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 3,404
|
rust-lang__libc-3404
|
[
"3329"
] |
77a5c7e160ccfb0b6a64ecd80522d5949fed1951
|
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index beffc8c0969d0..98a9d9b2b8448 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -2745,6 +2745,7 @@ pub const ALG_SET_IV: ::c_int = 2;
pub const ALG_SET_OP: ::c_int = 3;
pub const ALG_SET_AEAD_ASSOCLEN: ::c_int = 4;
pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
+pub const ALG_SET_DRBG_ENTROPY: ::c_int = 6;
pub const ALG_OP_DECRYPT: ::c_int = 0;
pub const ALG_OP_ENCRYPT: ::c_int = 1;
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index 445d5f4276274..53977182cc8fa 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -3210,6 +3210,8 @@ pub const ALG_SET_IV: ::c_int = 2;
pub const ALG_SET_OP: ::c_int = 3;
pub const ALG_SET_AEAD_ASSOCLEN: ::c_int = 4;
pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
+pub const ALG_SET_DRBG_ENTROPY: ::c_int = 6;
+pub const ALG_SET_KEY_BY_KEY_SERIAL: ::c_int = 7;
pub const ALG_OP_DECRYPT: ::c_int = 0;
pub const ALG_OP_ENCRYPT: ::c_int = 1;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index d2b2a4d587de5..cd1750d118ec0 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -1863,7 +1863,8 @@ fn test_android(target: &str) {
| "NDA_NDM_FLAGS_MASK"
| "NDTPA_INTERVAL_PROBE_TIME_MS"
| "NFQA_UNSPEC"
- | "NTF_EXT_LOCKED" => true,
+ | "NTF_EXT_LOCKED"
+ | "ALG_SET_DRBG_ENTROPY" => true,
_ => false,
}
@@ -3875,6 +3876,8 @@ fn test_linux(target: &str) {
// kernel 6.5 minimum
"MOVE_MOUNT_BENEATH" => true,
+ // FIXME: Requires linux 6.1
+ "ALG_SET_KEY_BY_KEY_SERIAL" | "ALG_SET_DRBG_ENTROPY" => true,
_ => false,
}
diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt
index 31407d497975a..09551d329c435 100644
--- a/libc-test/semver/android.txt
+++ b/libc-test/semver/android.txt
@@ -61,6 +61,7 @@ ALG_OP_DECRYPT
ALG_OP_ENCRYPT
ALG_SET_AEAD_ASSOCLEN
ALG_SET_AEAD_AUTHSIZE
+ALG_SET_DRBG_ENTROPY
ALG_SET_IV
ALG_SET_KEY
ALG_SET_OP
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index f5f83962bfddb..320be0f529f61 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -71,8 +71,10 @@ ALG_OP_DECRYPT
ALG_OP_ENCRYPT
ALG_SET_AEAD_ASSOCLEN
ALG_SET_AEAD_AUTHSIZE
+ALG_SET_DRBG_ENTROPY
ALG_SET_IV
ALG_SET_KEY
+ALG_SET_KEY_BY_KEY_SERIAL
ALG_SET_OP
ALT_DIGITS
AM_STR
|
Support for ALG_SET_KEY_BY_KEY_SERIAL for af_alg sockets
For Linux platforms, support for using the Kernel keyring as a key source for `af_alg` calls to the crypto API was added in v6.1:
https://lkml.org/lkml/2022/10/4/1014
https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/if_alg.h#L55
https://docs.kernel.org/crypto/userspace-if.html#setsockopt-interface
which added a `ALG_SET_KEY_BY_KEY_SERIAL` option. The option takes a single argument, a keyring identifier.
It would be great to support this directly.
|
2023-10-24T18:13:20Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,400
|
rust-lang__libc-3400
|
[
"3397"
] |
df3f7c1fa899839d4cbd4e969ce9b4d508e6d4d0
|
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index de5ec3863e717..ac79b9f45ac4e 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -60,6 +60,39 @@ impl siginfo_t {
self.si_addr
}
+ pub unsafe fn si_code(&self) -> ::c_int {
+ self.si_code
+ }
+
+ pub unsafe fn si_errno(&self) -> ::c_int {
+ self.si_errno
+ }
+
+ pub unsafe fn si_pid(&self) -> ::pid_t {
+ #[repr(C)]
+ struct siginfo_timer {
+ _si_signo: ::c_int,
+ _si_errno: ::c_int,
+ _si_code: ::c_int,
+ __pad1: ::c_int,
+ _pid: ::pid_t,
+ }
+ (*(self as *const siginfo_t as *const siginfo_timer))._pid
+ }
+
+ pub unsafe fn si_uid(&self) -> ::uid_t {
+ #[repr(C)]
+ struct siginfo_timer {
+ _si_signo: ::c_int,
+ _si_errno: ::c_int,
+ _si_code: ::c_int,
+ __pad1: ::c_int,
+ _pid: ::pid_t,
+ _uid: ::uid_t,
+ }
+ (*(self as *const siginfo_t as *const siginfo_timer))._uid
+ }
+
pub unsafe fn si_value(&self) -> ::sigval {
#[repr(C)]
struct siginfo_timer {
diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs
index 3b87dc211f236..49c6f934bd541 100644
--- a/src/unix/bsd/netbsdlike/openbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs
@@ -540,12 +540,46 @@ impl siginfo_t {
self.si_addr
}
- pub unsafe fn si_value(&self) -> ::sigval {
+ pub unsafe fn si_code(&self) -> ::c_int {
+ self.si_code
+ }
+
+ pub unsafe fn si_errno(&self) -> ::c_int {
+ self.si_errno
+ }
+
+ pub unsafe fn si_pid(&self) -> ::pid_t {
+ #[repr(C)]
+ struct siginfo_timer {
+ _si_signo: ::c_int,
+ _si_code: ::c_int,
+ _si_errno: ::c_int,
+ _pad: [::c_int; SI_PAD],
+ _pid: ::pid_t,
+ }
+ (*(self as *const siginfo_t as *const siginfo_timer))._pid
+ }
+
+ pub unsafe fn si_uid(&self) -> ::uid_t {
#[repr(C)]
struct siginfo_timer {
_si_signo: ::c_int,
+ _si_code: ::c_int,
_si_errno: ::c_int,
+ _pad: [::c_int; SI_PAD],
+ _pid: ::pid_t,
+ _uid: ::uid_t,
+ }
+ (*(self as *const siginfo_t as *const siginfo_timer))._uid
+ }
+
+ pub unsafe fn si_value(&self) -> ::sigval {
+ #[repr(C)]
+ struct siginfo_timer {
+ _si_signo: ::c_int,
_si_code: ::c_int,
+ _si_errno: ::c_int,
+ _pad: [::c_int; SI_PAD],
_pid: ::pid_t,
_uid: ::uid_t,
value: ::sigval,
@@ -1576,6 +1610,9 @@ pub const NTFS_MFLAG_ALLNAMES: ::c_int = 0x2;
pub const TMPFS_ARGS_VERSION: ::c_int = 1;
+const SI_MAXSZ: ::size_t = 128;
+const SI_PAD: ::size_t = (SI_MAXSZ / ::mem::size_of::<::c_int>()) - 3;
+
pub const MAP_STACK: ::c_int = 0x4000;
pub const MAP_CONCEAL: ::c_int = 0x8000;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 2f993486ef311..59d32513dc0e7 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -638,7 +638,7 @@ fn test_windows(target: &str) {
// Windows uppercase structs don't have `struct` in front:
t if is_struct => {
- if ty.clone().chars().next().unwrap().is_uppercase() {
+ if ty.chars().next().unwrap().is_uppercase() {
t.to_string()
} else if t == "stat" {
"struct __stat64".to_string()
|
siginfo_t: si_pid, si_status on OpenBSD/NetBSD
POSIX defines the following fields on `siginfo_t` [link](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html):
```
int si_signo Signal number.
int si_code Signal code.
int si_errno If non-zero, an errno value associated with
this signal, as described in <errno.h>.
pid_t si_pid Sending process ID.
uid_t si_uid Real user ID of sending process.
void *si_addr Address of faulting instruction.
int si_status Exit value or signal.
long si_band Band event for SIGPOLL.
union sigval si_value Signal value.
```
Of particular interest to me are `si_signo`, `si_code` (which are already exposed everywhere), as well as `si_pid` and `si_status`. These allow asynchronously receiving the exit status of a child process via SIGCHLD.
However, on `x86_64-unknown-netbsd` ([documented here](https://man.netbsd.org/siginfo.2)) and `x86_64-unknown-openbsd` ([undocumented but exists here](https://github.com/openbsd/src/blob/master/sys/sys/siginfo.h#L175)) , these fields are not exposed in any way. on `x86_64-unknown-linux-gnu` they are exposed as unsafe methods, and on `x86_64-unknown-freebsd`, as regular struct fields *and* unsafe methods.
I understand that this is due to some implementations choosing to use unions, or having different struct field orders. It would be very helpful if there was a consistent, portable way to access them, or at the very least, expose them on those two targets.
|
2023-10-21T19:49:49Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,394
|
rust-lang__libc-3394
|
[
"3392"
] |
df3f7c1fa899839d4cbd4e969ce9b4d508e6d4d0
|
diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
index b3a5be4494543..6ade7949afb0f 100644
--- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -1678,6 +1678,12 @@ extern "C" {
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
+ pub fn getmntinfo(mntbufp: *mut *mut ::statfs, flags: ::c_int) -> ::c_int;
+ pub fn getmntvinfo(
+ mntbufp: *mut *mut ::statfs,
+ mntvbufp: *mut *mut ::statvfs,
+ flags: ::c_int,
+ ) -> ::c_int;
}
#[link(name = "rt")]
|
diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt
index 08d7124c16f3f..f63e2bf9112b8 100644
--- a/libc-test/semver/dragonfly.txt
+++ b/libc-test/semver/dragonfly.txt
@@ -1320,6 +1320,8 @@ getitimer
getlastlogx
getline
getloadavg
+getmntinfo
+getmntvinfo
getnameinfo
getopt_long
getpeereid
|
Missing getmnt*info on DragonFly
- Target: `x86_64-unknown-dragonfly`
- API: [getmntinfo(3)](https://man.dragonflybsd.org/?command=getmntinfo§ion=3) (same API as [FreeBSD](https://man.freebsd.org/getmntinfo/3) and [OpenBSD](https://man.openbsd.org/getmntinfo.3)) and [getmntvinfo(3)](https://man.dragonflybsd.org/?command=getmntvinfo§ion=3)
- Implementation: [getmntinfo](https://github.com/DragonFlyBSD/DragonFlyBSD/blob/DragonFly_RELEASE_6_4/lib/libc/gen/getmntinfo.c) (statfs) and [getmntvinfo](https://github.com/DragonFlyBSD/DragonFlyBSD/blob/DragonFly_RELEASE_6_4/lib/libc/gen/getmntvinfo.c) (statfs + stat**v**fs)
- Test case: https://github.com/Byron/trash-rs/pull/89
|
2023-10-18T18:28:38Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,391
|
rust-lang__libc-3391
|
[
"3387"
] |
df3f7c1fa899839d4cbd4e969ce9b4d508e6d4d0
|
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index 175a49cd6696c..5cb8eec4bebec 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -1029,7 +1029,17 @@ pub const STATX_ATTR_DAX: ::c_int = 0x00200000;
pub const SOMAXCONN: ::c_int = 4096;
-//sys/timex.h
+// linux/mount.h
+pub const MOVE_MOUNT_F_SYMLINKS: ::c_uint = 0x00000001;
+pub const MOVE_MOUNT_F_AUTOMOUNTS: ::c_uint = 0x00000002;
+pub const MOVE_MOUNT_F_EMPTY_PATH: ::c_uint = 0x00000004;
+pub const MOVE_MOUNT_T_SYMLINKS: ::c_uint = 0x00000010;
+pub const MOVE_MOUNT_T_AUTOMOUNTS: ::c_uint = 0x00000020;
+pub const MOVE_MOUNT_T_EMPTY_PATH: ::c_uint = 0x00000040;
+pub const MOVE_MOUNT_SET_GROUP: ::c_uint = 0x00000100;
+pub const MOVE_MOUNT_BENEATH: ::c_uint = 0x00000200;
+
+// sys/timex.h
pub const ADJ_OFFSET: ::c_uint = 0x0001;
pub const ADJ_FREQUENCY: ::c_uint = 0x0002;
pub const ADJ_MAXERROR: ::c_uint = 0x0004;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index ffb972cb4145e..2f9d894b19318 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -3862,6 +3862,9 @@ fn test_linux(target: &str) {
// FIXME: Requires more recent kernel headers
"HWTSTAMP_TX_ONESTEP_P2P" if musl => true, // linux v5.6+
+ // kernel 6.5 minimum
+ "MOVE_MOUNT_BENEATH" => true,
+
_ => false,
}
});
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
index c37333b964046..ad971de731bad 100644
--- a/libc-test/semver/linux-gnu.txt
+++ b/libc-test/semver/linux-gnu.txt
@@ -140,6 +140,14 @@ MOD_OFFSET
MOD_STATUS
MOD_TAI
MOD_TIMECONST
+MOVE_MOUNT_BENEATH
+MOVE_MOUNT_F_AUTOMOUNTS
+MOVE_MOUNT_F_EMPTY_PATH
+MOVE_MOUNT_F_SYMLINKS
+MOVE_MOUNT_SET_GROUP
+MOVE_MOUNT_T_AUTOMOUNTS
+MOVE_MOUNT_T_EMPTY_PATH
+MOVE_MOUNT_T_SYMLINKS
MPOL_BIND
MPOL_DEFAULT
MPOL_F_NUMA_BALANCING
|
SYS_move_mount was added but MOVE_MOUNT_* constants for the flags are missing
With https://github.com/rust-lang/libc/pull/2114 the syscall for move_mount was added, as it seems it didn't include the constants for the flags.
|
2023-10-17T17:56:31Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,376
|
rust-lang__libc-3376
|
[
"3157"
] |
422616bbeb29da7b043e881e080bd7ceb0ea6c95
|
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index 067fe07c71f2f..da499c54d174a 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -14,6 +14,7 @@ pub type nl_item = ::c_int;
pub type idtype_t = ::c_uint;
pub type loff_t = ::c_longlong;
pub type pthread_key_t = ::c_uint;
+pub type pthread_once_t = ::c_int;
pub type pthread_spinlock_t = ::c_int;
pub type __u8 = ::c_uchar;
@@ -1903,6 +1904,7 @@ align_const! {
size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
};
}
+pub const PTHREAD_ONCE_INIT: pthread_once_t = 0;
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
@@ -4849,6 +4851,8 @@ extern "C" {
longindex: *mut ::c_int,
) -> ::c_int;
+ pub fn pthread_once(control: *mut pthread_once_t, routine: extern "C" fn()) -> ::c_int;
+
pub fn copy_file_range(
fd_in: ::c_int,
off_in: *mut ::off64_t,
|
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index b4091a707047d..8a6351401e8be 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -1926,6 +1926,7 @@ PTHREAD_PRIO_PROTECT
PTHREAD_PROCESS_PRIVATE
PTHREAD_PROCESS_SHARED
PTHREAD_STACK_MIN
+PTHREAD_ONCE_INIT
PTRACE_ATTACH
PTRACE_CONT
PTRACE_DETACH
@@ -3373,6 +3374,8 @@ pthread_barrier_wait
pthread_barrier_destroy
pthread_barrierattr_t
pthread_barrier_t
+pthread_once
+pthread_once_t
ptrace
ptsname_r
pwrite64
|
Add pthread_once
|
2023-10-07T14:29:04Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,375
|
rust-lang__libc-3375
|
[
"3371"
] |
017bf5f6b30abcdf59fc2a09997da79cb5a1cd29
|
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index b22b40ef9b374..ecd434175c03b 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -797,7 +797,7 @@ s! {
pub struct sockaddr_ndrv {
pub snd_len: ::c_uchar,
pub snd_family: ::c_uchar,
- pub snd_name: [::c_uchar; 16] // IFNAMSIZ from if.h
+ pub snd_name: [::c_uchar; ::IFNAMSIZ],
}
// sys/socket.h
@@ -1419,6 +1419,52 @@ s_no_extra_traits! {
pub svm_port: ::c_uint,
pub svm_cid: ::c_uint,
}
+
+ pub struct ifdevmtu {
+ pub ifdm_current: ::c_int,
+ pub ifdm_min: ::c_int,
+ pub ifdm_max: ::c_int,
+ }
+
+ #[cfg(libc_union)]
+ pub union __c_anonymous_ifk_data {
+ pub ifk_ptr: *mut ::c_void,
+ pub ifk_value: ::c_int,
+ }
+
+ #[cfg_attr(libc_packedN, repr(packed(4)))]
+ pub struct ifkpi {
+ pub ifk_module_id: ::c_uint,
+ pub ifk_type: ::c_uint,
+ #[cfg(libc_union)]
+ pub ifk_data: __c_anonymous_ifk_data,
+ }
+
+ #[cfg(libc_union)]
+ pub union __c_anonymous_ifr_ifru {
+ pub ifru_addr: ::sockaddr,
+ pub ifru_dstaddr: ::sockaddr,
+ pub ifru_broadaddr: ::sockaddr,
+ pub ifru_flags: ::c_short,
+ pub ifru_metrics: ::c_int,
+ pub ifru_mtu: ::c_int,
+ pub ifru_phys: ::c_int,
+ pub ifru_media: ::c_int,
+ pub ifru_intval: ::c_int,
+ pub ifru_data: *mut ::c_char,
+ pub ifru_devmtu: ifdevmtu,
+ pub ifru_kpi: ifkpi,
+ pub ifru_wake_flags: u32,
+ pub ifru_route_refcnt: u32,
+ pub ifru_cap: [::c_int; 2],
+ pub ifru_functional_type: u32,
+ }
+
+ pub struct ifreq {
+ pub ifr_name: [::c_char; ::IFNAMSIZ],
+ #[cfg(libc_union)]
+ pub ifr_ifru: __c_anonymous_ifr_ifru,
+ }
}
impl siginfo_t {
@@ -2767,6 +2813,190 @@ cfg_if! {
svm_cid.hash(state);
}
}
+
+ impl PartialEq for ifdevmtu {
+ fn eq(&self, other: &ifdevmtu) -> bool {
+ self.ifdm_current == other.ifdm_current
+ && self.ifdm_min == other.ifdm_min
+ && self.ifdm_max == other.ifdm_max
+ }
+ }
+
+ impl Eq for ifdevmtu {}
+
+ impl ::fmt::Debug for ifdevmtu {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ifdevmtu")
+ .field("ifdm_current", &self.ifdm_current)
+ .field("ifdm_min", &self.ifdm_min)
+ .field("ifdm_max", &self.ifdm_max)
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for ifdevmtu {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.ifdm_current.hash(state);
+ self.ifdm_min.hash(state);
+ self.ifdm_max.hash(state);
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl PartialEq for __c_anonymous_ifk_data {
+ fn eq(&self, other: &__c_anonymous_ifk_data) -> bool {
+ unsafe {
+ self.ifk_ptr == other.ifk_ptr
+ && self.ifk_value == other.ifk_value
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl Eq for __c_anonymous_ifk_data {}
+
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_ifk_data {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("__c_anonymous_ifk_data")
+ .field("ifk_ptr", unsafe { &self.ifk_ptr })
+ .field("ifk_value", unsafe { &self.ifk_value })
+ .finish()
+ }
+ }
+ #[cfg(libc_union)]
+ impl ::hash::Hash for __c_anonymous_ifk_data {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ unsafe {
+ self.ifk_ptr.hash(state);
+ self.ifk_value.hash(state);
+ }
+ }
+ }
+
+ impl PartialEq for ifkpi {
+ fn eq(&self, other: &ifkpi) -> bool {
+ self.ifk_module_id == other.ifk_module_id
+ && self.ifk_type == other.ifk_type
+ }
+ }
+
+ impl Eq for ifkpi {}
+
+ impl ::fmt::Debug for ifkpi {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ifkpi")
+ .field("ifk_module_id", &self.ifk_module_id)
+ .field("ifk_type", &self.ifk_type)
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for ifkpi {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.ifk_module_id.hash(state);
+ self.ifk_type.hash(state);
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl PartialEq for __c_anonymous_ifr_ifru {
+ fn eq(&self, other: &__c_anonymous_ifr_ifru) -> bool {
+ unsafe {
+ self.ifru_addr == other.ifru_addr
+ && self.ifru_dstaddr == other.ifru_dstaddr
+ && self.ifru_broadaddr == other.ifru_broadaddr
+ && self.ifru_flags == other.ifru_flags
+ && self.ifru_metrics == other.ifru_metrics
+ && self.ifru_mtu == other.ifru_mtu
+ && self.ifru_phys == other.ifru_phys
+ && self.ifru_media == other.ifru_media
+ && self.ifru_intval == other.ifru_intval
+ && self.ifru_data == other.ifru_data
+ && self.ifru_devmtu == other.ifru_devmtu
+ && self.ifru_kpi == other.ifru_kpi
+ && self.ifru_wake_flags == other.ifru_wake_flags
+ && self.ifru_route_refcnt == other.ifru_route_refcnt
+ && self.ifru_cap.iter().zip(other.ifru_cap.iter()).all(|(a,b)| a == b)
+ && self.ifru_functional_type == other.ifru_functional_type
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl Eq for __c_anonymous_ifr_ifru {}
+
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_ifr_ifru {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("__c_anonymous_ifr_ifru")
+ .field("ifru_addr", unsafe { &self.ifru_addr })
+ .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
+ .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr })
+ .field("ifru_flags", unsafe { &self.ifru_flags })
+ .field("ifru_metrics", unsafe { &self.ifru_metrics })
+ .field("ifru_mtu", unsafe { &self.ifru_mtu })
+ .field("ifru_phys", unsafe { &self.ifru_phys })
+ .field("ifru_media", unsafe { &self.ifru_media })
+ .field("ifru_intval", unsafe { &self.ifru_intval })
+ .field("ifru_data", unsafe { &self.ifru_data })
+ .field("ifru_devmtu", unsafe { &self.ifru_devmtu })
+ .field("ifru_kpi", unsafe { &self.ifru_kpi })
+ .field("ifru_wake_flags", unsafe { &self.ifru_wake_flags })
+ .field("ifru_route_refcnt", unsafe { &self.ifru_route_refcnt })
+ .field("ifru_cap", unsafe { &self.ifru_cap })
+ .field("ifru_functional_type", unsafe { &self.ifru_functional_type })
+ .finish()
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl ::hash::Hash for __c_anonymous_ifr_ifru {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ unsafe {
+ self.ifru_addr.hash(state);
+ self.ifru_dstaddr.hash(state);
+ self.ifru_broadaddr.hash(state);
+ self.ifru_flags.hash(state);
+ self.ifru_metrics.hash(state);
+ self.ifru_mtu.hash(state);
+ self.ifru_phys.hash(state);
+ self.ifru_media.hash(state);
+ self.ifru_intval.hash(state);
+ self.ifru_data.hash(state);
+ self.ifru_devmtu.hash(state);
+ self.ifru_kpi.hash(state);
+ self.ifru_wake_flags.hash(state);
+ self.ifru_route_refcnt.hash(state);
+ self.ifru_cap.hash(state);
+ self.ifru_functional_type.hash(state);
+ }
+ }
+ }
+
+ impl PartialEq for ifreq {
+ fn eq(&self, other: &ifreq) -> bool {
+ self.ifr_name == other.ifr_name
+ }
+ }
+
+ impl Eq for ifreq {}
+
+ impl ::fmt::Debug for ifreq {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ifreq")
+ .field("ifr_name", &self.ifr_name)
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for ifreq {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.ifr_name.hash(state);
+ #[cfg(libc_union)]
+ self.ifr_ifru.hash(state);
+ }
+ }
}
}
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 48fb4df08e8e9..2f7c469d7cf6a 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -299,6 +299,9 @@ fn test_apple(target: &str) {
}
cfg.skip_struct(move |ty| {
+ if ty.starts_with("__c_anonymous_") {
+ return true;
+ }
match ty {
// FIXME: actually a union
"sigval" => true,
@@ -310,8 +313,13 @@ fn test_apple(target: &str) {
}
});
- cfg.skip_type(move |ty| match ty {
- _ => false,
+ cfg.skip_type(move |ty| {
+ if ty.starts_with("__c_anonymous_") {
+ return true;
+ }
+ match ty {
+ _ => false,
+ }
});
cfg.skip_const(move |name| {
@@ -364,6 +372,8 @@ fn test_apple(target: &str) {
("__darwin_arm_neon_state64", "__v") => true,
// MAXPATHLEN is too big for auto-derive traits on arrays.
("vnode_info_path", "vip_path") => true,
+ ("ifreq", "ifr_ifru") => true,
+ ("ifkpi", "ifk_data") => true,
_ => false,
}
});
diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt
index d70ce6fc24749..98dcc4d4cdf1e 100644
--- a/libc-test/semver/apple.txt
+++ b/libc-test/semver/apple.txt
@@ -1957,6 +1957,8 @@ if_freenameindex
if_msghdr
if_nameindex
ifaddrs
+ifkpi
+ifreq
image_offset
in6_pktinfo
in_pktinfo
|
Lack of `ifreq` in macOS platform
The documentation says ifreq
https://docs.rs/libc/0.2.148/libc/struct.ifreq.html
but can not find.

|
2023-10-06T20:53:32Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,343
|
rust-lang__libc-3343
|
[
"3342"
] |
f5172d29959326a45bd6cef88c38896bf3aeb479
|
diff --git a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
index 9b3a2ff861731..89c93aba8818e 100644
--- a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
@@ -162,12 +162,6 @@ s! {
pub ss_size: ::size_t
}
- pub struct seccomp_notif_sizes {
- pub seccomp_notif: ::__u16,
- pub seccomp_notif_resp: ::__u16,
- pub seccomp_data: ::__u16,
- }
-
pub struct mcontext_t {
pub trap_no: ::c_ulong,
pub error_code: ::c_ulong,
@@ -466,11 +460,6 @@ pub const B3000000: ::speed_t = 0o010015;
pub const B3500000: ::speed_t = 0o010016;
pub const B4000000: ::speed_t = 0o010017;
-pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0;
-pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1;
-pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2;
-pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3;
-
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
diff --git a/src/unix/linux_like/linux/gnu/b32/csky/mod.rs b/src/unix/linux_like/linux/gnu/b32/csky/mod.rs
index 9807cea831021..5e92e30073bee 100644
--- a/src/unix/linux_like/linux/gnu/b32/csky/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/csky/mod.rs
@@ -415,11 +415,6 @@ pub const B3000000: ::speed_t = 0o010015;
pub const B3500000: ::speed_t = 0o010016;
pub const B4000000: ::speed_t = 0o010017;
-pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0;
-pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1;
-pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2;
-pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3;
-
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
diff --git a/src/unix/linux_like/linux/gnu/b32/x86/mod.rs b/src/unix/linux_like/linux/gnu/b32/x86/mod.rs
index a3531c141fdb6..27f477bb48f85 100644
--- a/src/unix/linux_like/linux/gnu/b32/x86/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/x86/mod.rs
@@ -236,11 +236,6 @@ s! {
pub ss_size: ::size_t
}
- pub struct seccomp_notif_sizes {
- pub seccomp_notif: ::__u16,
- pub seccomp_notif_resp: ::__u16,
- pub seccomp_data: ::__u16,
- }
}
s_no_extra_traits! {
@@ -1090,11 +1085,6 @@ pub const REG_EFL: ::c_int = 16;
pub const REG_UESP: ::c_int = 17;
pub const REG_SS: ::c_int = 18;
-pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0;
-pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1;
-pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2;
-pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3;
-
extern "C" {
pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;
diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
index 206283e22f6b2..284a1788f4409 100644
--- a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
@@ -197,11 +197,6 @@ s! {
pub ss_size: ::size_t
}
- pub struct seccomp_notif_sizes {
- pub seccomp_notif: ::__u16,
- pub seccomp_notif_resp: ::__u16,
- pub seccomp_data: ::__u16,
- }
}
pub const VEOF: usize = 4;
@@ -513,11 +508,6 @@ pub const B3000000: ::speed_t = 0o010015;
pub const B3500000: ::speed_t = 0o010016;
pub const B4000000: ::speed_t = 0o010017;
-pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0;
-pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1;
-pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2;
-pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3;
-
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
diff --git a/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs b/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
index 9b2aac5c2ba34..609c74429c5bc 100644
--- a/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
@@ -260,12 +260,6 @@ s! {
__unused5: u64
}
- pub struct seccomp_notif_sizes {
- pub seccomp_notif: ::__u16,
- pub seccomp_notif_resp: ::__u16,
- pub seccomp_data: ::__u16,
- }
-
pub struct ptrace_rseq_configuration {
pub rseq_abi_pointer: ::__u64,
pub rseq_abi_size: ::__u32,
@@ -803,11 +797,6 @@ pub const REG_TRAPNO: ::c_int = 20;
pub const REG_OLDMASK: ::c_int = 21;
pub const REG_CR2: ::c_int = 22;
-pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0;
-pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1;
-pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2;
-pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3;
-
extern "C" {
pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index 07e6e420d3532..d76dd752057f6 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -578,6 +578,34 @@ s! {
pub args: [::__u64; 6],
}
+ pub struct seccomp_notif_sizes {
+ pub seccomp_notif: ::__u16,
+ pub seccomp_notif_resp: ::__u16,
+ pub seccomp_data: ::__u16,
+ }
+
+ pub struct seccomp_notif {
+ pub id: ::__u64,
+ pub pid: ::__u32,
+ pub flags: ::__u32,
+ pub data: seccomp_data,
+ }
+
+ pub struct seccomp_notif_resp {
+ pub id: ::__u64,
+ pub val: ::__s64,
+ pub error: ::__s32,
+ pub flags: ::__u32,
+ }
+
+ pub struct seccomp_notif_addfd {
+ pub id: ::__u64,
+ pub flags: ::__u32,
+ pub srcfd: ::__u32,
+ pub newfd: ::__u32,
+ pub newfd_flags: ::__u32,
+ }
+
pub struct nlmsghdr {
pub nlmsg_len: u32,
pub nlmsg_type: u16,
@@ -2272,13 +2300,22 @@ pub const GRND_NONBLOCK: ::c_uint = 0x0001;
pub const GRND_RANDOM: ::c_uint = 0x0002;
pub const GRND_INSECURE: ::c_uint = 0x0004;
+// <linux/seccomp.h>
pub const SECCOMP_MODE_DISABLED: ::c_uint = 0;
pub const SECCOMP_MODE_STRICT: ::c_uint = 1;
pub const SECCOMP_MODE_FILTER: ::c_uint = 2;
+pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0;
+pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1;
+pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2;
+pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3;
+
pub const SECCOMP_FILTER_FLAG_TSYNC: ::c_ulong = 1;
pub const SECCOMP_FILTER_FLAG_LOG: ::c_ulong = 2;
pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: ::c_ulong = 4;
+pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: ::c_ulong = 8;
+pub const SECCOMP_FILTER_FLAG_TSYNC_ESRCH: ::c_ulong = 16;
+pub const SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV: ::c_ulong = 32;
pub const SECCOMP_RET_KILL_PROCESS: ::c_uint = 0x80000000;
pub const SECCOMP_RET_KILL_THREAD: ::c_uint = 0x00000000;
@@ -2293,6 +2330,11 @@ pub const SECCOMP_RET_ACTION_FULL: ::c_uint = 0xffff0000;
pub const SECCOMP_RET_ACTION: ::c_uint = 0x7fff0000;
pub const SECCOMP_RET_DATA: ::c_uint = 0x0000ffff;
+pub const SECCOMP_USER_NOTIF_FLAG_CONTINUE: ::c_ulong = 1;
+
+pub const SECCOMP_ADDFD_FLAG_SETFD: ::c_ulong = 1;
+pub const SECCOMP_ADDFD_FLAG_SEND: ::c_ulong = 2;
+
pub const ITIMER_REAL: ::c_int = 0;
pub const ITIMER_VIRTUAL: ::c_int = 1;
pub const ITIMER_PROF: ::c_int = 2;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index e9178a0a41499..bddeb132fb15a 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -3520,6 +3520,19 @@ fn test_linux(target: &str) {
if musl && ty.starts_with("uinput_") {
return true;
}
+ if musl && ty == "seccomp_notif" {
+ return true;
+ }
+ if musl && ty == "seccomp_notif_addfd" {
+ return true;
+ }
+ if musl && ty == "seccomp_notif_resp" {
+ return true;
+ }
+ if musl && ty == "seccomp_notif_sizes" {
+ return true;
+ }
+
// LFS64 types have been removed in musl 1.2.4+
if musl && (ty.ends_with("64") || ty.ends_with("64_t")) {
return true;
@@ -3648,6 +3661,17 @@ fn test_linux(target: &str) {
}
}
if musl {
+ // FIXME: Requires >= 5.0 kernel headers
+ if name == "SECCOMP_GET_NOTIF_SIZES"
+ || name == "SECCOMP_FILTER_FLAG_NEW_LISTENER"
+ || name == "SECCOMP_FILTER_FLAG_TSYNC_ESRCH"
+ || name == "SECCOMP_USER_NOTIF_FLAG_CONTINUE" // requires >= 5.5
+ || name == "SECCOMP_ADDFD_FLAG_SETFD" // requires >= 5.9
+ || name == "SECCOMP_ADDFD_FLAG_SEND" // requires >= 5.9
+ || name == "SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV" // requires >= 5.19
+ {
+ return true;
+ }
// FIXME: Requires >= 5.4.1 kernel headers
if name.starts_with("J1939")
|| name.starts_with("RTEXT_FILTER_")
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index 1957a7d657d7c..ced81a70df631 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -2373,23 +2373,33 @@ SCTP_STATUS
SCTP_STREAM_RESET_INCOMING
SCTP_STREAM_RESET_OUTGOING
SCTP_UNORDERED
+SECCOMP_ADDFD_FLAG_SEND
+SECCOMP_ADDFD_FLAG_SETFD
SECCOMP_FILTER_FLAG_LOG
+SECCOMP_FILTER_FLAG_NEW_LISTENER
SECCOMP_FILTER_FLAG_SPEC_ALLOW
SECCOMP_FILTER_FLAG_TSYNC
+SECCOMP_FILTER_FLAG_TSYNC_ESRCH
+SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV
+SECCOMP_GET_ACTION_AVAIL
+SECCOMP_GET_NOTIF_SIZES
SECCOMP_MODE_DISABLED
-SECCOMP_MODE_FILTER
SECCOMP_MODE_STRICT
+SECCOMP_MODE_FILTER
SECCOMP_RET_ACTION
SECCOMP_RET_ACTION_FULL
SECCOMP_RET_ALLOW
SECCOMP_RET_DATA
SECCOMP_RET_ERRNO
-SECCOMP_RET_KILL
SECCOMP_RET_KILL_PROCESS
SECCOMP_RET_KILL_THREAD
+SECCOMP_RET_KILL
SECCOMP_RET_LOG
SECCOMP_RET_TRACE
SECCOMP_RET_TRAP
+SECCOMP_SET_MODE_FILTER
+SECCOMP_SET_MODE_STRICT
+SECCOMP_USER_NOTIF_FLAG_CONTINUE
SEEK_DATA
SEEK_HOLE
SELFMAG
@@ -3500,6 +3510,10 @@ sched_setparam
sched_setscheduler
sctp_assoc_t
seccomp_data
+seccomp_notif
+seccomp_notif_addfd
+seccomp_notif_resp
+seccomp_notif_sizes
seed48
seekdir
sem_close
|
Fix seccomp constants on musl/all linux platforms
on x86_64-unknown-linux-gnu, some of the seccomp-related constants are provided but they are not on all platforms.
These constants live inside <linux/seccomp.h> and it appears that some of them exist in rust's libc linux/mod.rs
Linux: https://github.com/torvalds/linux/blob/master/include/uapi/linux/seccomp.h#L10
Rust libc linux/mod.rs: https://github.com/rust-lang/libc/blob/835661543db1ec42a6d9a809d69c3c5b5b978b81/src/unix/linux_like/linux/mod.rs#L2190
Rust libc linux/gnu/<platform>/mod.rs https://github.com/rust-lang/libc/blob/835661543db1ec42a6d9a809d69c3c5b5b978b81/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs#L805
The constants
```
/* Valid operations for seccomp syscall. */
#define SECCOMP_SET_MODE_STRICT 0
#define SECCOMP_SET_MODE_FILTER 1
#define SECCOMP_GET_ACTION_AVAIL 2
#define SECCOMP_GET_NOTIF_SIZES 3
```
from seccomp.h appear to be missing from `unix/linux_like/linux/mod.rs` . Some other newer constants also appear to be missing e.g. `SECCOMP_FILTER_FLAG_NEW_LISTENER`.
If it seems okay to move everything into linux/mod.rs, I'll make a PR for that.
|
2023-09-07T06:12:49Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,341
|
rust-lang__libc-3341
|
[
"3339"
] |
835661543db1ec42a6d9a809d69c3c5b5b978b81
|
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index 4138af576e936..f2236a034e06d 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -4693,6 +4693,11 @@ pub const RB_POWERCYCLE: ::c_int = 0x400000;
pub const RB_PROBE: ::c_int = 0x10000000;
pub const RB_MULTIPLE: ::c_int = 0x20000000;
+// sys/timerfd.h
+
+pub const TFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
+pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC;
+
cfg_if! {
if #[cfg(libc_const_extern_fn)] {
pub const fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
@@ -5406,6 +5411,15 @@ extern "C" {
infotype: *mut ::c_uint,
flags: *mut ::c_int,
) -> ::ssize_t;
+
+ pub fn timerfd_create(clockid: ::c_int, flags: ::c_int) -> ::c_int;
+ pub fn timerfd_gettime(fd: ::c_int, curr_value: *mut itimerspec) -> ::c_int;
+ pub fn timerfd_settime(
+ fd: ::c_int,
+ flags: ::c_int,
+ new_value: *const itimerspec,
+ old_value: *mut itimerspec,
+ ) -> ::c_int;
}
#[link(name = "memstat")]
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index bfe1ed16f3951..c79682d1e895c 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2343,6 +2343,9 @@ fn test_freebsd(target: &str) {
// Added in FreeBSD 13.2
"AT_USRSTACKBASE" | "AT_USRSTACKLIM" if Some(13) > freebsd_ver => true,
+ // Added in FreeBSD 14
+ "TFD_CLOEXEC" | "TFD_NONBLOCK" if Some(14) > freebsd_ver => true,
+
_ => false,
}
});
@@ -2441,6 +2444,11 @@ fn test_freebsd(target: &str) {
true
}
+ // Those are introduced in FreeBSD 14.
+ "timerfd_create" | "timerfd_gettime" | "timerfd_settime" if Some(14) > freebsd_ver => {
+ true
+ }
+
_ => false,
}
});
|
timerfd on FreeBSD >= 14.0
Same API as Linux. See [timerfd(2)](https://man.freebsd.org/cgi/man.cgi?query=timerfd&sektion=2&manpath=FreeBSD+15.0-CURRENT) and [`<sys/timerfd.h>`](https://github.com/freebsd/freebsd-src/blob/main/sys/sys/timerfd.h) for details.
Similar to `eventfd` the ABI is new, so no need to gate by `cfg(freebsd14)`.
|
2023-09-06T21:25:03Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,337
|
rust-lang__libc-3337
|
[
"3336"
] |
6f31de33032bf37b5735357320feedb84bb44478
|
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index bf571aeb738ff..e53cf3f197537 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -378,6 +378,13 @@ s! {
pub fst_bytesalloc: ::off_t,
}
+ pub struct fpunchhole_t {
+ pub fp_flags: ::c_uint, /* unused */
+ pub reserved: ::c_uint, /* (to maintain 8-byte alignment) */
+ pub fp_offset: ::off_t, /* IN: start of the region */
+ pub fp_length: ::off_t, /* IN: size of the region */
+ }
+
pub struct radvisory {
pub ra_offset: ::off_t,
pub ra_count: ::c_int,
@@ -3241,6 +3248,7 @@ pub const F_GLOBAL_NOCACHE: ::c_int = 55;
pub const F_NODIRECT: ::c_int = 62;
pub const F_LOG2PHYS_EXT: ::c_int = 65;
pub const F_BARRIERFSYNC: ::c_int = 85;
+pub const F_PUNCHHOLE: ::c_int = 99;
pub const F_GETPATH_NOFIRMLINK: ::c_int = 102;
pub const F_ALLOCATECONTIG: ::c_uint = 0x02;
|
diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt
index 10e505ed46dd0..64d0269d45eb9 100644
--- a/libc-test/semver/apple.txt
+++ b/libc-test/semver/apple.txt
@@ -193,10 +193,10 @@ BUFSIZ
BUS_ADRALN
BUS_ADRERR
BUS_OBJERR
-CCStatus
CCCryptorStatus
-CCRandomGenerateBytes
CCRNGStatus
+CCRandomGenerateBytes
+CCStatus
CIGNORE
CLD_CONTINUED
CLD_DUMPED
@@ -442,6 +442,7 @@ F_NOCACHE
F_NODIRECT
F_PEOFPOSMODE
F_PREALLOCATE
+F_PUNCHHOLE
F_RDADVISE
F_RDAHEAD
F_RDLCK
@@ -640,8 +641,8 @@ IPV6_PKTINFO
IPV6_RECVPKTINFO
IPV6_RECVTCLASS
IPV6_TCLASS
-IP_HDRINCL
IP_BOUND_IF
+IP_HDRINCL
IP_PKTINFO
IP_RECVDSTADDR
IP_RECVIF
@@ -677,7 +678,6 @@ KERN_FAILURE
KERN_FILE
KERN_HOSTID
KERN_HOSTNAME
-KERN_IPC
KERN_INSUFFICIENT_BUFFER_SIZE
KERN_INVALID_ADDRESS
KERN_INVALID_ARGUMENT
@@ -685,12 +685,13 @@ KERN_INVALID_HOST
KERN_INVALID_LEDGER
KERN_INVALID_MEMORY_CONTROL
KERN_INVALID_NAME
-KERN_INVALID_POLICY
KERN_INVALID_OBJECT
+KERN_INVALID_POLICY
+KERN_INVALID_RIGHT
KERN_INVALID_SECURITY
KERN_INVALID_TASK
-KERN_INVALID_RIGHT
KERN_INVALID_VALUE
+KERN_IPC
KERN_JOB_CONTROL
KERN_KDBUFWAIT
KERN_KDCPUMAP
@@ -714,11 +715,11 @@ KERN_KDSET_TYPEFILTER
KERN_KDTHRMAP
KERN_KDWRITEMAP
KERN_KDWRITETR
-KERN_LOGSIGEXIT
KERN_LOCK_OWNED
KERN_LOCK_OWNED_SELF
KERN_LOCK_SET_DESTROYED
KERN_LOCK_UNSTABLE
+KERN_LOGSIGEXIT
KERN_LOW_PRI_DELAY
KERN_LOW_PRI_WINDOW
KERN_MAXFILES
@@ -780,9 +781,9 @@ KERN_SAFEBOOT
KERN_SAVED_IDS
KERN_SECURELVL
KERN_SEMAPHORE_DESTROYED
-KERN_SUCCESS
KERN_SHREG_PRIVATIZABLE
KERN_SPECULATIVE_READS
+KERN_SUCCESS
KERN_SUGID_COREDUMP
KERN_SYMFILE
KERN_SYSV
@@ -1272,8 +1273,8 @@ SAE_ASSOCID_ANY
SAE_CONNID_ALL
SAE_CONNID_ANY
SCALE_PPM
-SCHED_OTHER
SCHED_FIFO
+SCHED_OTHER
SCHED_RR
SCM_CREDS
SCM_RIGHTS
@@ -1369,12 +1370,12 @@ TCP_MAXSEG
TCP_NOOPT
TCP_NOPUSH
THOUSEP
-THREAD_BACKGROUND_POLICY
-THREAD_BACKGROUND_POLICY_DARWIN_BG
-THREAD_BACKGROUND_POLICY_COUNT
THREAD_AFFINITY_POLICY
THREAD_AFFINITY_POLICY_COUNT
THREAD_AFFINITY_TAG_NULL
+THREAD_BACKGROUND_POLICY
+THREAD_BACKGROUND_POLICY_COUNT
+THREAD_BACKGROUND_POLICY_DARWIN_BG
THREAD_BASIC_INFO
THREAD_BASIC_INFO_COUNT
THREAD_EXTENDED_INFO
@@ -1671,10 +1672,10 @@ XATTR_SHOWCOMPRESSION
XUCRED_VERSION
YESEXPR
YESSTR
-_CS_PATH
+_CS_DARWIN_USER_CACHE_DIR
_CS_DARWIN_USER_DIR
_CS_DARWIN_USER_TEMP_DIR
-_CS_DARWIN_USER_CACHE_DIR
+_CS_PATH
_IOFBF
_IOLBF
_IONBF
@@ -1742,8 +1743,8 @@ _SC_PRIORITY_SCHEDULING
_SC_RAW_SOCKETS
_SC_READER_WRITER_LOCKS
_SC_REALTIME_SIGNALS
-_SC_RE_DUP_MAX
_SC_REGEXP
+_SC_RE_DUP_MAX
_SC_RTSIG_MAX
_SC_SAVED_IDS
_SC_SEMAPHORES
@@ -1843,6 +1844,7 @@ backtrace_from_fp
backtrace_image_offsets
backtrace_symbols
backtrace_symbols_fd
+basename
boolean_t
bpf_hdr
brk
@@ -1870,6 +1872,7 @@ ctime_r
ctl_info
difftime
dirfd
+dirname
disconnectx
dqblk
duplocale
@@ -1889,6 +1892,7 @@ flistxattr
fmemopen
fmount
forkpty
+fpunchhole_t
freadlink
freeifaddrs
freelocale
@@ -2004,13 +2008,13 @@ malloc_zone_t
malloc_zone_valloc
max_align_t
mcontext_t
-memory_object_t
+mem_entry_name_port_t
memory_object_offset_t
+memory_object_t
+memset_pattern16
memset_pattern4
memset_pattern8
-memset_pattern16
memset_s
-mem_entry_name_port_t
mincore
mkdirat
mkfifoat
@@ -2032,21 +2036,21 @@ openat
openpty
os_log_create
os_log_t
-os_log_type_t
os_log_type_enabled
+os_log_type_t
os_signpost_enabled
os_signpost_id_generate
os_signpost_id_make_with_pointer
os_signpost_id_t
os_signpost_type_t
os_unfair_lock
+os_unfair_lock_assert_not_owner
+os_unfair_lock_assert_owner
+os_unfair_lock_lock
os_unfair_lock_s
os_unfair_lock_t
-os_unfair_lock_lock
os_unfair_lock_trylock
os_unfair_lock_unlock
-os_unfair_lock_assert_owner
-os_unfair_lock_assert_not_owner
pause
policy_t
popen
@@ -2077,21 +2081,21 @@ posix_spawnp
preadv
proc_bsdinfo
proc_kmsgbuf
+proc_libversion
proc_listallpids
proc_listchildpids
proc_listpgrppids
proc_listpids
-proc_libversion
proc_name
-proc_pidinfo
proc_pidfdinfo
proc_pidfileportinfo
+proc_pidinfo
proc_pidpath
proc_regionfilename
-proc_set_no_smt
-proc_setthread_no_smt
proc_set_csm
+proc_set_no_smt
proc_setthread_csm
+proc_setthread_no_smt
proc_taskallinfo
proc_taskinfo
proc_threadinfo
@@ -2102,26 +2106,25 @@ pseudo_AF_RTIP
pseudo_AF_XTP
pthread_attr_getschedparam
pthread_attr_setschedparam
+pthread_cancel
+pthread_condattr_getpshared
+pthread_condattr_setpshared
pthread_cpu_number_np
pthread_create_from_mach_thread
+pthread_from_mach_thread_np
+pthread_get_stackaddr_np
+pthread_get_stacksize_np
+pthread_getname_np
pthread_getschedparam
pthread_introspection_getspecific_np
-pthread_introspection_hook_t
pthread_introspection_hook_install
+pthread_introspection_hook_t
pthread_introspection_setspecific_np
pthread_jit_write_callback_t
pthread_jit_write_freeze_callbacks_np
pthread_jit_write_protect_np
pthread_jit_write_protect_supported_np
pthread_jit_write_with_callback_np
-pthread_setschedparam
-pthread_cancel
-pthread_condattr_getpshared
-pthread_condattr_setpshared
-pthread_from_mach_thread_np
-pthread_get_stackaddr_np
-pthread_get_stacksize_np
-pthread_getname_np
pthread_kill
pthread_main_np
pthread_mutexattr_getpshared
@@ -2129,6 +2132,7 @@ pthread_mutexattr_setpshared
pthread_rwlockattr_getpshared
pthread_rwlockattr_setpshared
pthread_setname_np
+pthread_setschedparam
pthread_stack_frame_decode_np
ptrace
pututxline
@@ -2236,11 +2240,11 @@ thread_identifier_info_t
thread_info
thread_info_t
thread_inspect_t
-thread_policy_set
thread_policy_get
+thread_policy_set
+time_value_t
timeval32
timex
-time_value_t
truncate
ttyname_r
ucontext_t
@@ -2261,5 +2265,3 @@ wait4
waitid
xsw_usage
xucred
-dirname
-basename
|
F_PUNCHHOLE
Apple has F_PUNCHHOLE for punching file system holes.
aarch64-apple-darwin
fcntl.h:
```
#define F_PUNCHHOLE 99 /* Deallocate a range of the file */
/* fpunchhole_t used by F_PUNCHHOLE */
typedef struct fpunchhole {
unsigned int fp_flags; /* unused */
unsigned int reserved; /* (to maintain 8-byte alignment) */
off_t fp_offset; /* IN: start of the region */
off_t fp_length; /* IN: size of the region */
} fpunchhole_t;
```
Happy to add this myself with some pointers. Cheers!
|
2023-09-04T02:27:02Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,332
|
rust-lang__libc-3332
|
[
"3331"
] |
835661543db1ec42a6d9a809d69c3c5b5b978b81
|
diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs
index 3e922e766cba4..b791b0c61cdfb 100644
--- a/src/fuchsia/mod.rs
+++ b/src/fuchsia/mod.rs
@@ -2679,7 +2679,87 @@ pub const PT_GNU_STACK: u32 = 0x6474e551;
pub const PT_GNU_RELRO: u32 = 0x6474e552;
// Ethernet protocol IDs.
+pub const ETH_P_LOOP: ::c_int = 0x0060;
+pub const ETH_P_PUP: ::c_int = 0x0200;
+pub const ETH_P_PUPAT: ::c_int = 0x0201;
pub const ETH_P_IP: ::c_int = 0x0800;
+pub const ETH_P_X25: ::c_int = 0x0805;
+pub const ETH_P_ARP: ::c_int = 0x0806;
+pub const ETH_P_BPQ: ::c_int = 0x08FF;
+pub const ETH_P_IEEEPUP: ::c_int = 0x0a00;
+pub const ETH_P_IEEEPUPAT: ::c_int = 0x0a01;
+pub const ETH_P_BATMAN: ::c_int = 0x4305;
+pub const ETH_P_DEC: ::c_int = 0x6000;
+pub const ETH_P_DNA_DL: ::c_int = 0x6001;
+pub const ETH_P_DNA_RC: ::c_int = 0x6002;
+pub const ETH_P_DNA_RT: ::c_int = 0x6003;
+pub const ETH_P_LAT: ::c_int = 0x6004;
+pub const ETH_P_DIAG: ::c_int = 0x6005;
+pub const ETH_P_CUST: ::c_int = 0x6006;
+pub const ETH_P_SCA: ::c_int = 0x6007;
+pub const ETH_P_TEB: ::c_int = 0x6558;
+pub const ETH_P_RARP: ::c_int = 0x8035;
+pub const ETH_P_ATALK: ::c_int = 0x809B;
+pub const ETH_P_AARP: ::c_int = 0x80F3;
+pub const ETH_P_8021Q: ::c_int = 0x8100;
+pub const ETH_P_IPX: ::c_int = 0x8137;
+pub const ETH_P_IPV6: ::c_int = 0x86DD;
+pub const ETH_P_PAUSE: ::c_int = 0x8808;
+pub const ETH_P_SLOW: ::c_int = 0x8809;
+pub const ETH_P_WCCP: ::c_int = 0x883E;
+pub const ETH_P_MPLS_UC: ::c_int = 0x8847;
+pub const ETH_P_MPLS_MC: ::c_int = 0x8848;
+pub const ETH_P_ATMMPOA: ::c_int = 0x884c;
+pub const ETH_P_PPP_DISC: ::c_int = 0x8863;
+pub const ETH_P_PPP_SES: ::c_int = 0x8864;
+pub const ETH_P_LINK_CTL: ::c_int = 0x886c;
+pub const ETH_P_ATMFATE: ::c_int = 0x8884;
+pub const ETH_P_PAE: ::c_int = 0x888E;
+pub const ETH_P_AOE: ::c_int = 0x88A2;
+pub const ETH_P_8021AD: ::c_int = 0x88A8;
+pub const ETH_P_802_EX1: ::c_int = 0x88B5;
+pub const ETH_P_TIPC: ::c_int = 0x88CA;
+pub const ETH_P_8021AH: ::c_int = 0x88E7;
+pub const ETH_P_MVRP: ::c_int = 0x88F5;
+pub const ETH_P_1588: ::c_int = 0x88F7;
+pub const ETH_P_PRP: ::c_int = 0x88FB;
+pub const ETH_P_FCOE: ::c_int = 0x8906;
+pub const ETH_P_TDLS: ::c_int = 0x890D;
+pub const ETH_P_FIP: ::c_int = 0x8914;
+pub const ETH_P_80221: ::c_int = 0x8917;
+pub const ETH_P_LOOPBACK: ::c_int = 0x9000;
+pub const ETH_P_QINQ1: ::c_int = 0x9100;
+pub const ETH_P_QINQ2: ::c_int = 0x9200;
+pub const ETH_P_QINQ3: ::c_int = 0x9300;
+pub const ETH_P_EDSA: ::c_int = 0xDADA;
+pub const ETH_P_AF_IUCV: ::c_int = 0xFBFB;
+
+pub const ETH_P_802_3_MIN: ::c_int = 0x0600;
+
+pub const ETH_P_802_3: ::c_int = 0x0001;
+pub const ETH_P_AX25: ::c_int = 0x0002;
+pub const ETH_P_ALL: ::c_int = 0x0003;
+pub const ETH_P_802_2: ::c_int = 0x0004;
+pub const ETH_P_SNAP: ::c_int = 0x0005;
+pub const ETH_P_DDCMP: ::c_int = 0x0006;
+pub const ETH_P_WAN_PPP: ::c_int = 0x0007;
+pub const ETH_P_PPP_MP: ::c_int = 0x0008;
+pub const ETH_P_LOCALTALK: ::c_int = 0x0009;
+pub const ETH_P_CAN: ::c_int = 0x000C;
+pub const ETH_P_CANFD: ::c_int = 0x000D;
+pub const ETH_P_PPPTALK: ::c_int = 0x0010;
+pub const ETH_P_TR_802_2: ::c_int = 0x0011;
+pub const ETH_P_MOBITEX: ::c_int = 0x0015;
+pub const ETH_P_CONTROL: ::c_int = 0x0016;
+pub const ETH_P_IRDA: ::c_int = 0x0017;
+pub const ETH_P_ECONET: ::c_int = 0x0018;
+pub const ETH_P_HDLC: ::c_int = 0x0019;
+pub const ETH_P_ARCNET: ::c_int = 0x001A;
+pub const ETH_P_DSA: ::c_int = 0x001B;
+pub const ETH_P_TRAILER: ::c_int = 0x001C;
+pub const ETH_P_PHONET: ::c_int = 0x00F5;
+pub const ETH_P_IEEE802154: ::c_int = 0x00F6;
+pub const ETH_P_CAIF: ::c_int = 0x00F7;
pub const SFD_CLOEXEC: ::c_int = 0x080000;
|
diff --git a/libc-test/semver/fuchsia.txt b/libc-test/semver/fuchsia.txt
index 5e7213c0bea25..f4dcc149e6f44 100644
--- a/libc-test/semver/fuchsia.txt
+++ b/libc-test/semver/fuchsia.txt
@@ -256,7 +256,85 @@ ERFKILL
ESOCKTNOSUPPORT
ESRMNT
ESTRPIPE
+ETH_P_LOOP
+ETH_P_PUP
+ETH_P_PUPAT
ETH_P_IP
+ETH_P_X25
+ETH_P_ARP
+ETH_P_BPQ
+ETH_P_IEEEPUP
+ETH_P_IEEEPUPAT
+ETH_P_BATMAN
+ETH_P_DEC
+ETH_P_DNA_DL
+ETH_P_DNA_RC
+ETH_P_DNA_RT
+ETH_P_LAT
+ETH_P_DIAG
+ETH_P_CUST
+ETH_P_SCA
+ETH_P_TEB
+ETH_P_RARP
+ETH_P_ATALK
+ETH_P_AARP
+ETH_P_8021Q
+ETH_P_IPX
+ETH_P_IPV6
+ETH_P_PAUSE
+ETH_P_SLOW
+ETH_P_WCCP
+ETH_P_MPLS_UC
+ETH_P_MPLS_MC
+ETH_P_ATMMPOA
+ETH_P_PPP_DISC
+ETH_P_PPP_SES
+ETH_P_LINK_CTL
+ETH_P_ATMFATE
+ETH_P_PAE
+ETH_P_AOE
+ETH_P_8021AD
+ETH_P_802_EX1
+ETH_P_TIPC
+ETH_P_8021AH
+ETH_P_MVRP
+ETH_P_1588
+ETH_P_PRP
+ETH_P_FCOE
+ETH_P_TDLS
+ETH_P_FIP
+ETH_P_80221
+ETH_P_LOOPBACK
+ETH_P_QINQ1
+ETH_P_QINQ2
+ETH_P_QINQ3
+ETH_P_EDSA
+ETH_P_AF_IUCV
+ETH_P_802_3_MIN
+ETH_P_802_3
+ETH_P_AX25
+ETH_P_ALL
+ETH_P_802_2
+ETH_P_SNAP
+ETH_P_DDCMP
+ETH_P_WAN_PPP
+ETH_P_PPP_MP
+ETH_P_LOCALTALK
+ETH_P_CAN
+ETH_P_CANFD
+ETH_P_PPPTALK
+ETH_P_TR_802_2
+ETH_P_MOBITEX
+ETH_P_CONTROL
+ETH_P_IRDA
+ETH_P_ECONET
+ETH_P_HDLC
+ETH_P_ARCNET
+ETH_P_DSA
+ETH_P_TRAILER
+ETH_P_PHONET
+ETH_P_IEEE802154
+ETH_P_CAIF
ETIME
ETOOMANYREFS
EUCLEAN
|
Define all the `ETH_P_*` constants on fuchsia
Currently, `libc` only [defines](https://github.com/rust-lang/libc/blob/835661543db1ec42a6d9a809d69c3c5b5b978b81/src/fuchsia/mod.rs#L2682) `ETH_P_IP` on Fuchsia. We should define all of the `ETH_P_*` constants that fuchsia supports per https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/third_party/ulib/musl/include/netinet/if_ether.h
|
2023-08-31T23:10:56Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,266
|
rust-lang__libc-3266
|
[
"3265"
] |
a6c94f4c02f597e1db4f4dd23c1ad7f6072fd8ac
|
diff --git a/Cargo.toml b/Cargo.toml
index 42d3376e084d2..c2c51b300c126 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "libc"
-version = "0.2.145"
+version = "0.2.146"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
|
diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml
index 3a133ec1c7c4f..3779d99d2bf7e 100644
--- a/libc-test/Cargo.toml
+++ b/libc-test/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "libc-test"
-version = "0.2.145"
+version = "0.2.146"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
build = "build.rs"
@@ -12,7 +12,7 @@ A test crate for the libc crate.
[dependencies.libc]
path = ".."
-version = "0.2.145"
+version = "0.2.146"
default-features = false
[build-dependencies]
|
Use `use` to alias open/openat in lfs64.rs
Proposed workaround for #3264 (see that issue for details).
|
r? @JohnTitor
(rustbot has picked a reviewer for you, use r? to override)
@bors r+
:pushpin: Commit 52badc617f71831b3e7addc1c0827c4395d09678 has been approved by `Amanieu`
It is now in the [queue](https://bors.rust-lang.org/homu/queue/libc) for this repository.
<!-- @bors r=Amanieu 52badc617f71831b3e7addc1c0827c4395d09678 -->
<!-- homu: {"type":"Approved","sha":"52badc617f71831b3e7addc1c0827c4395d09678","approver":"Amanieu","queue":"https://bors.rust-lang.org/homu/queue/libc"} -->
:hourglass: Testing commit 52badc617f71831b3e7addc1c0827c4395d09678 with merge a6c94f4c02f597e1db4f4dd23c1ad7f6072fd8ac...
<!-- homu: {"type":"BuildStarted","head_sha":"52badc617f71831b3e7addc1c0827c4395d09678","merge_sha":"a6c94f4c02f597e1db4f4dd23c1ad7f6072fd8ac"} -->
:sunny: Test successful - [checks-actions](https://github.com/rust-lang/libc/actions/runs/5187325927/jobs/9350782716), [checks-cirrus-freebsd-12](https://cirrus-ci.com/task/5126407710310400), [checks-cirrus-freebsd-13](https://cirrus-ci.com/task/6252307617153024), [checks-cirrus-freebsd-14](https://cirrus-ci.com/task/4844932733599744)
Approved by: Amanieu
Pushing a6c94f4c02f597e1db4f4dd23c1ad7f6072fd8ac to main...
<!-- homu: {"type":"BuildCompleted","approved_by":"Amanieu","base_ref":"main","builders":{"checks-actions":"https://github.com/rust-lang/libc/actions/runs/5187325927/jobs/9350782716","checks-cirrus-freebsd-12":"https://cirrus-ci.com/task/5126407710310400","checks-cirrus-freebsd-13":"https://cirrus-ci.com/task/6252307617153024","checks-cirrus-freebsd-14":"https://cirrus-ci.com/task/4844932733599744"},"merge_sha":"a6c94f4c02f597e1db4f4dd23c1ad7f6072fd8ac"} -->
|
2023-06-06T11:25:32Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 3,236
|
rust-lang__libc-3236
|
[
"3234"
] |
0b758afcdc34c9a72508a481ba151857d0b469de
|
diff --git a/Cargo.toml b/Cargo.toml
index dd7c11a1102e4..326310c934926 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "libc"
-version = "0.2.142"
+version = "0.2.143"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
|
diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml
index 83bfcba9c6b1e..f9540b4f5cf91 100644
--- a/libc-test/Cargo.toml
+++ b/libc-test/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "libc-test"
-version = "0.2.142"
+version = "0.2.143"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
build = "build.rs"
@@ -12,7 +12,7 @@ A test crate for the libc crate.
[dependencies.libc]
path = ".."
-version = "0.2.142"
+version = "0.2.143"
default-features = false
[build-dependencies]
|
libc test builds two different versions of libc
```
cd /Development/source/libc/libc-test
cargo test
```
In output:
```
Compiling libc v0.2.142
...
Compiling libc v0.2.142 (/Development/source/rust/libc)
```
At least on Haiku, this causes a linking error as the current libc on crates.io hasn't been updated with a fix to a linking issue, which has been fixed in my local repo (and has landed here, a new release hasn't been cut yet).
|
2023-05-06T00:14:56Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,213
|
rust-lang__libc-3213
|
[
"3190"
] |
f05d6a35b25288b143241ebb6b4b071618945431
|
diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs
index a4c1f708afd50..d8b2767669309 100644
--- a/src/unix/linux_like/linux/musl/mod.rs
+++ b/src/unix/linux_like/linux/musl/mod.rs
@@ -900,6 +900,13 @@ extern "C" {
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
+
+ pub fn getutxent() -> *mut utmpx;
+ pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
+ pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
+ pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
+ pub fn setutxent();
+ pub fn endutxent();
}
// Alias <foo> to <foo>64 to mimic glibc's LFS64 support
|
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
index 9bbdee0771b60..d39726f4260a7 100644
--- a/libc-test/semver/linux-gnu.txt
+++ b/libc-test/semver/linux-gnu.txt
@@ -617,12 +617,12 @@ dlinfo
dlmopen
endutxent
explicit_bzero
+fgetgrent_r
fgetspent_r
futimes
getauxval
getentropy
getgrent_r
-fgetgrent_r
getloadavg
getpt
getpwent_r
diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt
index 2db034f813be7..f6e293aa9b7fc 100644
--- a/libc-test/semver/linux-musl.txt
+++ b/libc-test/semver/linux-musl.txt
@@ -56,13 +56,22 @@ aio_return
aio_suspend
aio_write
aiocb
+asctime_r
+basename
clock_adjtime
copy_file_range
ctermid
+dirname
+eaccess
+endutxent
+euidaccess
explicit_bzero
futimes
getauxval
getloadavg
+getutxent
+getutxid
+getutxline
lio_listio
ntptimeval
open_wmemstream
@@ -71,14 +80,11 @@ prlimit
prlimit64
process_vm_readv
process_vm_writev
+pututxline
pwritev64
reallocarray
-timex
-euidaccess
-eaccess
-asctime_r
+setutxent
strftime
strftime_l
strptime
-dirname
-basename
+timex
|
utmp function family missing on musl
Hello,
functions like getutxent, setutxent, endutxent, struct utmpx, etc. are missing from the musl implementation ( src/unix/linux_like/linux/musl/mod.rs ), even though those functions are implemented in musl (see https://git.musl-libc.org/cgit/musl/tree/include/utmpx.h ).
As reference, see this [commit](https://github.com/rust-lang/libc/commit/98fd3188e7d46db84d321475344f2f82d958b0c7) which added the function for solaris, as well as the man page: https://linux.die.net/man/3/endutxent
|
2023-04-21T19:27:17Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,136
|
rust-lang__libc-3136
|
[
"3132"
] |
973c3e1fb8acd198f197fa2a25d99184fa1f5f4b
|
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index 2d84ec662d58c..1ee1ec70d044e 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -730,27 +730,6 @@ pub const PF_NFC: ::c_int = AF_NFC;
pub const PF_VSOCK: ::c_int = AF_VSOCK;
pub const PF_XDP: ::c_int = AF_XDP;
-/* DCCP socket options */
-pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1;
-pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2;
-pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3;
-pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4;
-pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5;
-pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6;
-pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10;
-pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11;
-pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12;
-pub const DCCP_SOCKOPT_CCID: ::c_int = 13;
-pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14;
-pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15;
-pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16;
-pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17;
-pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128;
-pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192;
-
-/// maximum number of services provided on the same listening port
-pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32;
-
pub const SIGEV_THREAD_ID: ::c_int = 4;
pub const BUFSIZ: ::c_uint = 8192;
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index be12190b45dfc..b2246300fd37b 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -3788,6 +3788,27 @@ pub const SCTP_PR_SCTP_ALL: ::c_int = 1 << 7;
pub const SCTP_NOTIFICATION: ::c_int = MSG_NOTIFICATION;
pub const SCTP_EOF: ::c_int = ::MSG_FIN;
+/* DCCP socket options */
+pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1;
+pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2;
+pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3;
+pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4;
+pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5;
+pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6;
+pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10;
+pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11;
+pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12;
+pub const DCCP_SOCKOPT_CCID: ::c_int = 13;
+pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14;
+pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15;
+pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16;
+pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17;
+pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128;
+pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192;
+
+/// maximum number of services provided on the same listening port
+pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32;
+
f! {
pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)
|
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
index f34e0681c398a..1f2721fa0fc04 100644
--- a/libc-test/semver/linux-gnu.txt
+++ b/libc-test/semver/linux-gnu.txt
@@ -33,23 +33,6 @@ CGROUP2_SUPER_MAGIC
CGROUP_SUPER_MAGIC
CODA_SUPER_MAGIC
CRAMFS_MAGIC
-DCCP_SERVICE_LIST_MAX_LEN
-DCCP_SOCKOPT_AVAILABLE_CCIDS
-DCCP_SOCKOPT_CCID
-DCCP_SOCKOPT_CCID_RX_INFO
-DCCP_SOCKOPT_CCID_TX_INFO
-DCCP_SOCKOPT_CHANGE_L
-DCCP_SOCKOPT_CHANGE_R
-DCCP_SOCKOPT_GET_CUR_MPS
-DCCP_SOCKOPT_PACKET_SIZE
-DCCP_SOCKOPT_QPOLICY_ID
-DCCP_SOCKOPT_QPOLICY_TXQLEN
-DCCP_SOCKOPT_RECV_CSCOV
-DCCP_SOCKOPT_RX_CCID
-DCCP_SOCKOPT_SEND_CSCOV
-DCCP_SOCKOPT_SERVER_TIMEWAIT
-DCCP_SOCKOPT_SERVICE
-DCCP_SOCKOPT_TX_CCID
DEAD_PROCESS
DEBUGFS_MAGIC
DEVPTS_SUPER_MAGIC
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index daccc3c38ddb4..1b17b62d963ba 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -334,6 +334,23 @@ DAY_4
DAY_5
DAY_6
DAY_7
+DCCP_SERVICE_LIST_MAX_LEN
+DCCP_SOCKOPT_AVAILABLE_CCIDS
+DCCP_SOCKOPT_CCID
+DCCP_SOCKOPT_CCID_RX_INFO
+DCCP_SOCKOPT_CCID_TX_INFO
+DCCP_SOCKOPT_CHANGE_L
+DCCP_SOCKOPT_CHANGE_R
+DCCP_SOCKOPT_GET_CUR_MPS
+DCCP_SOCKOPT_PACKET_SIZE
+DCCP_SOCKOPT_QPOLICY_ID
+DCCP_SOCKOPT_QPOLICY_TXQLEN
+DCCP_SOCKOPT_RECV_CSCOV
+DCCP_SOCKOPT_RX_CCID
+DCCP_SOCKOPT_SEND_CSCOV
+DCCP_SOCKOPT_SERVER_TIMEWAIT
+DCCP_SOCKOPT_SERVICE
+DCCP_SOCKOPT_TX_CCID
DT_UNKNOWN
D_FMT
D_T_FMT
|
dccp exports are tied to glibc on linux
the various DCCP_ exports such as `DCCP_SOCKOPT_SERVICE` are tied to `linux/gnu` (or android). that means they are not present on linux/musl.
however, these defines don't come from the libc. for instance:
```c
#include <sys/socket.h>
#include <stdio.h>
int main(void) {
printf("%d\n", DCCP_SOCKOPT_SERVICE);
}
```
fails to compile on either glibc or musl. this is because they actually come from `<linux/dccp.h>`.
since they come from the kernel headers, they should also be present in linux/musl/mod.rs (or wherever they are meant to be defined here.)
(mostly an upstream version of a downstream bug report: https://github.com/rust-lang/socket2/issues/405)
|
(apologies i didn't provide a rust example, but this is reasonably obvious given the linked downstream issue)
Maybe it's as simple as move the constant from the GNU (and Android) locations:
* https://github.com/rust-lang/libc/blob/5e98ea33195cc867faad2355f16c9bef1dad6a47/src/unix/linux_like/linux/gnu/mod.rs#L733-L749
* https://github.com/rust-lang/libc/blob/106b57a796145c42f9a385a2a8cf764abbc66624/src/unix/linux_like/android/mod.rs#L1394-L1410
To `linux_like/mod.rs`? https://github.com/rust-lang/libc/blob/106b57a796145c42f9a385a2a8cf764abbc66624/src/unix/linux_like/mod.rs
> To linux_like/mod.rs?
that sounds like it would be correct in terms of API surface to me
|
2023-03-03T22:26:55Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 3,086
|
rust-lang__libc-3086
|
[
"3085"
] |
f4d5a669c44fa302cdf7c047ae1923c0f19b861e
|
diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs
index 5c6aebde23b01..ea1ae466b2df6 100644
--- a/src/fuchsia/mod.rs
+++ b/src/fuchsia/mod.rs
@@ -2602,6 +2602,7 @@ pub const PR_SET_MM_MAP: ::c_int = 14;
pub const PR_SET_MM_MAP_SIZE: ::c_int = 15;
pub const PR_SET_PTRACER: ::c_int = 0x59616d61;
+pub const PR_SET_PTRACER_ANY: ::c_ulong = 0xffffffffffffffff;
pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36;
pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37;
diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs
index f2024900cbca9..b30939a2dc00e 100644
--- a/src/unix/linux_like/emscripten/mod.rs
+++ b/src/unix/linux_like/emscripten/mod.rs
@@ -1119,6 +1119,7 @@ pub const PR_SET_MM_MAP: ::c_int = 14;
pub const PR_SET_MM_MAP_SIZE: ::c_int = 15;
pub const PR_SET_PTRACER: ::c_int = 0x59616d61;
+pub const PR_SET_PTRACER_ANY: ::c_ulong = 0xffffffffffffffff;
pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36;
pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37;
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index 02cfeef2902c9..3481dcc044c50 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -2041,6 +2041,7 @@ pub const PR_SET_MM_MAP: ::c_int = 14;
pub const PR_SET_MM_MAP_SIZE: ::c_int = 15;
pub const PR_SET_PTRACER: ::c_int = 0x59616d61;
+pub const PR_SET_PTRACER_ANY: ::c_ulong = 0xffffffffffffffff;
pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36;
pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37;
|
diff --git a/libc-test/semver/fuchsia.txt b/libc-test/semver/fuchsia.txt
index 804b27093095a..5e7213c0bea25 100644
--- a/libc-test/semver/fuchsia.txt
+++ b/libc-test/semver/fuchsia.txt
@@ -671,6 +671,7 @@ PR_SET_NAME
PR_SET_NO_NEW_PRIVS
PR_SET_PDEATHSIG
PR_SET_PTRACER
+PR_SET_PTRACER_ANY
PR_SET_SECCOMP
PR_SET_SECUREBITS
PR_SET_THP_DISABLE
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index 6d9714b2e4a3f..2907fc09e219f 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -1800,6 +1800,7 @@ PR_SET_NAME
PR_SET_NO_NEW_PRIVS
PR_SET_PDEATHSIG
PR_SET_PTRACER
+PR_SET_PTRACER_ANY
PR_SET_SECCOMP
PR_SET_SECUREBITS
PR_SET_THP_DISABLE
|
Missing `PR_SET_PTRACER_ANY`
[`PR_SET_PTRACER`](https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/prctl.h#L155) is present (https://docs.rs/libc/latest/libc/constant.PR_SET_PTRACER.html) but [`PR_SET_PTRACER_ANY`](https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/prctl.h#L156) is missing (https://docs.rs/libc/latest/libc/constant.PR_SET_PTRACER.html?search=PR_SET_PTRACER_ANY).
|
2023-01-23T03:37:22Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,034
|
rust-lang__libc-3034
|
[
"3033"
] |
c059d435347adb30d9ffc2c79d844756dd576443
|
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index f31f341e2e54d..175a49cd6696c 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -946,6 +946,8 @@ pub const ELFOSABI_ARM_AEABI: u8 = 64;
// linux/sched.h
pub const CLONE_NEWTIME: ::c_int = 0x80;
+pub const CLONE_CLEAR_SIGHAND: ::c_int = 0x100000000;
+pub const CLONE_INTO_CGROUP: ::c_int = 0x200000000;
// linux/keyctl.h
pub const KEYCTL_DH_COMPUTE: u32 = 23;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index eb0dcb89a58c5..8edb020b6b70f 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -3841,6 +3841,7 @@ fn test_linux(target: &str) {
| "MADV_POPULATE_READ"
| "MADV_POPULATE_WRITE"
if musl => true,
+ "CLONE_CLEAR_SIGHAND" | "CLONE_INTO_CGROUP" => true,
// kernel 6.1 minimum
"MADV_COLLAPSE" => true,
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
index 8f19e5866a72d..c37333b964046 100644
--- a/libc-test/semver/linux-gnu.txt
+++ b/libc-test/semver/linux-gnu.txt
@@ -32,6 +32,8 @@ BTRFS_SUPER_MAGIC
CGROUP2_SUPER_MAGIC
CGROUP_SUPER_MAGIC
CLONE_NEWTIME
+CLONE_CLEAR_SIGHAND
+CLONE_INTO_CGROUP
CODA_SUPER_MAGIC
CRAMFS_MAGIC
DEAD_PROCESS
@@ -666,4 +668,4 @@ getmntent_r
putpwent
putgrent
execveat
-close_range
\ No newline at end of file
+close_range
|
Various Linux CLONE_* flags are missing
The complete list of the flags can be seen e.g. here:
https://elixir.bootlin.com/linux/v6.0.12/source/include/uapi/linux/sched.h#L11
The ones that are missing from libc at the moment seem to be:
```rust
pub const CLONE_PIDFD: ::c_int = 0x1000;
pub const CLONE_CLEAR_SIGHAND: ::c_int = 0x100000000;
pub const CLONE_INTO_CGROUP: ::c_int = 0x200000000;
pub const CLONE_NEWTIME: ::c_int = 0x80;
```
I believe they should be added to this list:
https://github.com/rust-lang/libc/blob/855a6fc48ab1634ef01836d6493d08b119bdd424/src/unix/linux_like/mod.rs#L1117
Sadly I've got my hands full at the moment, so I can't exactly patch it and see if it works, but as this is pretty minor and seems easy to fix, I thought I'd report it anyway.
|
2022-12-10T21:57:24Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 3,003
|
rust-lang__libc-3003
|
[
"3002"
] |
73c25f4e9d66054d1496c693b72d60caea00c4a9
|
diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs
index 25291c2306115..2a894a602502e 100644
--- a/src/unix/linux_like/linux/musl/mod.rs
+++ b/src/unix/linux_like/linux/musl/mod.rs
@@ -590,6 +590,8 @@ pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
+pub const PIDFD_NONBLOCK: ::c_uint = O_NONBLOCK as ::c_uint;
+
pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
|
diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt
index 7af14189312d1..9fbb9032c31bf 100644
--- a/libc-test/semver/linux-musl.txt
+++ b/libc-test/semver/linux-musl.txt
@@ -20,6 +20,7 @@ LIO_WRITE
PF_IB
PF_MPLS
PF_XDP
+PIDFD_NONBLOCK
PR_SET_VMA
PR_SET_VMA_ANON_NAME
adjtimex
@@ -54,4 +55,4 @@ asctime_r
strftime
strptime
dirname
-basename
\ No newline at end of file
+basename
|
`PIDFD_NONBLOCK` missing from Linux musl toolchains
`PIDFD_NONBLOCK` is an alias for `O_NONBLOCK` used with [`pidfd_open`](https://man7.org/linux/man-pages/man2/pidfd_open.2.html).
It is missing from all the `musl` toolchains.
These toolchains do however have `SYS_pidfd_open` which would suggest they should have this value.
|
2022-11-17T18:49:00Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 2,967
|
rust-lang__libc-2967
|
[
"2909"
] |
998e88630ebbdceda33774cd6531335254f9769b
|
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index 4421906a4b77d..15174bc306419 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -2621,6 +2621,24 @@ pub const SIOCGIFSLAVE: ::c_ulong = 0x00008929;
pub const SIOCSIFSLAVE: ::c_ulong = 0x00008930;
pub const SIOCADDMULTI: ::c_ulong = 0x00008931;
pub const SIOCDELMULTI: ::c_ulong = 0x00008932;
+pub const SIOCGIFINDEX: ::c_ulong = 0x00008933;
+pub const SIOGIFINDEX: ::c_ulong = SIOCGIFINDEX;
+pub const SIOCSIFPFLAGS: ::c_ulong = 0x00008934;
+pub const SIOCGIFPFLAGS: ::c_ulong = 0x00008935;
+pub const SIOCDIFADDR: ::c_ulong = 0x00008936;
+pub const SIOCSIFHWBROADCAST: ::c_ulong = 0x00008937;
+pub const SIOCGIFCOUNT: ::c_ulong = 0x00008938;
+pub const SIOCGIFBR: ::c_ulong = 0x00008940;
+pub const SIOCSIFBR: ::c_ulong = 0x00008941;
+pub const SIOCGIFTXQLEN: ::c_ulong = 0x00008942;
+pub const SIOCSIFTXQLEN: ::c_ulong = 0x00008943;
+pub const SIOCETHTOOL: ::c_ulong = 0x00008946;
+pub const SIOCGMIIPHY: ::c_ulong = 0x00008947;
+pub const SIOCGMIIREG: ::c_ulong = 0x00008948;
+pub const SIOCSMIIREG: ::c_ulong = 0x00008949;
+pub const SIOCWANDEV: ::c_ulong = 0x0000894A;
+pub const SIOCOUTQNSD: ::c_ulong = 0x0000894B;
+pub const SIOCGSKNS: ::c_ulong = 0x0000894C;
pub const SIOCDARP: ::c_ulong = 0x00008953;
pub const SIOCGARP: ::c_ulong = 0x00008954;
pub const SIOCSARP: ::c_ulong = 0x00008955;
|
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index 96be968d8b6c8..d8fa593c67795 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -2168,38 +2168,56 @@ SIOCADDRT
SIOCDARP
SIOCDELMULTI
SIOCDELRT
+SIOCDIFADDR
SIOCDRARP
+SIOCETHTOOL
SIOCGARP
SIOCGIFADDR
+SIOCGIFBR
SIOCGIFBRDADDR
SIOCGIFCONF
+SIOCGIFCOUNT
SIOCGIFDSTADDR
SIOCGIFENCAP
SIOCGIFFLAGS
SIOCGIFHWADDR
+SIOCGIFINDEX
SIOCGIFMAP
SIOCGIFMEM
SIOCGIFMETRIC
SIOCGIFMTU
SIOCGIFNAME
SIOCGIFNETMASK
+SIOCGIFPFLAGS
SIOCGIFSLAVE
+SIOCGIFTXQLEN
SIOCGRARP
+SIOCGSKNS
+SIOGIFINDEX
+SIOCGMIIPHY
+SIOCGMIIREG
SIOCSARP
SIOCSIFADDR
+SIOCSIFBR
SIOCSIFBRDADDR
SIOCSIFDSTADDR
SIOCSIFENCAP
SIOCSIFFLAGS
SIOCSIFHWADDR
+SIOCSIFHWBROADCAST
SIOCSIFLINK
SIOCSIFMAP
SIOCSIFMEM
SIOCSIFMETRIC
SIOCSIFMTU
SIOCSIFNETMASK
+SIOCSIFPFLAGS
SIOCSIFSLAVE
+SIOCSIFTXQLEN
+SIOCSMIIREG
SIOCSRARP
+SIOCOUTQNSD
+SIOCWANDEV
SI_LOAD_SHIFT
SND_CNT
SND_MAX
|
missing some SIOC defines from the linux header
the socket ioctl() flags
SIOCGIFINDEX
SIOCSIFPFLAGS
SIOCGIFPFLAGS
SIOCDIFADDR
SIOCSIFHWBROADCAST
...
SIOCOUTQNSD
are missing
basically those covering the value range 0x8933 to 0x894B according to include/uapi/linux/sockios.h since kernel 4.9
|
2022-10-17T20:21:34Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 2,964
|
rust-lang__libc-2964
|
[
"2926"
] |
e4e865d1c3bd3b7741fa408da8e145e7dd8724b3
|
diff --git a/src/windows/mod.rs b/src/windows/mod.rs
index acb0de9895170..916019b1f211b 100644
--- a/src/windows/mod.rs
+++ b/src/windows/mod.rs
@@ -509,6 +509,14 @@ extern "C" {
pub fn aligned_malloc(size: size_t, alignment: size_t) -> *mut c_void;
#[link_name = "_aligned_free"]
pub fn aligned_free(ptr: *mut ::c_void);
+ #[link_name = "_putenv"]
+ pub fn putenv(envstring: *const ::c_char) -> ::c_int;
+ #[link_name = "_wputenv"]
+ pub fn wputenv(envstring: *const ::wchar_t) -> ::c_int;
+ #[link_name = "_putenv_s"]
+ pub fn putenv_s(envstring: *const ::c_char, value_string: *const ::c_char) -> ::errno_t;
+ #[link_name = "_wputenv_s"]
+ pub fn wputenv_s(envstring: *const ::wchar_t, value_string: *const ::wchar_t) -> ::errno_t;
}
extern "system" {
|
diff --git a/libc-test/semver/windows.txt b/libc-test/semver/windows.txt
index ddb97a8d8ea43..1ddf031b1440f 100644
--- a/libc-test/semver/windows.txt
+++ b/libc-test/semver/windows.txt
@@ -261,6 +261,8 @@ popen
printf
ptrdiff_t
putchar
+putenv
+putenv_s
puts
raise
rand
@@ -340,6 +342,8 @@ wexecve
wexecvp
wexecvpe
wopen
+wputenv
+wputenv_s
write
wrmdir
wsetlocale
|
putenv and friends are missing on Windows
<!--
Please provide the below information:
* the target triple
* link to the documentation of the API showing the type signatures, how to use
it, etc.
In general, just please consider that the people who can help you are all very
busy, they will be helping you in their free time, there are a lot of people in
need of help so they need to prioritize to which issues they devote their free
time, etc. So try to give most of the information upfront, be concise, show
small self-contained examples (nobody has time to create a new cargo project,
set up dependencies,...), etc. Help us help you.
-->
[_putenv, _wputenv](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/putenv-wputenv?view=msvc-170), [_putenv_s, _wputenv_s](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/putenv-s-wputenv-s?view=msvc-170) are currently missing.
They're important because, on Windows, `std::env::set_var` is implemented via `SetEnvironmentVariableW` WinAPI, which has a separate table from CRT (libc) implementation. As a result, if you're linking Rust with C code and want C code to see some dynamically set environment variables, `putenv` and friends are your only option.
|
More generally, it seems that most of the functions from [Process and Environment Control
](https://learn.microsoft.com/en-us/cpp/c-runtime-library/process-and-environment-control?view=msvc-170) page are currently missing.
|
2022-10-16T11:05:09Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 2,940
|
rust-lang__libc-2940
|
[
"2917",
"2918"
] |
dc3084a1a375411fb09be303b80a28f0fa6e3986
|
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index cee87ffbfc490..a9438ef57a3c2 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -121,6 +121,9 @@ pub type pthread_introspection_hook_t =
extern "C" fn(event: ::c_uint, thread: ::pthread_t, addr: *mut ::c_void, size: ::size_t);
pub type pthread_jit_write_callback_t = ::Option<extern "C" fn(ctx: *mut ::c_void) -> ::c_int>;
+pub type os_unfair_lock = os_unfair_lock_s;
+pub type os_unfair_lock_t = *mut os_unfair_lock;
+
pub type vm_statistics_t = *mut vm_statistics;
pub type vm_statistics_data_t = vm_statistics;
pub type vm_statistics64_t = *mut vm_statistics64;
@@ -1295,6 +1298,10 @@ s_no_extra_traits! {
pub l2p_contigbytes: ::off_t,
pub l2p_devoffset: ::off_t,
}
+
+ pub struct os_unfair_lock_s {
+ _os_unfair_lock_opaque: u32,
+ }
}
impl siginfo_t {
@@ -2576,6 +2583,27 @@ cfg_if! {
l2p_devoffset.hash(state);
}
}
+ impl PartialEq for os_unfair_lock {
+ fn eq(&self, other: &os_unfair_lock) -> bool {
+ self._os_unfair_lock_opaque == other._os_unfair_lock_opaque
+ }
+ }
+
+ impl Eq for os_unfair_lock {}
+
+ impl ::fmt::Debug for os_unfair_lock {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("os_unfair_lock")
+ .field("_os_unfair_lock_opaque", &self._os_unfair_lock_opaque)
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for os_unfair_lock {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self._os_unfair_lock_opaque.hash(state);
+ }
+ }
}
}
@@ -3863,6 +3891,10 @@ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
__opaque: [0; __PTHREAD_RWLOCK_SIZE__],
};
+pub const OS_UNFAIR_LOCK_INIT: os_unfair_lock = os_unfair_lock {
+ _os_unfair_lock_opaque: 0,
+};
+
pub const MINSIGSTKSZ: ::size_t = 32768;
pub const SIGSTKSZ: ::size_t = 131072;
@@ -5221,6 +5253,12 @@ extern "C" {
pub fn pthread_jit_write_freeze_callbacks_np();
pub fn pthread_cpu_number_np(cpu_number_out: *mut ::size_t) -> ::c_int;
+ pub fn os_unfair_lock_lock(lock: os_unfair_lock_t);
+ pub fn os_unfair_lock_trylock(lock: os_unfair_lock_t) -> bool;
+ pub fn os_unfair_lock_unlock(lock: os_unfair_lock_t);
+ pub fn os_unfair_lock_assert_owner(lock: os_unfair_lock_t);
+ pub fn os_unfair_lock_assert_not_owner(lock: os_unfair_lock_t);
+
pub fn thread_policy_set(
thread: thread_t,
flavor: thread_policy_flavor_t,
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 0e56050b008de..5376c46860d6d 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -231,6 +231,7 @@ fn test_apple(target: &str) {
"netinet/ip.h",
"netinet/tcp.h",
"netinet/udp.h",
+ "os/lock.h",
"poll.h",
"pthread.h",
"pthread_spis.h",
@@ -2442,6 +2443,8 @@ fn test_emscripten(target: &str) {
// Just pass all these through, no need for a "struct" prefix
"FILE" | "fd_set" | "Dl_info" | "DIR" => ty.to_string(),
+ "os_unfair_lock" => "struct os_unfair_lock_s".to_string(),
+
t if is_union => format!("union {}", t),
t if t.ends_with("_t") => t.to_string(),
diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt
index cb646e686bfe8..83cd77d9a23db 100644
--- a/libc-test/semver/apple.txt
+++ b/libc-test/semver/apple.txt
@@ -1003,6 +1003,7 @@ OFDEL
OFILL
OLD_TIME
ONOEOT
+OS_UNFAIR_LOCK_INIT
OXTABS
O_ASYNC
O_DSYNC
@@ -1993,6 +1994,14 @@ open_memstream
open_wmemstream
openat
openpty
+os_unfair_lock
+os_unfair_lock_s
+os_unfair_lock_t
+os_unfair_lock_lock
+os_unfair_lock_trylock
+os_unfair_lock_unlock
+os_unfair_lock_assert_owner
+os_unfair_lock_assert_not_owner
pause
policy_t
popen
|
os_unfair_lock_t on macOS
It'd be nice to include the [os_unfair_lock API](https://developer.apple.com/documentation/os/synchronization?language=objc) on macOS:
- [os_unfair_lock](https://developer.apple.com/documentation/os/os_unfair_lock?language=objc)
- [os_unfair_lock_t](https://developer.apple.com/documentation/os/os_unfair_lock_t?language=objc)
- [OS_UNFAIR_LOCK_INIT](https://developer.apple.com/documentation/os/os_unfair_lock_init?language=objc)
- [os_unfair_lock_lock](https://developer.apple.com/documentation/os/1646466-os_unfair_lock_lock?language=objc)
- [os_unfair_lock_trylock](https://developer.apple.com/documentation/os/1646469-os_unfair_lock_trylock?language=objc)
- [os_unfair_lock_unlock](https://developer.apple.com/documentation/os/1646463-os_unfair_lock_unlock?language=objc)
- [os_unfair_lock_assert_owner](https://developer.apple.com/documentation/os/2976314-os_unfair_lock_assert_owner?language=objc)
- [os_unfair_lock_assert_not_owner](https://developer.apple.com/documentation/os/2976313-os_unfair_lock_assert_not_owner?language=objc)
Add os_unfair_lock signatures/primitives
This pull request resolves #2917 by adding bindings to the `os_unfair_lock` API found in Apple operating systems. I've added the following code:
- `os_unfair_lock`, which is an opaque, 32-bit structure.
- `os_unfair_lock_t`, which is a mutable pointer to an `os_unfair_lock`.
- The constant `OS_UNFAIR_LOCK_INIT`, which just initializes a lock to zero.
- The functions `os_unfair_lock_lock`, `os_unfair_lock_trylock`, `os_unfair_lock_unlock`, `os_unfair_lock_assert_owner` and `os_unfair_lock_assert_not_owner`, which are based on the signatures they have [here](https://opensource.apple.com/source/libplatform/libplatform-125/include/os/lock.h.auto.html).
This is my first time opening a PR here! I'm excited, but let me know if I've missed anything.
|
2022-10-05T01:43:33Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 2,897
|
rust-lang__libc-2897
|
[
"1876"
] |
aec8514342e2b03924f4d17198ce77eb0a12fda5
|
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index 88bc935f632b3..6b86dea32b746 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -954,6 +954,8 @@ pub const NT_LWPSTATUS: ::c_int = 16;
pub const NT_LWPSINFO: ::c_int = 17;
pub const NT_PRFPXREG: ::c_int = 20;
+pub const ELFOSABI_ARM_AEABI: u8 = 64;
+
// linux/keyctl.h
pub const KEYCTL_DH_COMPUTE: u32 = 23;
pub const KEYCTL_PKEY_QUERY: u32 = 24;
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index a9a87691aa151..9457019a4d095 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -1299,6 +1299,181 @@ pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 248;
pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY;
+// elf.h - Fields in the e_ident array.
+pub const EI_NIDENT: usize = 16;
+
+pub const EI_MAG0: usize = 0;
+pub const ELFMAG0: u8 = 0x7f;
+pub const EI_MAG1: usize = 1;
+pub const ELFMAG1: u8 = b'E';
+pub const EI_MAG2: usize = 2;
+pub const ELFMAG2: u8 = b'L';
+pub const EI_MAG3: usize = 3;
+pub const ELFMAG3: u8 = b'F';
+pub const SELFMAG: usize = 4;
+
+pub const EI_CLASS: usize = 4;
+pub const ELFCLASSNONE: u8 = 0;
+pub const ELFCLASS32: u8 = 1;
+pub const ELFCLASS64: u8 = 2;
+pub const ELFCLASSNUM: usize = 3;
+
+pub const EI_DATA: usize = 5;
+pub const ELFDATANONE: u8 = 0;
+pub const ELFDATA2LSB: u8 = 1;
+pub const ELFDATA2MSB: u8 = 2;
+pub const ELFDATANUM: usize = 3;
+
+pub const EI_VERSION: usize = 6;
+
+pub const EI_OSABI: usize = 7;
+pub const ELFOSABI_NONE: u8 = 0;
+pub const ELFOSABI_SYSV: u8 = 0;
+pub const ELFOSABI_HPUX: u8 = 1;
+pub const ELFOSABI_NETBSD: u8 = 2;
+pub const ELFOSABI_GNU: u8 = 3;
+pub const ELFOSABI_LINUX: u8 = ELFOSABI_GNU;
+pub const ELFOSABI_SOLARIS: u8 = 6;
+pub const ELFOSABI_AIX: u8 = 7;
+pub const ELFOSABI_IRIX: u8 = 8;
+pub const ELFOSABI_FREEBSD: u8 = 9;
+pub const ELFOSABI_TRU64: u8 = 10;
+pub const ELFOSABI_MODESTO: u8 = 11;
+pub const ELFOSABI_OPENBSD: u8 = 12;
+pub const ELFOSABI_ARM: u8 = 97;
+pub const ELFOSABI_STANDALONE: u8 = 255;
+
+pub const EI_ABIVERSION: usize = 8;
+
+pub const EI_PAD: usize = 9;
+
+// elf.h - Legal values for e_type (object file type).
+pub const ET_NONE: u16 = 0;
+pub const ET_REL: u16 = 1;
+pub const ET_EXEC: u16 = 2;
+pub const ET_DYN: u16 = 3;
+pub const ET_CORE: u16 = 4;
+pub const ET_NUM: u16 = 5;
+pub const ET_LOOS: u16 = 0xfe00;
+pub const ET_HIOS: u16 = 0xfeff;
+pub const ET_LOPROC: u16 = 0xff00;
+pub const ET_HIPROC: u16 = 0xffff;
+
+// elf.h - Legal values for e_machine (architecture).
+pub const EM_NONE: u16 = 0;
+pub const EM_M32: u16 = 1;
+pub const EM_SPARC: u16 = 2;
+pub const EM_386: u16 = 3;
+pub const EM_68K: u16 = 4;
+pub const EM_88K: u16 = 5;
+pub const EM_860: u16 = 7;
+pub const EM_MIPS: u16 = 8;
+pub const EM_S370: u16 = 9;
+pub const EM_MIPS_RS3_LE: u16 = 10;
+pub const EM_PARISC: u16 = 15;
+pub const EM_VPP500: u16 = 17;
+pub const EM_SPARC32PLUS: u16 = 18;
+pub const EM_960: u16 = 19;
+pub const EM_PPC: u16 = 20;
+pub const EM_PPC64: u16 = 21;
+pub const EM_S390: u16 = 22;
+pub const EM_V800: u16 = 36;
+pub const EM_FR20: u16 = 37;
+pub const EM_RH32: u16 = 38;
+pub const EM_RCE: u16 = 39;
+pub const EM_ARM: u16 = 40;
+pub const EM_FAKE_ALPHA: u16 = 41;
+pub const EM_SH: u16 = 42;
+pub const EM_SPARCV9: u16 = 43;
+pub const EM_TRICORE: u16 = 44;
+pub const EM_ARC: u16 = 45;
+pub const EM_H8_300: u16 = 46;
+pub const EM_H8_300H: u16 = 47;
+pub const EM_H8S: u16 = 48;
+pub const EM_H8_500: u16 = 49;
+pub const EM_IA_64: u16 = 50;
+pub const EM_MIPS_X: u16 = 51;
+pub const EM_COLDFIRE: u16 = 52;
+pub const EM_68HC12: u16 = 53;
+pub const EM_MMA: u16 = 54;
+pub const EM_PCP: u16 = 55;
+pub const EM_NCPU: u16 = 56;
+pub const EM_NDR1: u16 = 57;
+pub const EM_STARCORE: u16 = 58;
+pub const EM_ME16: u16 = 59;
+pub const EM_ST100: u16 = 60;
+pub const EM_TINYJ: u16 = 61;
+pub const EM_X86_64: u16 = 62;
+pub const EM_PDSP: u16 = 63;
+pub const EM_FX66: u16 = 66;
+pub const EM_ST9PLUS: u16 = 67;
+pub const EM_ST7: u16 = 68;
+pub const EM_68HC16: u16 = 69;
+pub const EM_68HC11: u16 = 70;
+pub const EM_68HC08: u16 = 71;
+pub const EM_68HC05: u16 = 72;
+pub const EM_SVX: u16 = 73;
+pub const EM_ST19: u16 = 74;
+pub const EM_VAX: u16 = 75;
+pub const EM_CRIS: u16 = 76;
+pub const EM_JAVELIN: u16 = 77;
+pub const EM_FIREPATH: u16 = 78;
+pub const EM_ZSP: u16 = 79;
+pub const EM_MMIX: u16 = 80;
+pub const EM_HUANY: u16 = 81;
+pub const EM_PRISM: u16 = 82;
+pub const EM_AVR: u16 = 83;
+pub const EM_FR30: u16 = 84;
+pub const EM_D10V: u16 = 85;
+pub const EM_D30V: u16 = 86;
+pub const EM_V850: u16 = 87;
+pub const EM_M32R: u16 = 88;
+pub const EM_MN10300: u16 = 89;
+pub const EM_MN10200: u16 = 90;
+pub const EM_PJ: u16 = 91;
+pub const EM_OPENRISC: u16 = 92;
+pub const EM_ARC_A5: u16 = 93;
+pub const EM_XTENSA: u16 = 94;
+pub const EM_AARCH64: u16 = 183;
+pub const EM_TILEPRO: u16 = 188;
+pub const EM_TILEGX: u16 = 191;
+pub const EM_ALPHA: u16 = 0x9026;
+
+// elf.h - Legal values for e_version (version).
+pub const EV_NONE: u32 = 0;
+pub const EV_CURRENT: u32 = 1;
+pub const EV_NUM: u32 = 2;
+
+// elf.h - Legal values for p_type (segment type).
+pub const PT_NULL: u32 = 0;
+pub const PT_LOAD: u32 = 1;
+pub const PT_DYNAMIC: u32 = 2;
+pub const PT_INTERP: u32 = 3;
+pub const PT_NOTE: u32 = 4;
+pub const PT_SHLIB: u32 = 5;
+pub const PT_PHDR: u32 = 6;
+pub const PT_TLS: u32 = 7;
+pub const PT_NUM: u32 = 8;
+pub const PT_LOOS: u32 = 0x60000000;
+pub const PT_GNU_EH_FRAME: u32 = 0x6474e550;
+pub const PT_GNU_STACK: u32 = 0x6474e551;
+pub const PT_GNU_RELRO: u32 = 0x6474e552;
+pub const PT_LOSUNW: u32 = 0x6ffffffa;
+pub const PT_SUNWBSS: u32 = 0x6ffffffa;
+pub const PT_SUNWSTACK: u32 = 0x6ffffffb;
+pub const PT_HISUNW: u32 = 0x6fffffff;
+pub const PT_HIOS: u32 = 0x6fffffff;
+pub const PT_LOPROC: u32 = 0x70000000;
+pub const PT_HIPROC: u32 = 0x7fffffff;
+
+// Legal values for p_flags (segment flags).
+pub const PF_X: u32 = 1 << 0;
+pub const PF_W: u32 = 1 << 1;
+pub const PF_R: u32 = 1 << 2;
+pub const PF_MASKOS: u32 = 0x0ff00000;
+pub const PF_MASKPROC: u32 = 0xf0000000;
+
+// elf.h - Legal values for a_type (entry type).
pub const AT_NULL: ::c_ulong = 0;
pub const AT_IGNORE: ::c_ulong = 1;
pub const AT_EXECFD: ::c_ulong = 2;
@@ -1951,26 +2126,6 @@ pub const RESOLVE_BENEATH: ::__u64 = 0x08;
pub const RESOLVE_IN_ROOT: ::__u64 = 0x10;
pub const RESOLVE_CACHED: ::__u64 = 0x20;
-// these are used in the p_type field of Elf32_Phdr and Elf64_Phdr, which has
-// the type Elf32Word and Elf64Word respectively. Luckily, both of those are u32
-// so we can use that type here to avoid having to cast.
-pub const PT_NULL: u32 = 0;
-pub const PT_LOAD: u32 = 1;
-pub const PT_DYNAMIC: u32 = 2;
-pub const PT_INTERP: u32 = 3;
-pub const PT_NOTE: u32 = 4;
-pub const PT_SHLIB: u32 = 5;
-pub const PT_PHDR: u32 = 6;
-pub const PT_TLS: u32 = 7;
-pub const PT_NUM: u32 = 8;
-pub const PT_LOOS: u32 = 0x60000000;
-pub const PT_GNU_EH_FRAME: u32 = 0x6474e550;
-pub const PT_GNU_STACK: u32 = 0x6474e551;
-pub const PT_GNU_RELRO: u32 = 0x6474e552;
-pub const PT_HIOS: u32 = 0x6fffffff;
-pub const PT_LOPROC: u32 = 0x70000000;
-pub const PT_HIPROC: u32 = 0x7fffffff;
-
// linux/if_ether.h
pub const ETH_ALEN: ::c_int = 6;
pub const ETH_HLEN: ::c_int = 14;
|
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
index 14c4ab9cfe488..27bd593843951 100644
--- a/libc-test/semver/linux-gnu.txt
+++ b/libc-test/semver/linux-gnu.txt
@@ -55,6 +55,7 @@ DEBUGFS_MAGIC
DEVPTS_SUPER_MAGIC
ECRYPTFS_SUPER_MAGIC
EFS_SUPER_MAGIC
+ELFOSABI_ARM_AEABI
EMPTY
EXT2_SUPER_MAGIC
EXT3_SUPER_MAGIC
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index 5bdb3143d29f8..356107bd4daf2 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -364,6 +364,17 @@ EFD_NONBLOCK
EFD_SEMAPHORE
EHWPOISON
EISNAM
+EI_ABIVERSION
+EI_CLASS
+EI_DATA
+EI_MAG0
+EI_MAG1
+EI_MAG2
+EI_MAG3
+EI_NIDENT
+EI_OSABI
+EI_PAD
+EI_VERSION
EKEYEXPIRED
EKEYREJECTED
EKEYREVOKED
@@ -371,6 +382,33 @@ EL2HLT
EL2NSYNC
EL3HLT
EL3RST
+ELFCLASS32
+ELFCLASS64
+ELFCLASSNONE
+ELFCLASSNUM
+ELFDATA2LSB
+ELFDATA2MSB
+ELFDATANONE
+ELFDATANUM
+ELFMAG0
+ELFMAG1
+ELFMAG2
+ELFMAG3
+ELFOSABI_AIX
+ELFOSABI_ARM
+ELFOSABI_FREEBSD
+ELFOSABI_GNU
+ELFOSABI_HPUX
+ELFOSABI_IRIX
+ELFOSABI_LINUX
+ELFOSABI_MODESTO
+ELFOSABI_NETBSD
+ELFOSABI_NONE
+ELFOSABI_OPENBSD
+ELFOSABI_SOLARIS
+ELFOSABI_STANDALONE
+ELFOSABI_SYSV
+ELFOSABI_TRU64
ELIBACC
ELIBBAD
ELIBEXEC
@@ -379,6 +417,84 @@ ELIBSCN
ELNRNG
EMEDIUMTYPE
EMULTIHOP
+EM_386
+EM_68HC05
+EM_68HC08
+EM_68HC11
+EM_68HC12
+EM_68HC16
+EM_68K
+EM_860
+EM_88K
+EM_960
+EM_AARCH64
+EM_ALPHA
+EM_ARC
+EM_ARC_A5
+EM_ARM
+EM_AVR
+EM_COLDFIRE
+EM_CRIS
+EM_D10V
+EM_D30V
+EM_FAKE_ALPHA
+EM_FIREPATH
+EM_FR20
+EM_FR30
+EM_FX66
+EM_H8_300
+EM_H8_300H
+EM_H8_500
+EM_H8S
+EM_HUANY
+EM_IA_64
+EM_JAVELIN
+EM_M32
+EM_M32R
+EM_ME16
+EM_MIPS
+EM_MIPS_RS3_LE
+EM_MIPS_X
+EM_MMA
+EM_MMIX
+EM_MN10200
+EM_MN10300
+EM_NCPU
+EM_NDR1
+EM_NONE
+EM_OPENRISC
+EM_PARISC
+EM_PCP
+EM_PDSP
+EM_PJ
+EM_PPC
+EM_PPC64
+EM_PRISM
+EM_RCE
+EM_RH32
+EM_S370
+EM_S390
+EM_SH
+EM_SPARC
+EM_SPARC32PLUS
+EM_SPARCV9
+EM_ST100
+EM_ST19
+EM_ST7
+EM_ST9PLUS
+EM_STARCORE
+EM_SVX
+EM_TILEGX
+EM_TILEPRO
+EM_TINYJ
+EM_TRICORE
+EM_V800
+EM_V850
+EM_VAX
+EM_VPP500
+EM_X86_64
+EM_XTENSA
+EM_ZSP
ENAVAIL
ENOANO
ENOATTR
@@ -516,11 +632,24 @@ ETH_P_X25
ETH_ZLEN
ETOOMANYREFS
ETIME
+ET_CORE
+ET_DYN
+ET_EXEC
+ET_HIOS
+ET_HIPROC
+ET_LOOS
+ET_LOPROC
+ET_NONE
+ET_NUM
+ET_REL
EUCLEAN
EUNATCH
EUSERS
EV_CNT
+EV_CURRENT
EV_MAX
+EV_NONE
+EV_NUM
EXFULL
EXTA
EXTB
@@ -1521,6 +1650,8 @@ PF_IUCV
PF_KEY
PF_LLC
PF_LOCAL
+PF_MASKOS
+PF_MASKPROC
PF_NETBEUI
PF_NETLINK
PF_NETROM
@@ -1528,6 +1659,7 @@ PF_NFC
PF_PACKET
PF_PHONET
PF_PPPOX
+PF_R
PF_RDS
PF_ROSE
PF_ROUTE
@@ -1536,7 +1668,9 @@ PF_SECURITY
PF_SNA
PF_TIPC
PF_VSOCK
+PF_W
PF_WANPIPE
+PF_X
PF_X25
PIPE_BUF
PM_STR
@@ -1710,6 +1844,7 @@ PTRACE_SINGLESTEP
PTRACE_SYSCALL
PTRACE_TRACEME
PT_HIOS
+PT_HISUNW
PT_LOPROC
PT_HIPROC
PT_DYNAMIC
@@ -1719,11 +1854,14 @@ PT_GNU_STACK
PT_INTERP
PT_LOAD
PT_LOOS
+PT_LOSUNW
PT_NOTE
PT_NULL
PT_NUM
PT_PHDR
PT_SHLIB
+PT_SUNWBSS
+PT_SUNWSTACK
PT_TLS
P_ALL
P_PGID
@@ -2001,6 +2139,7 @@ SECCOMP_RET_TRACE
SECCOMP_RET_TRAP
SEEK_DATA
SEEK_HOLE
+SELFMAG
SEM_FAILED
SFD_CLOEXEC
SFD_NONBLOCK
|
libc should expose program header flag constants
It'd be useful if `libc` exposed `PF_X`, `PF_R`, `PF_W` and `PF_MASKPROC`.
You can currently get `PF_{R,W,X}` from the `elf` crate, but arguably `libc` is a more appropriate home for them and `PF_MASKPROC` should also be included.
|
Given that these flags exist in glibc's `elf.h`, these seem completely reasonable to add to the libc crate. Could you send a pull request adding them?
|
2022-09-03T13:30:47Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 2,828
|
rust-lang__libc-2828
|
[
"2091"
] |
a318a94adff0182bd35f32c170e530a8ebb6f6dd
|
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 5be6eb9be4a22..3315ed3e84f7e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -72,6 +72,10 @@ after a certain period. The steps are:
If you're using it, please comment on #XXX").
2. If we don't see any concerns for a while, do the change actually.
+## Supported target policy
+
+When Rust removes a support for a target, the libc crate also may remove the support anytime.
+
## Releasing your change to crates.io
Now that you've done the amazing job of landing your new API or your new
diff --git a/ci/README.md b/ci/README.md
index cfe3d53bc842f..c0de4f9edee96 100644
--- a/ci/README.md
+++ b/ci/README.md
@@ -39,9 +39,6 @@ The remaining architectures look like:
then otherwise runs tests normally.
* iOS builds need an extra linker flag currently, but beyond that they're built
as standard as everything else.
-* The rumprun target builds an entire kernel from the test suite and then runs
- it inside QEMU using the serial console to test whether it succeeded or
- failed.
* The BSD builds, currently OpenBSD and FreeBSD, use QEMU to boot up a system
and compile/run tests. More information on that below.
@@ -62,10 +59,6 @@ however. This strategy is used for all Linux architectures that aren't intel.
Note that one downside of this QEMU system is that threads are barely
implemented, so we're careful to not spawn many threads.
-For the rumprun target the only output is a kernel image, so we just use that
-plus the `rumpbake` command to create a full kernel image which is then run from
-within QEMU.
-
Finally, the fun part, the BSDs. Quite a few hoops are jumped through to get CI
working for these platforms, but the gist of it looks like:
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index f325bd46581b1..07a7412ac66b7 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -1568,10 +1568,7 @@ pub const IPPROTO_VRRP: ::c_int = 112;
/// Common Address Resolution Protocol
pub const IPPROTO_CARP: ::c_int = 112;
/// L2TPv3
-// TEMP: Disabled for now; this constant was added to NetBSD on 2017-02-16,
-// but isn't yet supported by the NetBSD rumprun kernel image used for
-// libc testing.
-//pub const IPPROTO_L2TP: ::c_int = 115;
+pub const IPPROTO_L2TP: ::c_int = 115;
/// SCTP
pub const IPPROTO_SCTP: ::c_int = 132;
/// PFSYNC
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index 2d72497a11ddf..1d57f28b2112d 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -346,14 +346,6 @@ cfg_if! {
} else if #[cfg(target_os = "emscripten")] {
#[link(name = "c")]
extern {}
- } else if #[cfg(all(target_os = "netbsd",
- feature = "rustc-dep-of-std",
- target_vendor = "rumprun"))] {
- // Since we don't use -nodefaultlibs on Rumprun, libc is always pulled
- // in automatically by the linker. We avoid passing it explicitly, as it
- // causes some versions of binutils to crash with an assertion failure.
- #[link(name = "m")]
- extern {}
} else if #[cfg(any(target_os = "macos",
target_os = "ios",
target_os = "watchos",
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index a3f940a3e823e..26f746b01f154 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -969,7 +969,6 @@ fn test_solarish(target: &str) {
fn test_netbsd(target: &str) {
assert!(target.contains("netbsd"));
- let rumprun = target.contains("rumprun");
let mut cfg = ctest_cfg();
cfg.flag("-Wno-deprecated-declarations");
@@ -1146,26 +1145,6 @@ fn test_netbsd(target: &str) {
"setrlimit" | "setrlimit64" | // non-int in 1st arg
"prlimit" | "prlimit64" | // non-int in 2nd arg
- // These functions presumably exist on netbsd but don't look like
- // they're implemented on rumprun yet, just let them slide for now.
- // Some of them look like they have headers but then don't have
- // corresponding actual definitions either...
- "shm_open" |
- "shm_unlink" |
- "syscall" |
- "mq_open" |
- "mq_close" |
- "mq_getattr" |
- "mq_notify" |
- "mq_receive" |
- "mq_send" |
- "mq_setattr" |
- "mq_timedreceive" |
- "mq_timedsend" |
- "mq_unlink" |
- "ptrace" |
- "sigaltstack" if rumprun => true,
-
_ => false,
}
});
|
Drop support for Rumprun
rustc dropped the support for Rumprun in https://github.com/rust-lang/rust/pull/82594. We could drop the support on libc as we did for CloudABI.
cc #2090
|
:+1: to removing this support, since Rust did.
We may want to establish a policy here. Under what circumstances can we remove support for a target? Can we always do so when Rust does, or do we have any special considerations to take into account if the target was previously tier 1/2 and available in stable? Can we count on projects to have older versions of libc in their lockfiles if they need to run on older targets?
I think the answer is that we can remove targets when Rust does, but this seems worth confirming and documenting.
Note: I'm holding this (dropping support Rumprun) off due to circumstances.
Agree, I also think we can drop support for Tier 3 once rustc does. And for tier 1/2, I'm not 100% sure but does rustc suddenly drop their support without downgrading generally? If rustc does it, I would think there was a reasonable reason (and we should consider if libc also should drop the support, it will highly depend on the situation, I imagine). I'm happy to document this as a "target support policy" or something else if needed.
@rust-lang/libc Feel free to comment here if you have different opinions.
> Agree, I also think we can drop support for Tier 3 once rustc does. And for tier 1/2, I'm not 100% sure but does rustc suddenly drop their support without downgrading generally?
Historically, Rust targets have dropped from as high as tier 1 to tier 3 as a single change, e.g. https://github.com/rust-lang/rfcs/pull/2837/files but have not been abruptly removed from tier 1 or tier 2.
|
2022-06-19T02:41:44Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 2,801
|
rust-lang__libc-2801
|
[
"2793"
] |
13afe8ac5322c400218e4df077a81462c04573e0
|
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index c59a360729361..da75b97a70008 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -3561,6 +3561,7 @@ pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 70;
pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 71;
pub const IP_BLOCK_SOURCE: ::c_int = 72;
pub const IP_UNBLOCK_SOURCE: ::c_int = 73;
+pub const IPV6_BOUND_IF: ::c_int = 125;
pub const TCP_NOPUSH: ::c_int = 4;
pub const TCP_NOOPT: ::c_int = 8;
|
diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt
index f9fd7692d31cf..61f820d701631 100644
--- a/libc-test/semver/apple.txt
+++ b/libc-test/semver/apple.txt
@@ -525,6 +525,7 @@ IPTOS_ECN_ECT0
IPTOS_ECN_ECT1
IPTOS_ECN_MASK
IPTOS_ECN_NOTECT
+IPV6_BOUND_IF
IPV6_CHECKSUM
IPV6_HOPLIMIT
IPV6_JOIN_GROUP
|
Consider adding socketopt const "IPV6_BOUND_IF" as we need to set/get bound interface on macOS
Consider add this to `bsd/apple/mod.rs`:
```rust
pub const IPV6_BOUND_IF: ::c_int = 125;
```
We really need this constant to perform modification on socket options(to bind socket to an interface, more specifically). Though we can temporarily define this on our own, but since `IP_BOUND_IF` is already defined in libc crate, we'd like to keep consistency.
I can make a simple PR if you agree to add this.
Thanks for your hard work.
|
5 days passed. Any feedback?
If it's in the headers I don't see a reason why a PR wouldn't be accepted.
|
2022-05-26T17:17:40Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 2,757
|
rust-lang__libc-2757
|
[
"2755"
] |
dff5aca2a10d886b13b66b92b959e769b74a0fb7
|
diff --git a/Cargo.toml b/Cargo.toml
index cc579890acbd2..a8b6559afd1ad 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "libc"
-version = "0.2.123"
+version = "0.2.124"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
|
diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml
index 5771f2a2dfc25..50021678ee0f1 100644
--- a/libc-test/Cargo.toml
+++ b/libc-test/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "libc-test"
-version = "0.2.123"
+version = "0.2.124"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
build = "build.rs"
@@ -12,7 +12,7 @@ A test crate for the libc crate.
[dependencies.libc]
path = ".."
-version = "0.2.123"
+version = "0.2.124"
default-features = false
[build-dependencies]
|
Release 0.2.124
Even though it's only been one day since the last release, would you consider making a new release? rust-lang/rust is currently broken for uclibc targets, and needs a new release of libc to fix them. That new release should include PR #2750 .
https://github.com/rust-lang/rust/issues/95866
|
2022-04-13T17:05:12Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 2,719
|
rust-lang__libc-2719
|
[
"2524"
] |
c8f31c96bba3b8850c8a2f1f61c5bffff697cbb4
|
diff --git a/build.rs b/build.rs
index 61acba646dca0..47eef2f802633 100644
--- a/build.rs
+++ b/build.rs
@@ -60,6 +60,11 @@ fn main() {
println!("cargo:rustc-cfg=libc_align");
}
+ // Rust >= 1.26 supports i128 and u128:
+ if rustc_minor_ver >= 26 || rustc_dep_of_std {
+ println!("cargo:rustc-cfg=libc_int128");
+ }
+
// Rust >= 1.30 supports `core::ffi::c_void`, so libc can just re-export it.
// Otherwise, it defines an incompatible type to retaining
// backwards-compatibility.
@@ -82,6 +87,11 @@ fn main() {
println!("cargo:rustc-cfg=libc_ptr_addr_of");
}
+ // Rust >= 1.57.0 allows assert! (and panics in general) in constants.
+ if rustc_minor_ver >= 57 || rustc_dep_of_std {
+ println!("cargo:rustc-cfg=libc_const_assert");
+ }
+
// #[thread_local] is currently unstable
if rustc_dep_of_std {
println!("cargo:rustc-cfg=libc_thread_local");
diff --git a/src/fixed_width_ints.rs b/src/fixed_width_ints.rs
index 014640855fa30..44cf8b592ea6c 100644
--- a/src/fixed_width_ints.rs
+++ b/src/fixed_width_ints.rs
@@ -18,3 +18,78 @@ pub type uint16_t = u16;
pub type uint32_t = u32;
#[deprecated(since = "0.2.55", note = "Use u64 instead.")]
pub type uint64_t = u64;
+
+cfg_if! {
+ if #[cfg(all(libc_int128, target_arch = "aarch64", not(target_os = "windows")))] {
+ // This introduces partial support for FFI with __int128 and
+ // equivalent types on platforms where Rust's definition is validated
+ // to match the standard C ABI of that platform.
+ //
+ // Rust does not guarantee u128/i128 are sound for FFI, and its
+ // definitions are in fact known to be incompatible. [0]
+ //
+ // However these problems aren't fundamental, and are just platform
+ // inconsistencies. Specifically at the time of this writing:
+ //
+ // * For x64 SysV ABIs (everything but Windows), the types are underaligned.
+ // * For all Windows ABIs, Microsoft doesn't actually officially define __int128,
+ // and as a result different implementations don't actually agree on its ABI.
+ //
+ // But on the other major aarch64 platforms (android, linux, ios, macos) we have
+ // validated that rustc has the right ABI for these types. This is important because
+ // aarch64 uses these types in some fundamental OS types like user_fpsimd_struct,
+ // which represents saved simd registers.
+ //
+ // Any API which uses these types will need to `#[ignore(improper_ctypes)]`
+ // until the upstream rust issue is resolved, but this at least lets us make
+ // progress on platforms where this type is important.
+ //
+ // The supported architectures and OSes is intentionally very restricted,
+ // as careful work needs to be done to verify that a particular platform
+ // has a conformant ABI.
+ //
+ // [0]: https://github.com/rust-lang/rust/issues/54341
+
+ /// C `__int128` (a GCC extension that's part of many ABIs)
+ pub type __int128 = i128;
+ /// C `unsigned __int128` (a GCC extension that's part of many ABIs)
+ pub type __uint128 = u128;
+ /// C __int128_t (alternate name for [__int128][])
+ pub type __int128_t = i128;
+ /// C __uint128_t (alternate name for [__uint128][])
+ pub type __uint128_t = u128;
+
+ cfg_if! {
+ if #[cfg(libc_const_assert)] {
+ // NOTE: if you add more platforms to here, you may need to cfg
+ // these consts. They should always match the platform's values
+ // for `sizeof(__int128)` and `_Alignof(__int128)`.
+ const _SIZE_128: usize = 16;
+ const _ALIGN_128: usize = 16;
+
+ /// Since Rust doesn't officially guarantee that these types
+ /// have compatible ABIs, we const assert that these values have the
+ /// known size/align of the target platform's libc. If rustc ever
+ /// tries to regress things, it will cause a compilation error.
+ ///
+ /// This isn't a bullet-proof solution because e.g. it doesn't
+ /// catch the fact that llvm and gcc disagree on how x64 __int128
+ /// is actually *passed* on the stack (clang underaligns it for
+ /// the same reason that rustc *never* properly aligns it).
+ const _ASSERT_128_COMPAT: () = {
+ assert!(core::mem::size_of::<__int128>() == _SIZE_128);
+ assert!(core::mem::align_of::<__int128>() == _ALIGN_128);
+
+ assert!(core::mem::size_of::<__uint128>() == _SIZE_128);
+ assert!(core::mem::align_of::<__uint128>() == _ALIGN_128);
+
+ assert!(core::mem::size_of::<__int128_t>() == _SIZE_128);
+ assert!(core::mem::align_of::<__int128_t>() == _ALIGN_128);
+
+ assert!(core::mem::size_of::<__uint128_t>() == _SIZE_128);
+ assert!(core::mem::align_of::<__uint128_t>() == _ALIGN_128);
+ };
+ }
+ }
+ }
+}
diff --git a/src/unix/bsd/apple/b64/aarch64/align.rs b/src/unix/bsd/apple/b64/aarch64/align.rs
index 10d55039dfa7a..131e15b69ad94 100644
--- a/src/unix/bsd/apple/b64/aarch64/align.rs
+++ b/src/unix/bsd/apple/b64/aarch64/align.rs
@@ -39,8 +39,15 @@ s! {
pub __pad: u32,
}
- #[repr(align(16))]
+ // This type natively uses a uint128, but for a while we hacked
+ // it in with repr(align) and `[u64; 2]`. uint128 isn't available
+ // all the way back to our earliest supported versions so we
+ // preserver the old shim.
+ #[cfg_attr(not(libc_int128), repr(align(16)))]
pub struct __darwin_arm_neon_state64 {
+ #[cfg(libc_int128)]
+ pub __v: [::__uint128_t; 32],
+ #[cfg(not(libc_int128))]
pub __v: [[u64; 2]; 32],
pub __fpsr: u32,
pub __fpcr: u32,
diff --git a/src/unix/linux_like/android/b64/aarch64/int128.rs b/src/unix/linux_like/android/b64/aarch64/int128.rs
new file mode 100644
index 0000000000000..4535e73eeddf1
--- /dev/null
+++ b/src/unix/linux_like/android/b64/aarch64/int128.rs
@@ -0,0 +1,7 @@
+s! {
+ pub struct user_fpsimd_struct {
+ pub vregs: [::__uint128_t; 32],
+ pub fpsr: u32,
+ pub fpcr: u32,
+ }
+}
diff --git a/src/unix/linux_like/android/b64/aarch64/mod.rs b/src/unix/linux_like/android/b64/aarch64/mod.rs
index 0416267c2859f..c4d4420600283 100644
--- a/src/unix/linux_like/android/b64/aarch64/mod.rs
+++ b/src/unix/linux_like/android/b64/aarch64/mod.rs
@@ -382,3 +382,10 @@ cfg_if! {
pub use self::align::*;
}
}
+
+cfg_if! {
+ if #[cfg(libc_int128)] {
+ mod int128;
+ pub use self::int128::*;
+ }
+}
diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs
new file mode 100644
index 0000000000000..4535e73eeddf1
--- /dev/null
+++ b/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs
@@ -0,0 +1,7 @@
+s! {
+ pub struct user_fpsimd_struct {
+ pub vregs: [::__uint128_t; 32],
+ pub fpsr: u32,
+ pub fpcr: u32,
+ }
+}
diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
index f3aa68a9cdb27..29f3f2d956ff4 100644
--- a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
@@ -896,3 +896,10 @@ cfg_if! {
pub use self::align::*;
}
}
+
+cfg_if! {
+ if #[cfg(libc_int128)] {
+ mod int128;
+ pub use self::int128::*;
+ }
+}
diff --git a/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs b/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs
new file mode 100644
index 0000000000000..4535e73eeddf1
--- /dev/null
+++ b/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs
@@ -0,0 +1,7 @@
+s! {
+ pub struct user_fpsimd_struct {
+ pub vregs: [::__uint128_t; 32],
+ pub fpsr: u32,
+ pub fpcr: u32,
+ }
+}
diff --git a/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs b/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
index 1b8045341c64a..845707dcd9ab5 100644
--- a/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
+++ b/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
@@ -642,3 +642,10 @@ cfg_if! {
pub use self::align::*;
}
}
+
+cfg_if! {
+ if #[cfg(libc_int128)] {
+ mod int128;
+ pub use self::int128::*;
+ }
+}
|
diff --git a/libc-test/semver/android-aarch64.txt b/libc-test/semver/android-aarch64.txt
index 0036c2d743906..7a8868aa2c5de 100644
--- a/libc-test/semver/android-aarch64.txt
+++ b/libc-test/semver/android-aarch64.txt
@@ -12,3 +12,4 @@ SYS_syscalls
SYS_fcntl
__system_property_wait
user_regs_struct
+user_fpsimd_struct
diff --git a/libc-test/semver/linux-aarch64.txt b/libc-test/semver/linux-aarch64.txt
index 18fa63fed70b5..27416915d265a 100644
--- a/libc-test/semver/linux-aarch64.txt
+++ b/libc-test/semver/linux-aarch64.txt
@@ -91,3 +91,4 @@ max_align_t
mcontext_t
ucontext_t
user_regs_struct
+user_fpsimd_struct
|
`user_fpsimd_struct` on aarch64
On aarch64, `user_fpsimd_struct` includes a `__uint128_t` type:
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/aarch64/sys/user.h;h=9927b3ac3c43096d85f65421c89c8bef5e0bbce9;hb=a85c93c42433aa52d4c5bc18e1dff038a82415bf#l32
There is a known issue regarding `__uint128_t` / `__int128_t` alignment to be different from `u128` / `i128` in rust.
I know that some of you guys faced this issue in some occasions (e.g. #2008).
In #2417 he tried few different ways to commit this struct, which fails tests.
Should we consider any other workaround, if there is any to consider?
|
PSA: rustc actually correctly aligns u128/i128 on aarch64 linux (android) and macos and it's totally sound to use it for FFI on those platforms! So we can actually properly add these types and unblock everything that wants to use them.
https://github.com/rust-lang/rust/issues/54341#issuecomment-1062498329
|
2022-03-09T06:43:40Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 2,622
|
rust-lang__libc-2622
|
[
"2621"
] |
c1b386055f3595186c30e28a60f8fc36aae7cfff
|
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index da7e9e4e9fcb0..a0dfb4722680e 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -867,6 +867,7 @@ cfg_if! {
pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53;
pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53;
pub const F2FS_SUPER_MAGIC: ::c_long = 0xf2f52010;
+ pub const FUSE_SUPER_MAGIC: ::c_long = 0x65735546;
pub const FUTEXFS_SUPER_MAGIC: ::c_long = 0xbad1dea;
pub const HOSTFS_SUPER_MAGIC: ::c_long = 0x00c0ffee;
pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849;
@@ -921,6 +922,7 @@ cfg_if! {
pub const EXT3_SUPER_MAGIC: ::c_uint = 0x0000ef53;
pub const EXT4_SUPER_MAGIC: ::c_uint = 0x0000ef53;
pub const F2FS_SUPER_MAGIC: ::c_uint = 0xf2f52010;
+ pub const FUSE_SUPER_MAGIC: ::c_uint = 0x65735546;
pub const FUTEXFS_SUPER_MAGIC: ::c_uint = 0xbad1dea;
pub const HOSTFS_SUPER_MAGIC: ::c_uint = 0x00c0ffee;
pub const HPFS_SUPER_MAGIC: ::c_uint = 0xf995e849;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index fb008faeaeb62..d9965d39f80db 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -3182,6 +3182,9 @@ fn test_linux(target: &str) {
// headers conflicts with linux/pidfd.h
"PIDFD_NONBLOCK" => true,
+ // is a private value for kernel usage normally
+ "FUSE_SUPER_MAGIC" => true,
+
_ => false,
}
});
|
Define FUSE_SUPER_MAGIC for Linux
The definition of `FUSE_SUPER_MAGIC` is missing from file src/libc/unix/linux_like/linux/gnu/mod.rs .
According to https://man7.org/linux/man-pages/man2/fstatfs64.2.html, FUSE_SUPER_MAGIC should be "0x65735546".
|
2022-01-11T18:33:33Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 2,606
|
rust-lang__libc-2606
|
[
"1920"
] |
52382d65fb03836a5ce2efefbbee8e774e36084d
|
diff --git a/src/unix/linux_like/linux/gnu/b32/mod.rs b/src/unix/linux_like/linux/gnu/b32/mod.rs
index 418c638063466..5b68cdb8d0349 100644
--- a/src/unix/linux_like/linux/gnu/b32/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/mod.rs
@@ -11,6 +11,7 @@ pub type msgqnum_t = ::c_ulong;
pub type msglen_t = ::c_ulong;
pub type nlink_t = u32;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
pub type __fsword_t = i32;
pub type fsblkcnt64_t = u64;
pub type fsfilcnt64_t = u64;
diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
index b13bdae68e8c8..731f060ffbc1e 100644
--- a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
@@ -6,6 +6,7 @@ pub type nlink_t = u32;
pub type blksize_t = i32;
pub type suseconds_t = i64;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
s! {
pub struct sigaction {
diff --git a/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs b/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
index 46a37b669678e..a8eb751b50606 100644
--- a/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
@@ -8,6 +8,7 @@ pub type nlink_t = u64;
pub type suseconds_t = i64;
pub type wchar_t = i32;
pub type __u64 = ::c_ulong;
+pub type __s64 = ::c_long;
s! {
pub struct stat {
diff --git a/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs b/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
index 2fdb9a3b10af5..5cb359c549c89 100644
--- a/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
@@ -10,6 +10,7 @@ pub type nlink_t = u64;
pub type blksize_t = i64;
pub type suseconds_t = i64;
pub type __u64 = ::c_ulong;
+pub type __s64 = ::c_long;
s! {
pub struct sigaction {
diff --git a/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs b/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
index f8abe5e9cf665..b3db66ffe6773 100644
--- a/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
@@ -11,6 +11,7 @@ pub type fsblkcnt64_t = ::c_ulong;
pub type fsfilcnt64_t = ::c_ulong;
pub type suseconds_t = i64;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
s! {
pub struct pthread_attr_t {
diff --git a/src/unix/linux_like/linux/gnu/b64/s390x.rs b/src/unix/linux_like/linux/gnu/b64/s390x.rs
index 44fa82d8b4973..cc508f1b96bd4 100644
--- a/src/unix/linux_like/linux/gnu/b64/s390x.rs
+++ b/src/unix/linux_like/linux/gnu/b64/s390x.rs
@@ -11,6 +11,7 @@ pub type suseconds_t = i64;
pub type wchar_t = i32;
pub type greg_t = u64;
pub type __u64 = u64;
+pub type __s64 = i64;
s! {
pub struct sigaction {
diff --git a/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs b/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
index 433892dfd0c6e..9fb14a4f96e10 100644
--- a/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
@@ -10,6 +10,7 @@ pub type nlink_t = u32;
pub type blksize_t = i64;
pub type suseconds_t = i32;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
s! {
pub struct sigaction {
diff --git a/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs b/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
index 6c2a6de6ea829..81a5b8f540f1b 100644
--- a/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
@@ -7,6 +7,7 @@ pub type blksize_t = i64;
pub type greg_t = i64;
pub type suseconds_t = i64;
pub type __u64 = ::c_ulonglong;
+pub type __s64 = ::c_longlong;
s! {
pub struct sigaction {
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index 7a55448497024..11aedf4aeafda 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -324,6 +324,32 @@ s! {
pub flags: ::__u32,
pub nr: ::__s32,
}
+
+ pub struct __c_anonymous_ptrace_syscall_info_entry {
+ pub nr: ::__u64,
+ pub args: [::__u64; 6],
+ }
+
+ pub struct __c_anonymous_ptrace_syscall_info_exit {
+ pub sval: ::__s64,
+ pub is_error: ::__u8,
+ }
+
+ pub struct __c_anonymous_ptrace_syscall_info_seccomp {
+ pub nr: ::__u64,
+ pub args: [::__u64; 6],
+ pub ret_data: ::__u32,
+ }
+
+ pub struct ptrace_syscall_info {
+ pub op: ::__u8,
+ pub pad: [::__u8; 3],
+ pub arch: ::__u32,
+ pub instruction_pointer: ::__u64,
+ pub stack_pointer: ::__u64,
+ #[cfg(libc_union)]
+ pub u: __c_anonymous_ptrace_syscall_info_data,
+ }
}
impl siginfo_t {
@@ -411,6 +437,18 @@ cfg_if! {
self.sifields().sigchld.si_stime
}
}
+
+ pub union __c_anonymous_ptrace_syscall_info_data {
+ pub entry: __c_anonymous_ptrace_syscall_info_entry,
+ pub exit: __c_anonymous_ptrace_syscall_info_exit,
+ pub seccomp: __c_anonymous_ptrace_syscall_info_seccomp,
+ }
+ impl ::Copy for __c_anonymous_ptrace_syscall_info_data {}
+ impl ::Clone for __c_anonymous_ptrace_syscall_info_data {
+ fn clone(&self) -> __c_anonymous_ptrace_syscall_info_data {
+ *self
+ }
+ }
}
}
@@ -509,6 +547,44 @@ cfg_if! {
self.__glibc_reserved.hash(state);
}
}
+
+ #[cfg(libc_union)]
+ impl PartialEq for __c_anonymous_ptrace_syscall_info_data {
+ fn eq(&self, other: &__c_anonymous_ptrace_syscall_info_data) -> bool {
+ unsafe {
+ self.entry == other.entry ||
+ self.exit == other.exit ||
+ self.seccomp == other.seccomp
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl Eq for __c_anonymous_ptrace_syscall_info_data {}
+
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_ptrace_syscall_info_data {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ unsafe {
+ f.debug_struct("__c_anonymous_ptrace_syscall_info_data")
+ .field("entry", &self.entry)
+ .field("exit", &self.exit)
+ .field("seccomp", &self.seccomp)
+ .finish()
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl ::hash::Hash for __c_anonymous_ptrace_syscall_info_data {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ unsafe {
+ self.entry.hash(state);
+ self.exit.hash(state);
+ self.seccomp.hash(state);
+ }
+ }
+ }
}
}
@@ -906,6 +982,7 @@ pub const PTRACE_SEIZE: ::c_uint = 0x4206;
pub const PTRACE_INTERRUPT: ::c_uint = 0x4207;
pub const PTRACE_LISTEN: ::c_uint = 0x4208;
pub const PTRACE_PEEKSIGINFO: ::c_uint = 0x4209;
+pub const PTRACE_GET_SYSCALL_INFO: ::c_uint = 0x420e;
// linux/fs.h
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 8276b335fbf34..fb008faeaeb62 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -3325,7 +3325,9 @@ fn test_linux(target: &str) {
// FIXME: It now takes mode_t since glibc 2.31 on some targets.
(struct_ == "ipc_perm" && field == "mode"
&& ((x86_64 || i686 || arm || riscv64) && gnu || x86_64_gnux32)
- )
+ ) ||
+ // the `u` field is in fact an anonymous union
+ (gnu && struct_ == "ptrace_syscall_info" && (field == "u" || field == "pad"))
});
cfg.skip_roundtrip(move |s| match s {
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
index 88e4b54451ef0..3a7901aa41ecd 100644
--- a/libc-test/semver/linux-gnu.txt
+++ b/libc-test/semver/linux-gnu.txt
@@ -350,6 +350,7 @@ PF_MPLS
PF_XDP
PROC_SUPER_MAGIC
PTHREAD_MUTEX_ADAPTIVE_NP
+PTRACE_GET_SYSCALL_INFO
QNX4_SUPER_MAGIC
QNX6_SUPER_MAGIC
RDTGROUP_SUPER_MAGIC
@@ -617,6 +618,7 @@ pthread_rwlockattr_getpshared
pthread_rwlockattr_setkind_np
pthread_setname_np
ptrace_peeksiginfo_args
+ptrace_syscall_info
pututxline
pwritev2
pwritev64
|
Add PTRACE_GET_SYSCALL_INFO
target triple: unknown-linux-*
docs: https://man7.org/linux/man-pages/man2/ptrace.2.html
PTRACE_GET_SYSCALL_INFO is a linux-specific api (added fairly recently in Linux 5.3) that gives the consumer information about ptrace syscall stops, like if it was syscall entry or exit. Adding support would require a rust definition for the main data structure -
```c
struct ptrace_syscall_info {
__u8 op; /* Type of system call stop */
__u32 arch; /* AUDIT_ARCH_* value; see seccomp(2) */
__u64 instruction_pointer; /* CPU instruction pointer */
__u64 stack_pointer; /* CPU stack pointer */
union {
struct { /* op == PTRACE_SYSCALL_INFO_ENTRY */
__u64 nr; /* System call number */
__u64 args[6]; /* System call arguments */
} entry;
struct { /* op == PTRACE_SYSCALL_INFO_EXIT */
__s64 rval; /* System call return value */
__u8 is_error; /* System call error flag;
Boolean: does rval contain
an error value (-ERRCODE) or
a nonerror return value? */
} exit;
struct { /* op == PTRACE_SYSCALL_INFO_SECCOMP */
__u64 nr; /* System call number */
__u64 args[6]; /* System call arguments */
__u32 ret_data; /* SECCOMP_RET_DATA portion
of SECCOMP_RET_TRACE
return value */
} seccomp;
};
};
```
in addition to adding the PTRACE_GET_SYSCALL_INFO constant
I could submit a PR for this if it might be merged.
|
2021-12-30T01:17:23Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 2,548
|
rust-lang__libc-2548
|
[
"2500"
] |
7f8d24422390eeafe1eb905f9704e139d20ce4d9
|
diff --git a/src/unix/linux_like/linux/arch/generic/mod.rs b/src/unix/linux_like/linux/arch/generic/mod.rs
index f3bed42b51164..399e78b8b67d9 100644
--- a/src/unix/linux_like/linux/arch/generic/mod.rs
+++ b/src/unix/linux_like/linux/arch/generic/mod.rs
@@ -135,3 +135,6 @@ pub const TIOCM_DSR: ::c_int = 0x100;
pub const BOTHER: ::speed_t = 0o010000;
pub const IBSHIFT: ::tcflag_t = 16;
+
+pub const BLKSSZGET: ::c_int = 0x1268;
+pub const BLKPBSZGET: ::c_int = 0x127B;
diff --git a/src/unix/linux_like/linux/arch/mips/mod.rs b/src/unix/linux_like/linux/arch/mips/mod.rs
index 1b327687bc6bc..f554676c65325 100644
--- a/src/unix/linux_like/linux/arch/mips/mod.rs
+++ b/src/unix/linux_like/linux/arch/mips/mod.rs
@@ -131,3 +131,6 @@ pub const TIOCM_DSR: ::c_int = 0x400;
pub const BOTHER: ::speed_t = 0o010000;
pub const IBSHIFT: ::tcflag_t = 16;
+
+pub const BLKSSZGET: ::c_int = 0x20001268;
+pub const BLKPBSZGET: ::c_int = 0x2000127B;
diff --git a/src/unix/linux_like/linux/arch/powerpc/mod.rs b/src/unix/linux_like/linux/arch/powerpc/mod.rs
index b56121cd1b4f8..68f17cade97c9 100644
--- a/src/unix/linux_like/linux/arch/powerpc/mod.rs
+++ b/src/unix/linux_like/linux/arch/powerpc/mod.rs
@@ -109,3 +109,6 @@ pub const TIOCM_DSR: ::c_int = 0x100;
pub const BOTHER: ::speed_t = 0o0037;
pub const IBSHIFT: ::tcflag_t = 16;
+
+pub const BLKSSZGET: ::c_int = 0x20001268;
+pub const BLKPBSZGET: ::c_int = 0x2000127B;
diff --git a/src/unix/linux_like/linux/arch/sparc/mod.rs b/src/unix/linux_like/linux/arch/sparc/mod.rs
index 1d384c83cbff8..74e36d6519feb 100644
--- a/src/unix/linux_like/linux/arch/sparc/mod.rs
+++ b/src/unix/linux_like/linux/arch/sparc/mod.rs
@@ -123,3 +123,6 @@ pub const TIOCM_DSR: ::c_int = 0x100;
pub const BOTHER: ::speed_t = 0x1000;
pub const IBSHIFT: ::tcflag_t = 16;
+
+pub const BLKSSZGET: ::c_int = 0x20001268;
+pub const BLKPBSZGET: ::c_int = 0x2000127B;
|
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index 4972bc7d571d5..822405ab841bc 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -189,6 +189,8 @@ B460800
B500000
B576000
B921600
+BLKPBSZGET
+BLKSSZGET
BOTHER
BS0
BS1
|
Add `BLKSSZGET` and `BLKPBSZGET` ioctl arguments
Linux-only ioctl arguments that provide the virtual or physical block size of a block device.
Unfortunately, despite being present since kernel [2.6.13 BLKSSZGET](https://github.com/torvalds/linux/blob/6fc32179de9e14c542e0b1760e412bc670611c53/include/linux/fs.h#L182) and [2.6.32 BLKPBSZGET](https://github.com/torvalds/linux/blob/22763c5cf3690a681551162c15d34d935308c8d7/include/linux/fs.h#L306), both lack proper documentation, [if not for the kernel source.](https://lkml.org/lkml/2013/11/3/128)
Luckily for us, linux rarely, if ever, breaks or changes userspace, meaning that once implemented they should require little to no maintenance, even without documentation.
|
2021-11-17T10:00:21Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 2,533
|
rust-lang__libc-2533
|
[
"2241"
] |
8c6b63463f02d7fa6f410ded2bf600329053796e
|
diff --git a/src/windows/mod.rs b/src/windows/mod.rs
index 8ecff3ca7ef99..08cba4edd094b 100644
--- a/src/windows/mod.rs
+++ b/src/windows/mod.rs
@@ -319,6 +319,8 @@ extern "C" {
pub fn feof(stream: *mut FILE) -> c_int;
pub fn ferror(stream: *mut FILE) -> c_int;
pub fn perror(s: *const c_char);
+ pub fn printf(format: *const c_char, ...) -> ::c_int;
+ pub fn fprintf(stream: *mut FILE, format: *const c_char, ...) -> ::c_int;
pub fn atoi(s: *const c_char) -> c_int;
pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
|
diff --git a/libc-test/semver/windows.txt b/libc-test/semver/windows.txt
index ade72529e28e4..ddb97a8d8ea43 100644
--- a/libc-test/semver/windows.txt
+++ b/libc-test/semver/windows.txt
@@ -199,6 +199,7 @@ fgets
fileno
fopen
fpos_t
+fprintf
fputc
fputs
fread
@@ -257,6 +258,7 @@ pclose
perror
pipe
popen
+printf
ptrdiff_t
putchar
puts
|
printf is missing on Windows targets
I'm not sure why, but it seems `printf` is missing on windows targets, is there particular history behind or can we just enable it in?
|
Turns out that by default you do not have `printf` symbol on Windows.
It is only available via separate legacy lib so I had to link it like that:
```rust
#[cfg_attr(all(windows, target_env="msvc"), link(name="legacy_stdio_definitions", kind="dylib"))]
extern "C" {
pub fn printf(format: *const i8, ...) -> int;
}
```
|
2021-11-13T11:20:04Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 2,532
|
rust-lang__libc-2532
|
[
"1928"
] |
8c6b63463f02d7fa6f410ded2bf600329053796e
|
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index 598bf465b40f3..a804ddb94a7f3 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -1274,6 +1274,8 @@ extern "C" {
pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
// Added in `glibc` 2.29
pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
+
+ pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
}
extern "C" {
diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs
index df596e9683e24..5446477461046 100644
--- a/src/unix/linux_like/linux/musl/mod.rs
+++ b/src/unix/linux_like/linux/musl/mod.rs
@@ -758,6 +758,8 @@ extern "C" {
pub fn adjtimex(buf: *mut ::timex) -> ::c_int;
pub fn clock_adjtime(clk_id: ::clockid_t, buf: *mut ::timex) -> ::c_int;
+
+ pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
}
cfg_if! {
|
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
index 440863c248ea2..fe19b6cd37643 100644
--- a/libc-test/semver/linux-gnu.txt
+++ b/libc-test/semver/linux-gnu.txt
@@ -567,6 +567,7 @@ aiocb
backtrace
clock_adjtime
copy_file_range
+ctermid
dlinfo
dlmopen
endutxent
diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt
index 737eb1f11d4e6..b2c5e9dc6bc62 100644
--- a/libc-test/semver/linux-musl.txt
+++ b/libc-test/semver/linux-musl.txt
@@ -25,6 +25,7 @@ aio_suspend
aio_write
aiocb
clock_adjtime
+ctermid
explicit_bzero
futimes
getauxval
|
Add ctermid
ctermid gets the path of the controlling terminal, see [ctermid](https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctermid.html):
```rust
pub fn ctermid(c: *mut libc::c_char) -> *mut libc::c_char;
```
This is POSIX API; it definitely exists on Linux, and I presume on all other Unix systems as well.
|
2021-11-13T11:03:57Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 2,509
|
rust-lang__libc-2509
|
[
"2269"
] |
312447584ca33913d95ea5616e5c2f67ec77dd68
|
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index a465c48bc468e..2bb032dd3721d 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -1330,6 +1330,7 @@ pub const POSIX_MADV_NORMAL: ::c_int = 0;
pub const POSIX_MADV_RANDOM: ::c_int = 1;
pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
pub const POSIX_MADV_WILLNEED: ::c_int = 3;
+pub const POSIX_SPAWN_USEVFORK: ::c_int = 64;
pub const S_IEXEC: mode_t = 64;
pub const S_IWRITE: mode_t = 128;
|
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index beb9d0765698d..42dde130ae861 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -1529,6 +1529,7 @@ POSIX_SPAWN_SETSCHEDPARAM
POSIX_SPAWN_SETSCHEDULER
POSIX_SPAWN_SETSIGDEF
POSIX_SPAWN_SETSIGMASK
+POSIX_SPAWN_USEVFORK
PROT_GROWSDOWN
PROT_GROWSUP
PR_CAPBSET_DROP
|
support for POSIX_SPAWN_USEVFORK
On Linux, certain GNU extensions are available if the `_GNU_SOURCE` feature test macro is set.
For instance, in order to use `POSIX_SPAWN_USEVFORK` in `posix_spawn` this feature test macro must be set, see [posix_spawn(3)](https://man7.org/linux/man-pages/man3/posix_spawn.3.html). However, there does not appear to be a `libc::POSIX_SPAWN_USEVFORK`
Is it correct that `libc`'s binding were created without `_GNU_SOURCE` and if so, would it be meaningful to create an option in libc to enable these GNU extensions on platforms that support them?
|
@godmar libc is happy to expose any and all target-specific features on the targets that have them. And we already define `_GNU_SOURCE`. In this case, I think it's just that nobody has added `POSIX_SPAWN_USEVFORK`. I'd be happy to review a PR adding it.
|
2021-11-03T19:34:24Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 2,366
|
rust-lang__libc-2366
|
[
"2365"
] |
2cffe84529fb86a150c6848409d75aa96d237944
|
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index 3e57966c411e9..0b79a0285fadd 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -1598,6 +1598,7 @@ cfg_if! {
pub const MREMAP_MAYMOVE: ::c_int = 1;
pub const MREMAP_FIXED: ::c_int = 2;
+pub const MREMAP_DONTUNMAP: ::c_int = 4;
pub const PR_SET_PDEATHSIG: ::c_int = 1;
pub const PR_GET_PDEATHSIG: ::c_int = 2;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index dec4a81233328..08ddcd3539650 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2795,6 +2795,9 @@ fn test_linux(target: &str) {
// Require Linux kernel 5.6:
"VMADDR_CID_LOCAL" => true,
+ // Requires Linux kernel 5.7:
+ "MREMAP_DONTUNMAP" => true,
+
// IPPROTO_MAX was increased in 5.6 for IPPROTO_MPTCP:
| "IPPROTO_MAX"
| "IPPROTO_MPTCP" => true,
|
Add MREMAP_DONTUNMAP flag
mremap has a new flag in Linux as of kernel 5.7
[MREMAP_DONTUNMAP](https://man7.org/linux/man-pages/man2/mremap.2.html)
Its value is 4
|
2021-08-25T17:53:05Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 2,304
|
rust-lang__libc-2304
|
[
"1883",
"2195"
] |
b2c99fa36963861136edca0eadbece44e9daab54
|
diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs
index 7f6afd5f2af64..a8b0332065429 100644
--- a/src/unix/linux_like/mod.rs
+++ b/src/unix/linux_like/mod.rs
@@ -1418,6 +1418,14 @@ f! {
}
safe_f! {
+ pub fn SIGRTMAX() -> ::c_int {
+ unsafe { __libc_current_sigrtmax() }
+ }
+
+ pub fn SIGRTMIN() -> ::c_int {
+ unsafe { __libc_current_sigrtmin() }
+ }
+
pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
(status & 0xff) == 0x7f
}
@@ -1480,6 +1488,11 @@ safe_f! {
}
extern "C" {
+ #[doc(hidden)]
+ pub fn __libc_current_sigrtmax() -> ::c_int;
+ #[doc(hidden)]
+ pub fn __libc_current_sigrtmin() -> ::c_int;
+
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
pub fn fdatasync(fd: ::c_int) -> ::c_int;
|
diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml
index 233c7a5efd3c9..3adbbc7fdd839 100644
--- a/libc-test/Cargo.toml
+++ b/libc-test/Cargo.toml
@@ -71,6 +71,11 @@ name = "errqueue"
path = "test/errqueue.rs"
harness = true
+[[test]]
+name = "sigrt"
+path = "test/sigrt.rs"
+harness = true
+
[[test]]
name = "semver"
path = "test/semver.rs"
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 975e0d16ddd48..97f5e36c426e0 100755
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -26,6 +26,13 @@ fn do_cc() {
if target.contains("android") || target.contains("linux") {
cc::Build::new().file("src/errqueue.c").compile("errqueue");
}
+ if target.contains("linux")
+ || target.contains("l4re")
+ || target.contains("android")
+ || target.contains("emscripten")
+ {
+ cc::Build::new().file("src/sigrt.c").compile("sigrt");
+ }
}
fn do_ctest() {
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index 38c79481be5fe..a756209ca287c 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -1972,6 +1972,8 @@ SIGEV_SIGNAL
SIGEV_THREAD
SIGPOLL
SIGPWR
+SIGRTMAX
+SIGRTMIN
SIGSTKSZ
SIOCADDMULTI
SIOCADDRT
diff --git a/libc-test/src/sigrt.c b/libc-test/src/sigrt.c
new file mode 100644
index 0000000000000..6140e7a8baec9
--- /dev/null
+++ b/libc-test/src/sigrt.c
@@ -0,0 +1,9 @@
+#include <signal.h>
+
+int sigrtmax() {
+ return SIGRTMAX;
+}
+
+int sigrtmin() {
+ return SIGRTMIN;
+}
diff --git a/libc-test/test/sigrt.rs b/libc-test/test/sigrt.rs
new file mode 100644
index 0000000000000..453dcb341d073
--- /dev/null
+++ b/libc-test/test/sigrt.rs
@@ -0,0 +1,32 @@
+//! Compare libc's SIGRTMAX and SIGRTMIN functions against the actual C macros
+
+extern crate libc;
+
+#[cfg(any(
+ target_os = "linux",
+ target_os = "l4re",
+ target_os = "android",
+ target_os = "emscripten"
+))]
+mod t {
+ use libc;
+
+ extern "C" {
+ pub fn sigrtmax() -> libc::c_int;
+ pub fn sigrtmin() -> libc::c_int;
+ }
+
+ #[test]
+ fn test_sigrtmax() {
+ unsafe {
+ assert_eq!(libc::SIGRTMAX(), sigrtmax());
+ }
+ }
+
+ #[test]
+ fn test_sigrtmin() {
+ unsafe {
+ assert_eq!(libc::SIGRTMIN(), sigrtmin());
+ }
+ }
+}
|
libc expose SIGRTMIN and SIGRTMAX
Exposing SIGRTMIN and SIGRTMAX might be problematic as they dynamically change and will therefore be hard to encode as constants. Perhaps exposing them in the form of functions is the best solution? I have very little experience porting from C to Rust so I am not sure what the best way of doing that would be. If someone gave me a point in the right direction then I would be willing to try to tackle this.
Target triplet: x86_64-linux-gnu
Man page for signals:
https://www.man7.org/linux/man-pages/man7/signal.7.html
Other crates looking for feature:
https://github.com/nix-rust/nix/issues/1143
Add SIGRTMIN/SIGRTMAX on Linux
Closes #1883
|
I think it would be reasonable to expose a function `libc::sigrtmin()` that calls `__libc_current_sigrtmin()`.
Hi @joshtriplett, I'll gladly make this change but I'm wondering how one exposes the function with the name `libc::sigrtmin()` as far as I can see in the linux module all of the functions are exposed by their C names and there doesn't seem to be a standard for creating an unsafe rust function named `sigrtmin` which then would call the non-public `__libc_current_sigrtmin()`.
So, my questions are these:
Do I create an unsafe rust function named `sigrtmin()` that calls `__libc_current_sigrtmin()` or do I in some other way change the name of `__libc_current_sigrtmin()`? In that case how do I do that?
If I should create an unsafe rust function, where do I do this? Anywhere in the module?
|
2021-07-28T21:21:46Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 2,277
|
rust-lang__libc-2277
|
[
"2275"
] |
f3b7e0ec2e05f45e03a5eec76265cd340675a179
|
diff --git a/Cargo.toml b/Cargo.toml
index 66ced3c6b0bd5..905c610e7543a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "libc"
-version = "0.2.97"
+version = "0.2.98"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
|
diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml
index 34a06c6849b84..233c7a5efd3c9 100644
--- a/libc-test/Cargo.toml
+++ b/libc-test/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "libc-test"
-version = "0.2.97"
+version = "0.2.98"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
build = "build.rs"
@@ -12,7 +12,7 @@ A test crate for the libc crate.
[dependencies.libc]
path = ".."
-version = "0.2.97"
+version = "0.2.98"
default-features = false
[build-dependencies]
|
Release 0.2.98
Could we have a new release for https://github.com/rust-lang/libc/pull/2237 please? The nix crate uses it and thus currently use libc as a git dependency, I would like to change that.
|
Sure! I'll handle it later.
|
2021-07-07T03:54:40Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 2,252
|
rust-lang__libc-2252
|
[
"2002"
] |
4fcfa55fbbd40e8471865203fcdb52cfac1ec2a7
|
diff --git a/src/unix/linux_like/linux/gnu/b32/mod.rs b/src/unix/linux_like/linux/gnu/b32/mod.rs
index 239492b1c94db..418c638063466 100644
--- a/src/unix/linux_like/linux/gnu/b32/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/mod.rs
@@ -14,6 +14,7 @@ pub type __u64 = ::c_ulonglong;
pub type __fsword_t = i32;
pub type fsblkcnt64_t = u64;
pub type fsfilcnt64_t = u64;
+pub type __syscall_ulong_t = ::c_ulong;
cfg_if! {
if #[cfg(target_arch = "riscv32")] {
@@ -138,6 +139,23 @@ s! {
pub imr_address: ::in_addr,
pub imr_ifindex: ::c_int,
}
+
+ pub struct semid_ds {
+ pub sem_perm: ipc_perm,
+ #[cfg(target_arch = "powerpc")]
+ __reserved: ::__syscall_ulong_t,
+ pub sem_otime: ::time_t,
+ #[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))]
+ __reserved: ::__syscall_ulong_t,
+ #[cfg(target_arch = "powerpc")]
+ __reserved2: ::__syscall_ulong_t,
+ pub sem_ctime: ::time_t,
+ #[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))]
+ __reserved2: ::__syscall_ulong_t,
+ pub sem_nsems: ::__syscall_ulong_t,
+ __glibc_reserved3: ::__syscall_ulong_t,
+ __glibc_reserved4: ::__syscall_ulong_t,
+ }
}
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
diff --git a/src/unix/linux_like/linux/gnu/b64/mod.rs b/src/unix/linux_like/linux/gnu/b64/mod.rs
index 138adc910c801..db82f26dc996e 100644
--- a/src/unix/linux_like/linux/gnu/b64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/mod.rs
@@ -9,6 +9,11 @@ pub type msglen_t = u64;
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
pub type rlim_t = u64;
+#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+pub type __syscall_ulong_t = ::c_ulonglong;
+#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+pub type __syscall_ulong_t = ::c_ulong;
+
cfg_if! {
if #[cfg(all(target_arch = "aarch64", target_pointer_width = "32"))] {
pub type clock_t = i32;
@@ -60,6 +65,28 @@ s! {
__glibc_reserved5: u64,
}
+ pub struct semid_ds {
+ pub sem_perm: ipc_perm,
+ pub sem_otime: ::time_t,
+ #[cfg(not(any(
+ target_arch = "aarch64",
+ target_arch = "mips64",
+ target_arch = "powerpc64",
+ target_arch = "riscv64",
+ target_arch = "sparc64")))]
+ __reserved: ::__syscall_ulong_t,
+ pub sem_ctime: ::time_t,
+ #[cfg(not(any(
+ target_arch = "aarch64",
+ target_arch = "mips64",
+ target_arch = "powerpc64",
+ target_arch = "riscv64",
+ target_arch = "sparc64")))]
+ __reserved2: ::__syscall_ulong_t,
+ pub sem_nsems: ::__syscall_ulong_t,
+ __glibc_reserved3: ::__syscall_ulong_t,
+ __glibc_reserved4: ::__syscall_ulong_t,
+ }
}
pub const RLIM_INFINITY: ::rlim_t = !0;
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index ad0f88261dfcb..92fbc5011b6d1 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -313,6 +313,19 @@ s! {
pub ch_size: ::Elf32_Word,
pub ch_addralign: ::Elf32_Word,
}
+
+ pub struct seminfo {
+ pub semmap: ::c_int,
+ pub semmni: ::c_int,
+ pub semmns: ::c_int,
+ pub semmnu: ::c_int,
+ pub semmsl: ::c_int,
+ pub semopm: ::c_int,
+ pub semume: ::c_int,
+ pub semusz: ::c_int,
+ pub semvmx: ::c_int,
+ pub semaem: ::c_int,
+ }
}
impl siginfo_t {
|
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
index fb3256086cb6c..58a7396733ba7 100644
--- a/libc-test/semver/linux-gnu.txt
+++ b/libc-test/semver/linux-gnu.txt
@@ -566,6 +566,8 @@ pthread_setname_np
pututxline
pwritev2
qsort_r
+semid_ds
+seminfo
setutxent
setxattr
sgetspent_r
|
Provide definition of struct semid_ds for Linux
Target triplet: x86_64-unknown-linux-gnu
Documentation for `struct semid_ds`: https://man7.org/linux/man-pages/man2/semctl.2.html
```c
The semid_ds data structure is defined in <sys/sem.h> as follows:
struct semid_ds {
struct ipc_perm sem_perm; /* Ownership and permissions */
time_t sem_otime; /* Last semop time */
time_t sem_ctime; /* Creation time/time of last
modification via semctl() */
unsigned long sem_nsems; /* No. of semaphores in set */
};
```
Note that libc already has definition of `semctl` (function that needs `struct semid_ds`) for Linux: https://github.com/rust-lang/libc/blob/0.2.81/src/unix/linux_like/linux/mod.rs#L2777-L2782
libc also has definition of `struct semid_ds` for MacOS (added via #1159): https://github.com/rust-lang/libc/blob/0.2.81/src/unix/bsd/apple/mod.rs#L553-L564
|
2021-06-20T10:02:13Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 2,248
|
rust-lang__libc-2248
|
[
"2243"
] |
9fee1d0014acfbe8c49cc5b260fabb5e3978f17b
|
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index 0aee1ec515d17..f0a0dbfa6215f 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -2081,6 +2081,13 @@ extern "C" {
timeout: *const ::timespec,
) -> ::c_int;
pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+ pub fn waitid(
+ idtype: idtype_t,
+ id: ::id_t,
+ infop: *mut ::siginfo_t,
+ options: ::c_int,
+ ) -> ::c_int;
+
pub fn duplocale(base: ::locale_t) -> ::locale_t;
pub fn freelocale(loc: ::locale_t);
pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
|
diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt
index 384f6cad3787f..32bba252722b6 100644
--- a/libc-test/semver/netbsd.txt
+++ b/libc-test/semver/netbsd.txt
@@ -1290,3 +1290,4 @@ utmpxname
utpname
vm_size_t
wait4
+waitid
|
waitid() not defined for NetBSD
I see that `waitid()` is not defined for NetBSD targets (`*-*-netbsd`), although it is supported. As it's defined by POSIX, the current definition for FreeBSD should be able to be adopted quite easily.
Documentation links:
* [NetBSD](https://man.netbsd.org/wait.2) wait(2) manual page.
If no-one else wants to look at this I can see if I can whip up a PR.
|
2021-06-18T14:51:58Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 2,240
|
rust-lang__libc-2240
|
[
"2229"
] |
b456f76825268ce4d4c9227b393b9e63b7f07d2f
|
diff --git a/src/unix/linux_like/android/b32/mod.rs b/src/unix/linux_like/android/b32/mod.rs
index 1d5a6d06de5b4..d0c83bf50e63d 100644
--- a/src/unix/linux_like/android/b32/mod.rs
+++ b/src/unix/linux_like/android/b32/mod.rs
@@ -120,6 +120,10 @@ s! {
__reserved: [::c_char; 12],
}
+ pub struct pthread_spinlock_t {
+ __private: [i32; 2],
+ }
+
pub struct passwd {
pub pw_name: *mut ::c_char,
pub pw_passwd: *mut ::c_char,
diff --git a/src/unix/linux_like/android/b64/mod.rs b/src/unix/linux_like/android/b64/mod.rs
index c23e2dbf2df1d..20f93ffb30fb5 100644
--- a/src/unix/linux_like/android/b64/mod.rs
+++ b/src/unix/linux_like/android/b64/mod.rs
@@ -105,6 +105,10 @@ s! {
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
+
+ pub struct pthread_spinlock_t {
+ __private: i64,
+ }
}
s_no_extra_traits! {
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index 7ca8ee04ce7d6..be6fd08aa8a73 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -2677,6 +2677,11 @@ extern "C" {
lock: *mut pthread_mutex_t,
abstime: *const ::timespec,
) -> ::c_int;
+ pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+ pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
pub fn clone(
cb: extern "C" fn(*mut ::c_void) -> ::c_int,
child_stack: *mut ::c_void,
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index bd217be287f98..84cf57a818e52 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -14,6 +14,7 @@ pub type nl_item = ::c_int;
pub type idtype_t = ::c_uint;
pub type loff_t = ::c_longlong;
pub type pthread_key_t = ::c_uint;
+pub type pthread_spinlock_t = ::c_int;
pub type __u8 = ::c_uchar;
pub type __u16 = ::c_ushort;
@@ -3557,6 +3558,11 @@ extern "C" {
lock: *mut pthread_mutex_t,
abstime: *const ::timespec,
) -> ::c_int;
+ pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+ pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
pub fn clone(
cb: extern "C" fn(*mut ::c_void) -> ::c_int,
child_stack: *mut ::c_void,
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 8275ebf582ed4..98fd9ea56619c 100755
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2600,6 +2600,8 @@ fn test_linux(target: &str) {
// (`c_uint`) and this clashes with the type of the `rlimit` APIs
// which expect a `c_int` even though both are ABI compatible.
"__rlimit_resource_t" => true,
+ // on Linux, this is a volatile int
+ "pthread_spinlock_t" => true,
_ => false,
}
|
Why not support pthread_spin_lock
<!--
Please provide the below information:
* the target triple
* link to the documentation of the API showing the type signatures, how to use
it, etc.
In general, just please consider that the people who can help you are all very
busy, they will be helping you in their free time, there are a lot of people in
need of help so they need to prioritize to which issues they devote their free
time, etc. So try to give most of the information upfront, be concise, show
small self-contained examples (nobody has time to create a new cargo project,
set up dependencies,...), etc. Help us help you.
-->
Hi all,
I'm wondering why rust-libc crate doesn't support pthread_spin_lock_t in the pthread library. The document is: [https://man7.org/linux/man-pages/man3/pthread_spin_lock.3.html](https://man7.org/linux/man-pages/man3/pthread_spin_lock.3.html )
I guess there are other reasons, could you please tell me more about this choice?
Thx!
|
We usually add the items by request, feel free to open a PR if you want.
|
2021-06-14T18:58:31Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 2,234
|
rust-lang__libc-2234
|
[
"1877"
] |
da79cd0e32b15f7b9f900411a4e7c86ca0de5fa4
|
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index f4bed8eb1909b..6a5590acba2b6 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -1766,6 +1766,9 @@ pub const PT_LOOS: u32 = 0x60000000;
pub const PT_GNU_EH_FRAME: u32 = 0x6474e550;
pub const PT_GNU_STACK: u32 = 0x6474e551;
pub const PT_GNU_RELRO: u32 = 0x6474e552;
+pub const PT_HIOS: u32 = 0x6fffffff;
+pub const PT_LOPROC: u32 = 0x70000000;
+pub const PT_HIPROC: u32 = 0x7fffffff;
// linux/if_ether.h
pub const ETH_ALEN: ::c_int = 6;
|
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index 76de49a8ceb27..bf21030fa8e4f 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -1671,6 +1671,9 @@ PTRACE_SETSIGINFO
PTRACE_SINGLESTEP
PTRACE_SYSCALL
PTRACE_TRACEME
+PT_HIOS
+PT_LOPROC
+PT_HIPROC
PT_DYNAMIC
PT_GNU_EH_FRAME
PT_GNU_RELRO
|
libc is missing some program header type constants
The following program header type constants are missing from libc:
- `PT_HIOS`
- `PT_LOPROC`
- `PT_HIPROC`
Thanks
|
Given that these flags exist in glibc's elf.h, these seem completely reasonable to add to the libc crate. Could you send a pull request adding them? (Please add the whole contiguous block of related constants that contain these, not just those three constants.)
|
2021-06-12T12:48:24Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 2,215
|
rust-lang__libc-2215
|
[
"2077"
] |
28650774def78a6821171fd1c24d6f6913b66f23
|
diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs
index 954e87320bb7a..96545037537a2 100644
--- a/src/unix/linux_like/mod.rs
+++ b/src/unix/linux_like/mod.rs
@@ -1306,6 +1306,7 @@ pub const ARPHRD_ADAPT: u16 = 264;
pub const ARPHRD_ROSE: u16 = 270;
pub const ARPHRD_X25: u16 = 271;
pub const ARPHRD_HWX25: u16 = 272;
+pub const ARPHRD_CAN: u16 = 280;
pub const ARPHRD_PPP: u16 = 512;
pub const ARPHRD_CISCO: u16 = 513;
pub const ARPHRD_HDLC: u16 = ARPHRD_CISCO;
|
diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml
index 7b8bae6efd082..2eb5a0870d3a9 100644
--- a/libc-test/Cargo.toml
+++ b/libc-test/Cargo.toml
@@ -36,6 +36,11 @@ name = "linux-fcntl"
path = "test/linux_fcntl.rs"
harness = false
+[[test]]
+name = "linux-if-arp"
+path = "test/linux_if_arp.rs"
+harness = false
+
[[test]]
name = "linux-ipv6"
path = "test/linux_ipv6.rs"
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 653b83164ea87..e4f3a54e4176f 100755
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2703,6 +2703,9 @@ fn test_linux(target: &str) {
| "F_SEAL_SHRINK"
| "F_SEAL_GROW"
| "F_SEAL_WRITE" => true,
+ // The `ARPHRD_CAN` is tested in the `linux_if_arp.rs` tests
+ // because including `linux/if_arp.h` causes some conflicts:
+ "ARPHRD_CAN" => true,
// Require Linux kernel 5.1:
"F_SEAL_FUTURE_WRITE" => true,
@@ -3064,7 +3067,6 @@ fn test_linux_like_apis(target: &str) {
cfg.header("elf.h");
cfg.skip_fn(|_| true)
.skip_static(|_| true)
- .skip_fn(|_| true)
.skip_const(|_| true)
.type_name(move |ty, _is_struct, _is_union| ty.to_string())
.skip_struct(move |ty| match ty {
@@ -3077,6 +3079,21 @@ fn test_linux_like_apis(target: &str) {
});
cfg.generate("../src/lib.rs", "linux_elf.rs");
}
+
+ if linux || android {
+ // Test `ARPHRD_CAN`.
+ let mut cfg = ctest_cfg();
+ cfg.header("linux/if_arp.h");
+ cfg.skip_fn(|_| true)
+ .skip_static(|_| true)
+ .skip_const(move |name| match name {
+ "ARPHRD_CAN" => false,
+ _ => true,
+ })
+ .skip_struct(|_| true)
+ .skip_type(|_| true);
+ cfg.generate("../src/lib.rs", "linux_if_arp.rs");
+ }
}
fn which_freebsd() -> Option<i32> {
diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt
index 117d50e361e2f..bd89dd1e6aa62 100644
--- a/libc-test/semver/android.txt
+++ b/libc-test/semver/android.txt
@@ -69,6 +69,7 @@ ARPHRD_ASH
ARPHRD_ATM
ARPHRD_AX25
ARPHRD_BIF
+ARPHRD_CAN
ARPHRD_CHAOS
ARPHRD_CISCO
ARPHRD_CSLIP
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index 128e9d9c1ce4c..76de49a8ceb27 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -92,6 +92,7 @@ ARPHRD_ASH
ARPHRD_ATM
ARPHRD_AX25
ARPHRD_BIF
+ARPHRD_CAN
ARPHRD_CHAOS
ARPHRD_CISCO
ARPHRD_CSLIP
diff --git a/libc-test/test/linux_if_arp.rs b/libc-test/test/linux_if_arp.rs
new file mode 100644
index 0000000000000..50be071d45b67
--- /dev/null
+++ b/libc-test/test/linux_if_arp.rs
@@ -0,0 +1,12 @@
+#![allow(bad_style, improper_ctypes, unused, deprecated)]
+
+extern crate libc;
+use libc::*;
+
+#[cfg(any(target_os = "linux", target_os = "android"))]
+include!(concat!(env!("OUT_DIR"), "/linux_if_arp.rs"));
+
+#[cfg(not(any(target_os = "linux", target_os = "android")))]
+fn main() {
+ println!("PASSED 0 tests");
+}
|
Added Linux ARPHRD_CAN constant
The Linux ARPHRD_CAN constant (280) for CANbus appears to be missing.
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) soon.
If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.
Please see [the contribution instructions](https://github.com/rust-lang/libc/blob/master/CONTRIBUTING.md) for more information.
Seems some targets' (e.g. Android, Linux) tests need to import `linux/if_arp.h`.
OK. I'll have a look.
@fpagliughi Do you need help? If you're busy I'm happy to work on it instead :)
|
2021-06-03T06:42:35Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 2,208
|
rust-lang__libc-2208
|
[
"2181"
] |
af64038eb6dc8c5d60a9af1e893241c5f1e65179
|
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index aba356c93b382..d8a503e97db91 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -4095,6 +4095,19 @@ extern "C" {
pub fn proc_libversion(major: *mut ::c_int, mintor: *mut ::c_int) -> ::c_int;
}
+cfg_if! {
+ if #[cfg(target_os = "macos")] {
+ extern "C" {
+ pub fn memmem(
+ haystack: *const ::c_void,
+ haystacklen: ::size_t,
+ needle: *const ::c_void,
+ needlelen: ::size_t,
+ ) -> *mut ::c_void;
+ }
+ }
+}
+
#[link(name = "iconv")]
extern "C" {
pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
|
diff --git a/libc-test/semver/macos.txt b/libc-test/semver/macos.txt
new file mode 100644
index 0000000000000..d6a91320b85e1
--- /dev/null
+++ b/libc-test/semver/macos.txt
@@ -0,0 +1,1 @@
+memmem
|
memmem not available on macos
It is available in macos like most FreeBSD functions however it does not seem to be avAilable on ios, see https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/
|
You might as well also spam in all the missing neon intrinsics you want :)
#[cfg( not(target_os = "ios"))] enough? How many places does it need spammed?
https://github.com/rust-lang/libc/search?q=memmove
@chadbrewbaker I don't understand what you mean. Architecture-specific intrinsics are accessible in `stdarch` and `memmove` is available on ios and already accessible via the `libc` crate.
|
2021-06-01T15:01:28Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 2,207
|
rust-lang__libc-2207
|
[
"2197"
] |
fa1b66c15cc3742d5b75c6d9952b50dd72855f31
|
diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
index 71529421ea7cb..acaf13fe4e57b 100644
--- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -1131,6 +1131,7 @@ extern "C" {
pub fn sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, mask: *mut cpu_set_t) -> ::c_int;
pub fn sched_setaffinity(pid: ::pid_t, cpusetsize: ::size_t, mask: *const cpu_set_t)
-> ::c_int;
+ pub fn setproctitle(fmt: *const ::c_char, ...);
}
#[link(name = "rt")]
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
index 36e0d5144107d..0c15b8dfcc388 100644
--- a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
@@ -228,6 +228,7 @@ extern "C" {
pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
pub fn elf_aux_info(aux: ::c_int, buf: *mut ::c_void, buflen: ::c_int) -> ::c_int;
+ pub fn setproctitle_fast(fmt: *const ::c_char, ...);
}
cfg_if! {
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
index 8cb475d9b1abb..0aff081c5342a 100644
--- a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
@@ -233,6 +233,7 @@ extern "C" {
pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
pub fn elf_aux_info(aux: ::c_int, buf: *mut ::c_void, buflen: ::c_int) -> ::c_int;
+ pub fn setproctitle_fast(fmt: *const ::c_char, ...);
}
cfg_if! {
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index 9a64dc39fdd58..eb4a517d3bdd2 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -1579,6 +1579,7 @@ extern "C" {
) -> *mut ::c_void;
pub fn nmount(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
+ pub fn setproctitle(fmt: *const ::c_char, ...);
pub fn cpuset_getaffinity(
level: cpulevel_t,
which: cpuwhich_t,
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index 380062be925b8..61ed3c02d843e 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -2113,6 +2113,8 @@ extern "C" {
// Added in `NetBSD` 7.0
pub fn explicit_memset(b: *mut ::c_void, c: ::c_int, len: ::size_t);
+
+ pub fn setproctitle(fmt: *const ::c_char, ...);
}
#[link(name = "util")]
diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs
index 7c2a380f0de95..c5d45b4543823 100644
--- a/src/unix/bsd/netbsdlike/openbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs
@@ -1566,6 +1566,8 @@ extern "C" {
// Added in `OpenBSD` 5.5
pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
+
+ pub fn setproctitle(fmt: *const ::c_char, ...);
}
cfg_if! {
|
diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt
index 5f3e688e226fb..aa429bd107742 100644
--- a/libc-test/semver/dragonfly.txt
+++ b/libc-test/semver/dragonfly.txt
@@ -1344,6 +1344,7 @@ setgroups
sethostname
setitimer
setpriority
+setproctitle
setprogname
setpwent
setresgid
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt
index b7735db70724a..0dcc8153f14e4 100644
--- a/libc-test/semver/freebsd.txt
+++ b/libc-test/semver/freebsd.txt
@@ -1589,6 +1589,7 @@ setgroups
sethostname
setitimer
setpriority
+setproctitle
setprogname
setpwent
setresgid
diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt
index 3a08b5d444cce..af36a63805d07 100644
--- a/libc-test/semver/netbsd.txt
+++ b/libc-test/semver/netbsd.txt
@@ -1230,6 +1230,7 @@ setgroups
sethostname
setitimer
setpriority
+setproctitle
setprogname
setpwent
setrlimit
diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt
index f77196f831865..bc71595fd57eb 100644
--- a/libc-test/semver/openbsd.txt
+++ b/libc-test/semver/openbsd.txt
@@ -1040,6 +1040,7 @@ setgroups
sethostname
setitimer
setpriority
+setproctitle
setprogname
setpwent
setresgid
|
Add setproctitle
FreeBSD:
```
#include <sys/types.h>
#include <unistd.h>
void setproctitle(const char *fmt, ...);
void setproctitle_fast(const char *fmt, ...);
```
Certain BSD's have setproctitle to change the process title, and other unices have different ways of changing the process title (as shown in ps and such).
For FreeBSD see: https://www.freebsd.org/cgi/man.cgi?query=setproctitle&apropos=0&sektion=0&manpath=FreeBSD+13.0-RELEASE+and+Ports&arch=default&format=html
I'm not sure what's needed to get support for setproctitle, at least on platforms where it's supported. I'm not proficient at interacting with C from Rust but hopefully I can still help.
|
2021-05-31T19:25:46Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 2,201
|
rust-lang__libc-2201
|
[
"1600"
] |
86dff58336e037b88ae8279326960cca99f9ea4b
|
diff --git a/src/windows/mod.rs b/src/windows/mod.rs
index 377a6c75f961e..ad0dc77d23193 100644
--- a/src/windows/mod.rs
+++ b/src/windows/mod.rs
@@ -244,7 +244,13 @@ pub const SIGSEGV: ::c_int = 11;
pub const SIGTERM: ::c_int = 15;
pub const SIGABRT: ::c_int = 22;
pub const NSIG: ::c_int = 23;
+
pub const SIG_ERR: ::c_int = -1;
+pub const SIG_DFL: ::sighandler_t = 0;
+pub const SIG_IGN: ::sighandler_t = 1;
+pub const SIG_GET: ::sighandler_t = 2;
+pub const SIG_SGE: ::sighandler_t = 3;
+pub const SIG_ACK: ::sighandler_t = 4;
// inline comment below appeases style checker
#[cfg(all(target_env = "msvc", feature = "rustc-dep-of-std"))] // " if "
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index b0f7c0bebad9b..0c62045407647 100755
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -583,7 +583,9 @@ fn test_windows(target: &str) {
match name {
// FIXME: API error:
// SIG_ERR type is "void (*)(int)", not "int"
- "SIG_ERR" => true,
+ "SIG_ERR" |
+ // Similar for SIG_DFL/IGN/GET/SGE/ACK
+ "SIG_DFL" | "SIG_IGN" | "SIG_GET" | "SIG_SGE" | "SIG_ACK" => true,
// FIXME: newer windows-gnu environment on CI?
"_O_OBTAIN_DIR" if gnu => true,
_ => false,
diff --git a/libc-test/semver/windows.txt b/libc-test/semver/windows.txt
index eaa7790898217..1f66d622eb5c3 100644
--- a/libc-test/semver/windows.txt
+++ b/libc-test/semver/windows.txt
@@ -123,7 +123,12 @@ SIGILL
SIGINT
SIGSEGV
SIGTERM
+SIG_ACK
+SIG_DFL
SIG_ERR
+SIG_GET
+SIG_IGN
+SIG_SGE
SOCKET
STRUNCATE
S_IEXEC
|
SIG_DFL and SIG_IGN on windows
<!--
**Help us help you.**
If you are reporting a bug, include:
* a Minimum Working Example without any dependencies (except libc) that shows
the issue and ideally reproduces in the Rust playground
* the target triple - libc supports many targets and many APIs
* instructions to reproduce, logs (e.g. build logs, links to Travis-CI logs,
uploads to github gists, etc.).
If you are requesting a new API, include:
* the target triple
* link to the documentation of the API showing the type signatures, how to use
it, etc.
In general, just please consider that the people who can help you are all very
busy, they will be helping you in their free time, there are a lot of people in
need of help so they need to prioritize to which issues they devote their free
time, etc. So try to give most of the information upfront, be concise, show
small self-contained examples (nobody has time to create a new cargo project,
set up dependencies,...), etc. Help us help you.
-->
Hello
The `SIG_DFL` and `SIG_IGN` constants seem to be missing on windows targets (`*-pc-windows-*` tripples). It seems that according to the documentation they should exist
https://docs.microsoft.com/en-us/previous-versions/xdkz3x12(v=vs.140)
I'd try adding them, but I don't have any Windows at hand so I can't find the value. Some tests on CI suggest that `SIG_DFL` might be 0, though, but I can't really be sure.
Is it possible to add them?
Thank you
|
From `ucrt\signal.h`
```C
#define SIG_DFL ((_crt_signal_t)0) // default signal action
#define SIG_IGN ((_crt_signal_t)1) // ignore signal
#define SIG_GET ((_crt_signal_t)2) // return current value
#define SIG_SGE ((_crt_signal_t)3) // signal gets error
#define SIG_ACK ((_crt_signal_t)4) // acknowledge
#define SIG_ERR ((_crt_signal_t)-1) // signal error value
```
There is also one more definition but it seems like it shouldn't be used?
```C
#ifdef _CORECRT_BUILD
// Internal use only! Not valid as an argument to signal().
#define SIG_DIE ((_crt_signal_t)5) // terminate process
#endif
```
`_crt_signal_t` is defined like so and used in `signal` like so
```C
typedef void (__CRTDECL* _crt_signal_t)(int);
_ACRTIMP _crt_signal_t __cdecl signal(_In_ int _Signal, _In_opt_ _crt_signal_t _Function);
```
Anyway, just remember that you should only ever use CRT signals for compatibility with existing C code that also uses CRT signals. You should never use them otherwise.
Thank you, I'll send a pull request adding them, then.
> Anyway, just remember that you should only ever use CRT signals for compatibility with existing C code that also uses CRT signals. You should never use them otherwise.
Actually, I don't even have a Windows machine around. I've hit this when trying to keep some minimal compatibility with Windows in signal-hook, which is primarily a unix crate.
|
2021-05-27T15:58:05Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 2,172
|
rust-lang__libc-2172
|
[
"2171"
] |
d02ce7f18953c23dc85e85382900eb8e2dd18e8d
|
diff --git a/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs b/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
index 6e8fee41b12e7..73162c94ad9f3 100644
--- a/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
+++ b/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
@@ -160,6 +160,40 @@ pub const ENOTRECOVERABLE: ::c_int = 131;
pub const ERFKILL: ::c_int = 132;
pub const EHWPOISON: ::c_int = 133;
+// bits/hwcap.h
+pub const HWCAP_FP: ::c_ulong = 1 << 0;
+pub const HWCAP_ASIMD: ::c_ulong = 1 << 1;
+pub const HWCAP_EVTSTRM: ::c_ulong = 1 << 2;
+pub const HWCAP_AES: ::c_ulong = 1 << 3;
+pub const HWCAP_PMULL: ::c_ulong = 1 << 4;
+pub const HWCAP_SHA1: ::c_ulong = 1 << 5;
+pub const HWCAP_SHA2: ::c_ulong = 1 << 6;
+pub const HWCAP_CRC32: ::c_ulong = 1 << 7;
+pub const HWCAP_ATOMICS: ::c_ulong = 1 << 8;
+pub const HWCAP_FPHP: ::c_ulong = 1 << 9;
+pub const HWCAP_ASIMDHP: ::c_ulong = 1 << 10;
+pub const HWCAP_CPUID: ::c_ulong = 1 << 11;
+pub const HWCAP_ASIMDRDM: ::c_ulong = 1 << 12;
+pub const HWCAP_JSCVT: ::c_ulong = 1 << 13;
+pub const HWCAP_FCMA: ::c_ulong = 1 << 14;
+pub const HWCAP_LRCPC: ::c_ulong = 1 << 15;
+pub const HWCAP_DCPOP: ::c_ulong = 1 << 16;
+pub const HWCAP_SHA3: ::c_ulong = 1 << 17;
+pub const HWCAP_SM3: ::c_ulong = 1 << 18;
+pub const HWCAP_SM4: ::c_ulong = 1 << 19;
+pub const HWCAP_ASIMDDP: ::c_ulong = 1 << 20;
+pub const HWCAP_SHA512: ::c_ulong = 1 << 21;
+pub const HWCAP_SVE: ::c_ulong = 1 << 22;
+pub const HWCAP_ASIMDFHM: ::c_ulong = 1 << 23;
+pub const HWCAP_DIT: ::c_ulong = 1 << 24;
+pub const HWCAP_USCAT: ::c_ulong = 1 << 25;
+pub const HWCAP_ILRCPC: ::c_ulong = 1 << 26;
+pub const HWCAP_FLAGM: ::c_ulong = 1 << 27;
+pub const HWCAP_SSBS: ::c_ulong = 1 << 28;
+pub const HWCAP_SB: ::c_ulong = 1 << 29;
+pub const HWCAP_PACA: ::c_ulong = 1 << 30;
+pub const HWCAP_PACG: ::c_ulong = 1 << 31;
+
pub const MAP_ANON: ::c_int = 0x0020;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
pub const MAP_DENYWRITE: ::c_int = 0x0800;
|
diff --git a/libc-test/semver/TODO-linux.txt b/libc-test/semver/TODO-linux.txt
index 6396cf4684a1d..aefe205853fa4 100644
--- a/libc-test/semver/TODO-linux.txt
+++ b/libc-test/semver/TODO-linux.txt
@@ -1,38 +1,6 @@
# The following symbols are not not available in some combinations of
# musl/gnu/android and/or architecture.
BOTHER
-HWCAP_AES
-HWCAP_ASIMD
-HWCAP_ASIMDDP
-HWCAP_ASIMDFHM
-HWCAP_ASIMDHP
-HWCAP_ASIMDRDM
-HWCAP_ATOMICS
-HWCAP_CPUID
-HWCAP_CRC32
-HWCAP_DCPOP
-HWCAP_DIT
-HWCAP_EVTSTRM
-HWCAP_FCMA
-HWCAP_FLAGM
-HWCAP_FP
-HWCAP_FPHP
-HWCAP_ILRCPC
-HWCAP_JSCVT
-HWCAP_LRCPC
-HWCAP_PACA
-HWCAP_PACG
-HWCAP_PMULL
-HWCAP_SB
-HWCAP_SHA1
-HWCAP_SHA2
-HWCAP_SHA3
-HWCAP_SHA512
-HWCAP_SM3
-HWCAP_SM4
-HWCAP_SSBS
-HWCAP_SVE
-HWCAP_USCAT
KEYCTL_CAPABILITIES
KEYCTL_CAPS0_BIG_KEY
KEYCTL_CAPS0_CAPABILITIES
|
musl: HWCAP_* consts missing on aarch64 targets
It looks like #1638 added these constants, but for glibc only. #2109 added a [`TODO-linux.txt`](https://github.com/rust-lang/libc/blob/ed1399a/libc-test/semver/TODO-linux.txt) which made a note of this.
I just received an in-the-wild report about this (https://github.com/RustCrypto/hashes/issues/273) and noticed there wasn't a specific tracking issue for it, so I thought I'd open one.
At first glance it seems like this could be resolved by a PR similar to #1638, but adding the constants to `linux/musl/b64/aarch64/mod.rs`.
Is that the case? If so, I could try to open a PR to add these constants. Edit: opened #2172.
|
2021-05-13T15:57:04Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 2,156
|
rust-lang__libc-2156
|
[
"2009"
] |
66d82737f3d256b30fc0461fb44514a3a03db09e
|
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index 3955354ff28d8..791f35d58c313 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -3843,6 +3843,10 @@ extern "C" {
dst: *const ::c_char,
flags: u32,
) -> ::c_int;
+
+ // Added in macOS 10.13
+ // ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
+ pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
}
#[link(name = "iconv")]
diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs
index a40bb3dca5e3b..b0400c34ae629 100644
--- a/src/unix/bsd/freebsdlike/mod.rs
+++ b/src/unix/bsd/freebsdlike/mod.rs
@@ -1591,6 +1591,12 @@ extern "C" {
outbytesleft: *mut ::size_t,
) -> ::size_t;
pub fn iconv_close(cd: iconv_t) -> ::c_int;
+
+ // Added in `FreeBSD` 11.0
+ // Added in `DragonFly BSD` 5.4
+ pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
+ // ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
+ pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
}
#[link(name = "rt")]
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index 46416c89c569d..a4f4148d06bfe 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -2083,6 +2083,9 @@ extern "C" {
outbytesleft: *mut ::size_t,
) -> ::size_t;
pub fn iconv_close(cd: iconv_t) -> ::c_int;
+
+ // Added in `NetBSD` 7.0
+ pub fn explicit_memset(b: *mut ::c_void, c: ::c_int, len: ::size_t);
}
#[link(name = "util")]
diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs
index 3d6894e00201b..07b1e1e2db652 100644
--- a/src/unix/bsd/netbsdlike/openbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs
@@ -1543,6 +1543,9 @@ extern "C" {
pub fn freelocale(loc: ::locale_t);
pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
pub fn duplocale(base: ::locale_t) -> ::locale_t;
+
+ // Added in `OpenBSD` 5.5
+ pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
}
cfg_if! {
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index 6098552d2c2d9..cc7e414f69c29 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -1233,6 +1233,9 @@ extern "C" {
newpath: *const ::c_char,
flags: ::c_uint,
) -> ::c_int;
+
+ // Added in `glibc` 2.25
+ pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
}
extern "C" {
diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs
index 52e0e1fe0a6ad..03f13e2878e65 100644
--- a/src/unix/linux_like/linux/musl/mod.rs
+++ b/src/unix/linux_like/linux/musl/mod.rs
@@ -697,6 +697,9 @@ extern "C" {
path: *const ::c_char,
) -> ::c_int;
pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
+
+ // Added in `musl` 1.1.20
+ pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
}
cfg_if! {
|
diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt
index d860f57d735b2..b54f46088d493 100644
--- a/libc-test/semver/apple.txt
+++ b/libc-test/semver/apple.txt
@@ -1619,6 +1619,7 @@ mach_timebase_info_data_t
madvise
max_align_t
mcontext_t
+memset_s
mincore
mkdirat
mkstemps
diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt
index 0789ae8439771..873acefb1d505 100644
--- a/libc-test/semver/dragonfly.txt
+++ b/libc-test/semver/dragonfly.txt
@@ -1174,6 +1174,7 @@ endpwent
endservent
endutxent
exit_status
+explicit_bzero
faccessat
fchdir
fchflags
@@ -1243,6 +1244,7 @@ lwpid_t
madvise
memmem
memrchr
+memset_s
mincore
mkdirat
mkfifoat
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt
index a962519bb587f..6433821b5080c 100644
--- a/libc-test/semver/freebsd.txt
+++ b/libc-test/semver/freebsd.txt
@@ -1350,6 +1350,7 @@ endgrent
endpwent
endservent
endutxent
+explicit_bzero
extattr_delete_fd
extattr_delete_file
extattr_delete_link
@@ -1442,6 +1443,7 @@ lwpid_t
madvise
memmem
memrchr
+memset_s
mincore
mkdirat
mkfifoat
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
index ec686e815f501..58b2eb6c944b1 100644
--- a/libc-test/semver/linux-gnu.txt
+++ b/libc-test/semver/linux-gnu.txt
@@ -529,6 +529,7 @@ copy_file_range
dlinfo
dlmopen
endutxent
+explicit_bzero
fgetspent_r
getgrent_r
getpt
diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt
index 1692b9c2d8ad2..53b3adfdde38d 100644
--- a/libc-test/semver/linux-musl.txt
+++ b/libc-test/semver/linux-musl.txt
@@ -1,1 +1,2 @@
# TODO: musl.
+explicit_bzero
diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt
index 982b2b8e98de2..23219e1eddb8a 100644
--- a/libc-test/semver/netbsd.txt
+++ b/libc-test/semver/netbsd.txt
@@ -1034,6 +1034,7 @@ endpwent
endservent
endutent
endutxent
+explicit_memset
extattr_delete_fd
extattr_delete_file
extattr_delete_link
diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt
index 0f8eeaab571c6..1fcce82989a9b 100644
--- a/libc-test/semver/openbsd.txt
+++ b/libc-test/semver/openbsd.txt
@@ -897,6 +897,7 @@ endgrent
endpwent
endservent
execvpe
+explicit_bzero
export_args
faccessat
fchdir
|
Add `memset_s` and/or `explicit_bzero` for platforms that support it
target platforms: linux, BSD
I would be interested in adding `memset_s` and `explicit_bzero` from `string.h`. These functions allow securely erasing memory. If a PR would be accepted, I can make one.
One question I would have for linux is: What is the minimum version of libc (glibc/musl etc.) that should be supported? Is this documented somewhere?
@rustbot modify labels: +C-API-request and +O-linux and +O-bsd
|
These functions typically have extra annotations to ensure that compiler optimizations will never remove them. Rust doesn't currently have a means of providing those annotations. Thus, I think we shouldn't add these (and give a false impression of their functionality) until the compiler has a means of doing explicit non-removable zeroing.
I do not see how a compiler could optimize out such call. It can't optimize away an entire FFI call, right? The FFI call could have side effects, as far as the compiler knows... FFI is a very strong optimisation barrier without cross-language/linker-plugin LTO.
As long as the `volatile_set_memory` intrinsic does not have a stable counterpart this is actually the only secure and reasonably fast way to zeroize memory on stable.
NetBSD has [explicit_memset(3)](http://man.netbsd.org/explicit_memset.3)
|
2021-05-02T10:16:41Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 2,109
|
rust-lang__libc-2109
|
[
"2104"
] |
10d99b96e041448a45cb1464f8ff1f67bd43ce00
|
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 5d52cad7fc6b9..5be6eb9be4a22 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -28,14 +28,24 @@ at, fear not! This crate has CI support which tests any binding against all
platforms supported, so you'll see failures if an API is added at the wrong
level or has different signatures across platforms.
+New symbol(s) (i.e. functions, constants etc.) should also be added to the
+symbols list(s) found in the `libc-test/semver` directory. These lists keep
+track of what symbols are public in the libc crate and ensures they remain
+available between changes to the crate. If the new symbol(s) are available on
+all supported Unixes it should be added to `unix.txt` list<sup>1</sup>,
+otherwise they should be added to the OS specific list(s).
+
With that in mind, the steps for adding a new API are:
1. Determine where in the module hierarchy your API should be added.
-2. Add the API.
+2. Add the API, including adding new symbol(s) to the semver lists.
3. Send a PR to this repo.
4. Wait for CI to pass, fixing errors.
5. Wait for a merge!
+<sup>1</sup>: Note that this list has nothing to do with any Unix or Posix
+standard, it's just a list shared between all OSs that declare `#[cfg(unix)]`.
+
## Test before you commit
We have two automated tests running on [GitHub Actions](https://github.com/rust-lang/libc/actions):
|
diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml
index 0fc35762068d2..d6c9aeef86d23 100644
--- a/libc-test/Cargo.toml
+++ b/libc-test/Cargo.toml
@@ -65,3 +65,8 @@ harness = true
name = "errqueue"
path = "test/errqueue.rs"
harness = true
+
+[[test]]
+name = "semver"
+path = "test/semver.rs"
+harness = false
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 7333fa2e5bfdb..fe8572d971dfd 100755
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -3,7 +3,10 @@
extern crate cc;
extern crate ctest2 as ctest;
-use std::env;
+use std::fs::File;
+use std::io::{BufRead, BufReader, BufWriter, Write};
+use std::path::{Path, PathBuf};
+use std::{env, io};
fn do_cc() {
let target = env::var("TARGET").unwrap();
@@ -63,9 +66,85 @@ fn ctest_cfg() -> ctest::TestGenerator {
cfg
}
+fn do_semver() {
+ let mut out = PathBuf::from(env::var("OUT_DIR").unwrap());
+ out.push("semver.rs");
+ let mut output = BufWriter::new(File::create(&out).unwrap());
+
+ let family = env::var("CARGO_CFG_TARGET_FAMILY").unwrap();
+ let vendor = env::var("CARGO_CFG_TARGET_VENDOR").unwrap();
+ let os = env::var("CARGO_CFG_TARGET_OS").unwrap();
+ let arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
+ let target_env = env::var("CARGO_CFG_TARGET_ENV").unwrap();
+
+ // `libc-test/semver` dir.
+ let mut semver_root =
+ PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
+ semver_root.push("semver");
+
+ // NOTE: Windows has the same `family` as `os`, no point in including it
+ // twice.
+ // NOTE: Android doesn't include the unix file (or the Linux file) because
+ // there are some many definitions missing it's actually easier just to
+ // maintain a file for Android.
+ if family != os && os != "android" {
+ process_semver_file(&mut output, &mut semver_root, &family);
+ }
+ process_semver_file(&mut output, &mut semver_root, &vendor);
+ process_semver_file(&mut output, &mut semver_root, &os);
+ let os_arch = format!("{}-{}", os, arch);
+ process_semver_file(&mut output, &mut semver_root, &os_arch);
+ if target_env != "" {
+ let os_env = format!("{}-{}", os, target_env);
+ process_semver_file(&mut output, &mut semver_root, &os_env);
+
+ let os_env_arch = format!("{}-{}-{}", os, target_env, arch);
+ process_semver_file(&mut output, &mut semver_root, &os_env_arch);
+ }
+}
+
+fn process_semver_file<W: Write, P: AsRef<Path>>(
+ output: &mut W,
+ path: &mut PathBuf,
+ file: P,
+) {
+ // NOTE: `path` is reused between calls, so always remove the file again.
+ path.push(file);
+ path.set_extension("txt");
+
+ println!("cargo:rerun-if-changed={}", path.display());
+ let input_file = match File::open(&*path) {
+ Ok(file) => file,
+ Err(ref err) if err.kind() == io::ErrorKind::NotFound => {
+ path.pop();
+ return;
+ }
+ Err(err) => panic!("unexpected error opening file: {}", err),
+ };
+ let input = BufReader::new(input_file);
+
+ write!(output, "// Source: {}.\n", path.display()).unwrap();
+ output.write(b"use libc::{\n").unwrap();
+ for line in input.lines() {
+ let line = line.unwrap().into_bytes();
+ match line.first() {
+ // Ignore comments and empty lines.
+ Some(b'#') | None => continue,
+ _ => {
+ output.write(b" ").unwrap();
+ output.write(&line).unwrap();
+ output.write(b",\n").unwrap();
+ }
+ }
+ }
+ output.write(b"};\n\n").unwrap();
+ path.pop();
+}
+
fn main() {
do_cc();
do_ctest();
+ do_semver();
}
macro_rules! headers {
diff --git a/libc-test/semver/README.md b/libc-test/semver/README.md
new file mode 100644
index 0000000000000..624387172d00a
--- /dev/null
+++ b/libc-test/semver/README.md
@@ -0,0 +1,17 @@
+# Supported API by libc
+
+These files are read by [`build.rs`](../build.rs) and turned into tests to
+ensure that APIs aren't removed between libc releases.
+
+## File order
+
+Files are including in the following order:
+ * Family, e.g. `unix.txt`. NOTE: Windows is skipped here and includes as OS
+ name below.
+ * Vendor, e.g. `apple.txt`. This allows us to have a single file with system
+ calls shared between multiple OSs, e.g. `ios.txt`, `macos.txt` share the same
+ kernel.
+ * OS, e.g `linux.txt`, `macos.txt`, `windows.txt`.
+ * Architecture specific system calls, e.g. `linux-x86_64.txt` or
+ `linux-aarch64.txt`.
+ * Target environment, e.g. `windows-mscv.txt` or `windows-gnu.txt`.
diff --git a/libc-test/semver/TODO-linux.txt b/libc-test/semver/TODO-linux.txt
new file mode 100644
index 0000000000000..6396cf4684a1d
--- /dev/null
+++ b/libc-test/semver/TODO-linux.txt
@@ -0,0 +1,117 @@
+# The following symbols are not not available in some combinations of
+# musl/gnu/android and/or architecture.
+BOTHER
+HWCAP_AES
+HWCAP_ASIMD
+HWCAP_ASIMDDP
+HWCAP_ASIMDFHM
+HWCAP_ASIMDHP
+HWCAP_ASIMDRDM
+HWCAP_ATOMICS
+HWCAP_CPUID
+HWCAP_CRC32
+HWCAP_DCPOP
+HWCAP_DIT
+HWCAP_EVTSTRM
+HWCAP_FCMA
+HWCAP_FLAGM
+HWCAP_FP
+HWCAP_FPHP
+HWCAP_ILRCPC
+HWCAP_JSCVT
+HWCAP_LRCPC
+HWCAP_PACA
+HWCAP_PACG
+HWCAP_PMULL
+HWCAP_SB
+HWCAP_SHA1
+HWCAP_SHA2
+HWCAP_SHA3
+HWCAP_SHA512
+HWCAP_SM3
+HWCAP_SM4
+HWCAP_SSBS
+HWCAP_SVE
+HWCAP_USCAT
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+NFT_MSG_DELOBJ
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_NEWOBJ
+PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+SCM_TIMESTAMPING_OPT_STATS
+SCM_TIMESTAMPING_PKTINFO
+SCM_TIMESTAMPNS
+SCM_TXTIME
+SCM_WIFI_STATUS
+SO_ATTACH_BPF
+SO_ATTACH_FILTER
+SO_ATTACH_REUSEPORT_CBPF
+SO_ATTACH_REUSEPORT_EBPF
+SO_BINDTOIFINDEX
+SO_BPF_EXTENSIONS
+SO_BSDCOMPAT
+SO_CNX_ADVICE
+SO_COOKIE
+SO_DETACH_BPF
+SO_DETACH_FILTER
+SO_DETACH_REUSEPORT_BPF
+SO_GET_FILTER
+SO_INCOMING_CPU
+SO_INCOMING_NAPI_ID
+SO_LOCK_FILTER
+SO_MAX_PACING_RATE
+SO_MEMINFO
+SO_NOFCS
+SO_NO_CHECK
+SO_PEERGROUPS
+SO_PEERNAME
+SO_RCVTIMEO_NEW
+SO_SECURITY_AUTHENTICATION
+SO_SECURITY_ENCRYPTION_NETWORK
+SO_SECURITY_ENCRYPTION_TRANSPORT
+SO_SELECT_ERR_QUEUE
+SO_SNDTIMEO_NEW
+SO_STYLE
+SO_TIMESTAMPING_NEW
+SO_TIMESTAMPNS
+SO_TIMESTAMPNS_NEW
+SO_TIMESTAMP_NEW
+SO_TXTIME
+SO_WIFI_STATUS
+SO_ZEROCOPY
+SYS__llseek
+SYS__newselect
+SYS__sysctl
+SYS_create_module
+SYS_fadvise64
+SYS_fstatat64
+SYS_get_kernel_syms
+SYS_get_thread_area
+SYS_getrlimit
+SYS_migrate_pages
+SYS_mmap
+SYS_nfsservctl
+SYS_pread64
+SYS_pwrite64
+SYS_query_module
+SYS_set_thread_area
+SYS_uselib
+fsblkcnt64_t
+fsfilcnt64_t
+getrandom
+sysctl
+termios2
diff --git a/libc-test/semver/TODO-unix.txt b/libc-test/semver/TODO-unix.txt
new file mode 100644
index 0000000000000..4d6874d90c874
--- /dev/null
+++ b/libc-test/semver/TODO-unix.txt
@@ -0,0 +1,5 @@
+# These symbols are missing for the targets:
+# * asmjs-unknown-emscripten
+getpwuid_r
+pthread_atfork
+pthread_sigmask
diff --git a/libc-test/semver/android-aarch64.txt b/libc-test/semver/android-aarch64.txt
new file mode 100644
index 0000000000000..48b9b38a915db
--- /dev/null
+++ b/libc-test/semver/android-aarch64.txt
@@ -0,0 +1,11 @@
+HWCAP2_DCPODP
+HWCAP2_FLAGM2
+HWCAP2_FRINT
+HWCAP2_SVE2
+HWCAP2_SVEAES
+HWCAP2_SVEBITPERM
+HWCAP2_SVEPMULL
+HWCAP2_SVESHA3
+HWCAP2_SVESM4
+SYS_arch_specific_syscall
+SYS_syscalls
diff --git a/libc-test/semver/android-arm.txt b/libc-test/semver/android-arm.txt
new file mode 100644
index 0000000000000..fe1ce5bba1c5d
--- /dev/null
+++ b/libc-test/semver/android-arm.txt
@@ -0,0 +1,121 @@
+NGREG
+PTRACE_GETFPREGS
+PTRACE_GETREGS
+PTRACE_SETFPREGS
+PTRACE_SETREGS
+REG_R0
+REG_R1
+REG_R10
+REG_R11
+REG_R12
+REG_R13
+REG_R14
+REG_R15
+REG_R2
+REG_R3
+REG_R4
+REG_R5
+REG_R6
+REG_R7
+REG_R8
+REG_R9
+SYS_accept
+SYS_access
+SYS_arm_fadvise64_64
+SYS_arm_sync_file_range
+SYS_bdflush
+SYS_chmod
+SYS_chown
+SYS_chown32
+SYS_creat
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_fchown32
+SYS_fcntl64
+SYS_fork
+SYS_fstat64
+SYS_fstatat64
+SYS_fstatfs64
+SYS_ftruncate64
+SYS_futimesat
+SYS_getdents
+SYS_getegid32
+SYS_geteuid32
+SYS_getgid32
+SYS_getgroups32
+SYS_getpgrp
+SYS_getresgid32
+SYS_getresuid32
+SYS_getuid32
+SYS_inotify_init
+SYS_lchown
+SYS_lchown32
+SYS_link
+SYS_lstat
+SYS_lstat64
+SYS_mkdir
+SYS_mknod
+SYS_mmap2
+SYS_msgctl
+SYS_msgget
+SYS_msgrcv
+SYS_msgsnd
+SYS_nice
+SYS_open
+SYS_pause
+SYS_pciconfig_iobase
+SYS_pciconfig_read
+SYS_pciconfig_write
+SYS_pipe
+SYS_poll
+SYS_readlink
+SYS_recv
+SYS_rename
+SYS_rmdir
+SYS_semctl
+SYS_semget
+SYS_semop
+SYS_semtimedop
+SYS_send
+SYS_sendfile
+SYS_sendfile64
+SYS_setfsgid32
+SYS_setfsuid32
+SYS_setgid32
+SYS_setgroups32
+SYS_setregid32
+SYS_setresgid32
+SYS_setresuid32
+SYS_setreuid32
+SYS_setuid32
+SYS_shmat
+SYS_shmctl
+SYS_shmdt
+SYS_shmget
+SYS_sigaction
+SYS_signalfd
+SYS_sigpending
+SYS_sigprocmask
+SYS_sigreturn
+SYS_sigsuspend
+SYS_stat
+SYS_stat64
+SYS_statfs64
+SYS_symlink
+SYS_sysfs
+SYS_truncate64
+SYS_ugetrlimit
+SYS_unlink
+SYS_uselib
+SYS_ustat
+SYS_utimes
+SYS_vfork
+SYS_vserver
+__c_anonymous_uc_sigmask
+__c_anonymous_uc_sigmask_with_padding
+greg_t
+sigcontext
+time64_t
+timegm64
diff --git a/libc-test/semver/android-i686.txt b/libc-test/semver/android-i686.txt
new file mode 100644
index 0000000000000..eb6ecadba60b5
--- /dev/null
+++ b/libc-test/semver/android-i686.txt
@@ -0,0 +1,4 @@
+__c_anonymous_uc_sigmask
+__c_anonymous_uc_sigmask_with_padding
+time64_t
+timegm64
diff --git a/libc-test/semver/android-x86_64.txt b/libc-test/semver/android-x86_64.txt
new file mode 100644
index 0000000000000..c4bb87bccb66d
--- /dev/null
+++ b/libc-test/semver/android-x86_64.txt
@@ -0,0 +1,65 @@
+EFLAGS
+FS_BASE
+GS_BASE
+ORIG_RAX
+R10
+R11
+R12
+R13
+R14
+R15
+R8
+R9
+RAX
+RBP
+RBX
+RCX
+RDI
+RDX
+REG_CR2
+REG_CSGSFS
+REG_OLDMASK
+REG_R10
+REG_R11
+REG_R12
+REG_R13
+REG_R14
+REG_R15
+REG_R8
+REG_R9
+REG_RAX
+REG_RBP
+REG_RBX
+REG_RCX
+REG_RDI
+REG_RDX
+REG_RIP
+REG_RSI
+REG_RSP
+RIP
+RSI
+RSP
+SYS_accept
+SYS_arch_prctl
+SYS_epoll_ctl_old
+SYS_epoll_wait_old
+SYS_kexec_file_load
+SYS_msgctl
+SYS_msgget
+SYS_msgrcv
+SYS_msgsnd
+SYS_newfstatat
+SYS_security
+SYS_semctl
+SYS_semget
+SYS_semop
+SYS_semtimedop
+SYS_shmat
+SYS_shmctl
+SYS_shmdt
+SYS_shmget
+SYS_tuxcall
+SYS_vserver
+__c_anonymous_uc_sigmask
+_libc_fpxreg
+_libc_xmmreg
diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt
new file mode 100644
index 0000000000000..7181fb2d098ab
--- /dev/null
+++ b/libc-test/semver/android.txt
@@ -0,0 +1,3257 @@
+ADDR_COMPAT_LAYOUT
+ADDR_LIMIT_32BIT
+ADDR_LIMIT_3GB
+ADDR_NO_RANDOMIZE
+ADFS_SUPER_MAGIC
+AFFS_SUPER_MAGIC
+AF_ALG
+AF_APPLETALK
+AF_ASH
+AF_ATMPVC
+AF_ATMSVC
+AF_AX25
+AF_BLUETOOTH
+AF_BRIDGE
+AF_CAIF
+AF_CAN
+AF_DECnet
+AF_ECONET
+AF_IEEE802154
+AF_INET
+AF_INET6
+AF_IPX
+AF_IRDA
+A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ICOM
+ARPHRD_NETROM
+ARPHRD_NONE
+ARPHRD_PIMREG
+ARPHRD_PPP
+ARPHRD_PRONET
+ARPHRD_RAWHDLC
+ARPHRD_ROSE
+ARPHRD_RSRVD
+ARPHRD_SIT
+ARPHRD_SKIP
+ARPHRD_SLIP
+ARPHRD_SLIP6
+ARPHRD_TUNNEL
+ARPHRD_TUNNEL6
+ARPHRD_VOID
+ARPHRD_X25
+ARPOP_InREPLY
+ARPOP_InREQUEST
+ARPOP_NAK
+ARPOP_REPLY
+ARPOP_REQUEST
+ARPOP_RREPLY
+ARPOP_RREQUEST
+ATF_COM
+ATF_DONTPUB
+ATF_NETMASK
+ATF_PERM
+ATF_PUBL
+ATF_USETRAILERS
+AT_EMPTY_PATH
+AT_FDCWD
+AT_NO_AUTOMOUNT
+AT_REMOVEDIR
+AT_SYMLINK_FOLLOW
+AT_SYMLINK_NOFOLLOW
+B0
+B1000000
+B110
+B115200
+B1152000
+B1200
+B134
+B150
+B1500000
+B1800
+B19200
+B200
+B2000000
+B230400
+B2400
+B2500000
+B300
+B3000000
+B3500000
+B38400
+B4000000
+B460800
+B4800
+B50
+B500000
+B57600
+B576000
+B600
+B75
+B921600
+B9600
+BOTHER
+BRKINT
+BS0
+BS1
+BSDLY
+BUFSIZ
+CBAUD
+CBAUDEX
+CIBAUD
+CLD_CONTINUED
+CLD_DUMPED
+CLD_EXITED
+CLD_KILLED
+CLD_STOPPED
+CLD_TRAPPED
+CLOCAL
+CLOCK_BOOTTIME
+CLOCK_BOOTTIME_ALARM
+CLOCK_MONOTONIC
+CLOCK_MONOTONIC_COARSE
+CLOCK_MONOTONIC_RAW
+CLOCK_PROCESS_CPUTIME_ID
+CLOCK_REALTIME
+CLOCK_REALTIME_ALARM
+CLOCK_REALTIME_COARSE
+CLOCK_TAI
+CLOCK_THREAD_CPUTIME_ID
+CLONE_CHILD_CLEARTID
+CLONE_CHILD_SETTID
+CLONE_DETACHED
+CLONE_FILES
+CLONE_FS
+CLONE_IO
+C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TCLASS
+IPV6_ROUTER_ALERT
+IPV6_ROUTER_ALERT_ISOLATE
+IPV6_RTHDR
+IPV6_RTHDRDSTOPTS
+IPV6_TCLASS
+IPV6_TRANSPARENT
+IPV6_UNICAST_HOPS
+IPV6_UNICAST_IF
+IPV6_V6ONLY
+IPV6_XFRM_POLICY
+IPVERSION
+IP_ADD_MEMBERSHIP
+IP_ADD_SOURCE_MEMBERSHIP
+IP_BIND_ADDRESS_NO_PORT
+IP_BLOCK_SOURCE
+IP_CHECKSUM
+IP_DEFAULT_MULTICAST_LOOP
+IP_DEFAULT_MULTICAST_TTL
+IP_DROP_MEMBERSHIP
+IP_DROP_SOURCE_MEMBERSHIP
+IP_FREEBIND
+IP_HDRINCL
+IP_IPSEC_POLICY
+IP_MINTTL
+IP_MSFILTER
+IP_MTU
+IP_MTU_DISCOVER
+IP_MULTICAST_ALL
+IP_MULTICAST_IF
+IP_MULTICAST_LOOP
+IP_MULTICAST_TTL
+IP_NODEFRAG
+IP_OPTIONS
+IP_ORIGDSTADDR
+IP_PASSSEC
+IP_PKTINFO
+IP_PKTOPTIONS
+IP_PMTUDISC_DO
+IP_PMTUDISC_DONT
+IP_PMTUDISC_INTERFACE
+IP_PMTUDISC_OMIT
+IP_PMTUDISC_PROBE
+IP_PMTUDISC_WANT
+IP_RECVERR
+IP_RECVFRAGSIZE
+IP_RECVOPTS
+IP_RECVORIGDSTADDR
+IP_RECVTOS
+IP_RECVTTL
+IP_RETOPTS
+IP_ROUTER_ALERT
+IP_TOS
+IP_TRANSPARENT
+IP_TTL
+IP_UNBLOCK_SOURCE
+IP_UNICAST_IF
+IP_XFRM_POLICY
+ISIG
+ISOFS_SUPER_MAGIC
+ISTRIP
+IUTF8
+IXANY
+IXOFF
+IXON
+JFFS2_SUPER_MAGIC
+LC_ADDRESS
+LC_ADDRESS_MASK
+LC_ALL
+LC_ALL_MASK
+LC_COLLATE
+LC_COLLATE_MASK
+LC_CTYPE
+LC_CTYPE_MASK
+LC_IDENTIFICATION
+LC_IDENTIFICATION_MASK
+LC_MEASUREMENT
+LC_MEASUREMENT_MASK
+LC_MESSAGES
+LC_MESSAGES_MASK
+LC_MONETARY
+LC_MONETARY_MASK
+LC_NAME
+LC_NAME_MASK
+LC_NUMERIC
+LC_NUMERIC_MASK
+LC_PAPER
+LC_PAPER_MASK
+LC_TELEPHONE
+LC_TELEPHONE_MASK
+LC_TIME
+LC_TIME_MASK
+LINUX_REBOOT_CMD_CAD_OFF
+LINUX_REBOOT_CMD_CAD_ON
+LINUX_REBOOT_CMD_HALT
+LINUX_REBOOT_CMD_KEXEC
+LINUX_REBOOT_CMD_POWER_OFF
+LINUX_REBOOT_CMD_RESTART
+LINUX_REBOOT_CMD_RESTART2
+LINUX_REBOOT_CMD_SW_SUSPEND
+LINUX_REBOOT_MAGIC1
+LINUX_REBOOT_MAGIC2
+LINUX_REBOOT_MAGIC2A
+LINUX_REBOOT_MAGIC2B
+LINUX_REBOOT_MAGIC2C
+LOCK_EX
+LOCK_NB
+LOCK_SH
+LOCK_UN
+LOG_ALERT
+LOG_AUTH
+LOG_AUTHPRIV
+LOG_CONS
+LOG_CRIT
+LOG_CRON
+LOG_DAEMON
+LOG_DEBUG
+LOG_EMERG
+LOG_ERR
+LOG_FACMASK
+LOG_FTP
+LOG_INFO
+LOG_KERN
+LOG_LOCAL0
+LOG_LOCAL1
+LOG_LOCAL2
+LOG_LOCAL3
+LOG_LOCAL4
+LOG_LOCAL5
+LOG_LOCAL6
+LOG_LOCAL7
+LOG_LPR
+LOG_MAIL
+LOG_NDELAY
+LOG_NEWS
+LOG_NOTICE
+LOG_NOWAIT
+LOG_ODELAY
+LOG_PERROR
+LOG_PID
+LOG_PRIMASK
+LOG_SYSLOG
+LOG_USER
+LOG_UUCP
+LOG_WARNING
+L_tmpnam
+MADV_DODUMP
+MADV_DOFORK
+MADV_DONTDUMP
+MADV_DONTFORK
+MADV_DONTNEED
+MADV_FREE
+MADV_HUGEPAGE
+MADV_HWPOISON
+MADV_MERGEABLE
+MADV_NOHUGEPAGE
+MADV_NORMAL
+MADV_RANDOM
+MADV_REMOVE
+MADV_SEQUENTIAL
+MADV_SOFT_OFFLINE
+MADV_UNMERGEABLE
+MADV_WILLNEED
+MAP_ANON
+MAP_ANONYMOUS
+MAP_DENYWRITE
+MAP_EXECUTABLE
+MAP_FAILED
+MAP_FILE
+MAP_FIXED
+MAP_GROWSDOWN
+MAP_HUGETLB
+MAP_LOCKED
+MAP_NONBLOCK
+MAP_NORESERVE
+MAP_POPULATE
+MAP_PRIVATE
+MAP_SHARED
+MAP_STACK
+MAP_TYPE
+MAXTTL
+MAX_IPOPTLEN
+MAX_LINKS
+MCAST_BLOCK_SOURCE
+MCAST_EXCLUDE
+MCAST_INCLUDE
+MCAST_JOIN_GROUP
+MCAST_JOIN_SOURCE_GROUP
+MCAST_LEAVE_GROUP
+MCAST_LEAVE_SOURCE_GROUP
+MCAST_MSFILTER
+MCAST_UNBLOCK_SOURCE
+MCL_CURRENT
+MCL_FUTURE
+MFD_ALLOW_SEALING
+MFD_CLOEXEC
+MFD_HUGETLB
+MINIX2_SUPER_MAGIC
+MINIX2_SUPER_MAGIC2
+MINIX_SUPER_MAGIC
+MINIX_SUPER_MAGIC2
+MINSIGSTKSZ
+MMAP_PAGE_ZERO
+MNT_DETACH
+MNT_EXPIRE
+MNT_FORCE
+MODULE_INIT_IGNORE_MODVERSIONS
+MODULE_INIT_IGNORE_VERMAGIC
+MSDOS_SUPER_MAGIC
+MSG_CMSG_CLOEXEC
+MSG_CONFIRM
+MSG_CTRUNC
+MSG_DONTROUTE
+MSG_DONTWAIT
+MSG_EOR
+MSG_ERRQUEUE
+MSG_FASTOPEN
+MSG_FIN
+MSG_MORE
+MSG_NOSIGNAL
+MSG_OOB
+MSG_PEEK
+MSG_RST
+MSG_SYN
+MSG_TRUNC
+MSG_WAITALL
+MSG_WAITFORONE
+MS_ACTIVE
+MS_ASYNC
+MS_BIND
+MS_DIRSYNC
+MS_INVALIDATE
+MS_I_VERSION
+MS_KERNMOUNT
+MS_MANDLOCK
+MS_MGC_MSK
+MS_MGC_VAL
+MS_MOVE
+MS_NOATIME
+MS_NODEV
+MS_NODIRATIME
+MS_NOEXEC
+MS_NOSUID
+MS_NOUSER
+MS_POSIXACL
+MS_PRIVATE
+MS_RDONLY
+MS_REC
+MS_RELATIME
+MS_REMOUNT
+MS_RMT_MASK
+MS_SHARED
+MS_SILENT
+MS_SLAVE
+MS_STRICTATIME
+MS_SYNC
+MS_SYNCHRONOUS
+MS_UNBINDABLE
+NCCS
+NCP_SUPER_MAGIC
+NETLINK_ADD_MEMBERSHIP
+NETLINK_AUDIT
+NETLINK_BROADCAST_ERROR
+NETLINK_CONNECTOR
+NETLINK_CRYPTO
+NETLINK_DNRTMSG
+NETLINK_DROP_MEMBERSHIP
+NETLINK_ECRYPTFS
+NETLINK_FIB_LOOKUP
+NETLINK_FIREWALL
+NETLINK_GENERIC
+NETLINK_INET_DIAG
+NETLINK_IP6_FW
+NETLINK_ISCSI
+NETLINK_KOBJECT_UEVENT
+NETLINK_NETFILTER
+NETLINK_NFLOG
+NETLINK_NO_ENOBUFS
+NETLINK_PKTINFO
+NETLINK_RDMA
+NETLINK_ROUTE
+NETLINK_RX_RING
+NETLINK_SCSITRANSPORT
+NETLINK_SELINUX
+NETLINK_SOCK_DIAG
+NETLINK_TX_RING
+NETLINK_UNUSED
+NETLINK_USERSOCK
+NETLINK_XFRM
+NFNETLINK_V0
+NFNLGRP_ACCT_QUOTA
+NFNLGRP_CONNTRACK_DESTROY
+NFNLGRP_CONNTRACK_EXP_DESTROY
+NFNLGRP_CONNTRACK_EXP_NEW
+NFNLGRP_CONNTRACK_EXP_UPDATE
+NFNLGRP_CONNTRACK_NEW
+NFNLGRP_CONNTRACK_UPDATE
+NFNLGRP_NFTABLES
+NFNLGRP_NONE
+NFNL_MSG_BATCH_BEGIN
+NFNL_MSG_BATCH_END
+NFNL_SUBSYS_ACCT
+NFNL_SUBSYS_COUNT
+NFNL_SU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PACKET
+NFQNL_MSG_CONFIG
+NFQNL_MSG_PACKET
+NFQNL_MSG_VERDICT
+NFQNL_MSG_VERDICT_BATCH
+NFS_SUPER_MAGIC
+NFT_BREAK
+NFT_BYTEORDER_HTON
+NFT_BYTEORDER_NTOH
+NFT_CHAIN_MAXNAMELEN
+NFT_CMP_EQ
+NFT_CMP_GT
+NFT_CMP_GTE
+NFT_CMP_LT
+NFT_CMP_LTE
+NFT_CMP_NEQ
+NFT_CONTINUE
+NFT_CT_BYTES
+NFT_CT_DIRECTION
+NFT_CT_DST
+NFT_CT_EXPIRATION
+NFT_CT_HELPER
+NFT_CT_L3PROTOCOL
+NFT_CT_LABELS
+NFT_CT_MARK
+NFT_CT_PKTS
+NFT_CT_PROTOCOL
+NFT_CT_PROTO_DST
+NFT_CT_PROTO_SRC
+NFT_CT_SECMARK
+NFT_CT_SRC
+NFT_CT_STATE
+NFT_CT_STATUS
+NFT_DATA_RESERVED_MASK
+NFT_DATA_VALUE
+NFT_DATA_VALUE_MAXLEN
+NFT_DATA_VERDICT
+NFT_DYNSET_F_INV
+NFT_DYNSET_OP_ADD
+NFT_DYNSET_OP_UPDATE
+NFT_GOTO
+NFT_JUMP
+NFT_LIMIT_F_INV
+NFT_LIMIT_PKTS
+NFT_LIMIT_PKT_BYTES
+NFT_LOOKUP_F_INV
+NFT_META_BRI_IIFNAME
+NFT_META_BRI_OIFNAME
+NFT_META_CGROUP
+NFT_META_CPU
+NFT_META_IIF
+NFT_META_IIFGROUP
+NFT_META_IIFNAME
+NFT_META_IIFTYPE
+NFT_META_L4PROTO
+NFT_META_LEN
+NFT_META_MARK
+NFT_META_NFPROTO
+NFT_META_NFTRACE
+NFT_META_OIF
+NFT_META_OIFGROUP
+NFT_META_OIFNAME
+NFT_META_OIFTYPE
+NFT_META_PKTTYPE
+NFT_META_PRANDOM
+NFT_META_PRIORITY
+NFT_META_PROTOCOL
+NFT_META_RTCLASSID
+NFT_META_SECMARK
+NFT_META_SKGID
+NFT_META_SKUID
+NFT_MSG_DELCHAIN
+NFT_MSG_DELOBJ
+NFT_MSG_DELRULE
+NFT_MSG_DELSET
+NFT_MSG_DELSETELEM
+NFT_MSG_DELTABLE
+NFT_MSG_GETCHAIN
+NFT_MSG_GETGEN
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_GETRULE
+NFT_MSG_GETSET
+NFT_MSG_GETSETELEM
+NFT_MSG_GETTABLE
+NFT_MSG_MAX
+NFT_MSG_NEWCHAIN
+NFT_MSG_NEWGEN
+NFT_MSG_NEWOBJ
+NFT_MSG_NEWRULE
+NFT_MSG_NEWSET
+NFT_MSG_NEWSETELEM
+NFT_MSG_NEWTABLE
+NFT_MSG_TRACE
+NFT_NAT_DNAT
+NFT_NAT_SNAT
+NFT_NG_INCREMENTAL
+NFT_NG_RANDOM
+NFT_OBJ_MAXNAMELEN
+NFT_PAYLOAD_CSUM_INET
+NFT_PAYLOAD_CSUM_NONE
+NFT_PAYLOAD_LL_HEADER
+NFT_PAYLOAD_NETWORK_HEADER
+NFT_PAYLOAD_TRANSPORT_HEADER
+NFT_QUEUE_FLAG_BYPASS
+NFT_QUEUE_FLAG_CPU_FANOUT
+NFT_QUEUE_FLAG_MASK
+NFT_QUOTA_F_INV
+NFT_RANGE_EQ
+NFT_RANGE_NEQ
+NFT_REG32_00
+NFT_REG32_01
+NFT_REG32_02
+NFT_REG32_03
+NFT_REG32_04
+NFT_REG32_05
+NFT_REG32_06
+NFT_REG32_07
+NFT_REG32_08
+NFT_REG32_09
+NFT_REG32_10
+NFT_REG32_11
+NFT_REG32_12
+NFT_REG32_13
+NFT_REG32_14
+NFT_REG32_15
+NFT_REG32_SIZE
+NFT_REG_1
+NFT_REG_2
+NFT_REG_3
+NFT_REG_4
+NFT_REG_SIZE
+NFT_REG_VERDICT
+NFT_REJECT_ICMPX_ADMIN_PROHIBITED
+NFT_REJECT_ICMPX_HOST_UNREACH
+NFT_REJECT_ICMPX_NO_ROUTE
+NFT_REJECT_ICMPX_PORT_UNREACH
+NFT_REJECT_ICMPX_UNREACH
+NFT_REJECT_ICMP_UNREACH
+NFT_REJECT_TCP_RST
+NFT_RETURN
+NFT_SET_ANONYMOUS
+NFT_SET_CONSTANT
+NFT_SET_ELEM_INTERVAL_END
+NFT_SET_EVAL
+NFT_SET_INTERVAL
+NFT_SET_MAP
+NFT_SET_MAXNAMELEN
+NFT_SET_POL_MEMORY
+NFT_SET_POL_PERFORMANCE
+NFT_SET_TIMEOUT
+NFT_TABLE_MAXNAMELEN
+NFT_TRACETYPE_POLICY
+NFT_TRACETYPE_RETURN
+NFT_TRACETYPE_RULE
+NFT_TRACETYPE_UNSPEC
+NFT_USERDATA_MAXLEN
+NFULA_CFG_CMD
+NFULA_CFG_FLAGS
+NFULA_CFG_MODE
+NFULA_CFG_NLBUFSIZ
+NFULA_CFG_QTHRESH
+NFULA_CFG_TIMEOUT
+NFULA_CFG_UNSPEC
+NFULA_CT
+NFULA_CT_INFO
+NFULA_GID
+NFULA_HWADDR
+NFULA_HWHEADER
+NFULA_HWLEN
+NFULA_HWTYPE
+NFULA_IFINDEX_INDEV
+NFULA_IFINDEX_OUTDEV
+NFULA_IFINDEX_PHYSINDEV
+NFULA_IFINDEX_PHYSOUTDEV
+NFULA_MARK
+NFULA_PACKET_HDR
+NFULA_PAYLOAD
+NFULA_PREFIX
+NFULA_SEQ
+NFULA_SEQ_GLOBAL
+NFULA_TIMESTAMP
+NFULA_UID
+NFULA_UNSPEC
+NFULNL_CFG_CMD_BIND
+NFULNL_CFG_CMD_NONE
+NFULNL_CFG_CMD_PF_BIND
+NFULNL_CFG_CMD_PF_UNBIND
+NFULNL_CFG_CMD_UNBIND
+NFULNL_CFG_F_CONNTRACK
+NFULNL_CFG_F_SEQ
+NFULNL_CFG_F_SEQ_GLOBAL
+NFULNL_COPY_META
+NFULNL_COPY_NONE
+NFULNL_COPY_PACKET
+NFULNL_MSG_CONFIG
+NFULNL_MSG_PACKET
+NF_ACCEPT
+NF_DROP
+NF_INET_FORWARD
+NF_INET_LOCAL_IN
+NF_INET_LOCAL_OUT
+NF_INET_NUMHOOKS
+NF_INET_POST_ROUTING
+NF_INET_PRE_ROUTING
+NF_IP6_FORWARD
+NF_IP6_LOCAL_IN
+NF_IP6_LOCAL_OUT
+NF_IP6_NUMHOOKS
+NF_IP6_POST_ROUTING
+NF_IP6_PRE_ROUTING
+NF_IP6_PRI_CONNTRACK
+NF_IP6_PRI_CONNTRACK_DEFRAG
+NF_IP6_PRI_CONNTRACK_HELPER
+NF_IP6_PRI_FILTER
+NF_IP6_PRI_FIRST
+NF_IP6_PRI_LAST
+NF_IP6_PRI_MANGLE
+NF_IP6_PRI_NAT_DST
+NF_IP6_PRI_NAT_SRC
+NF_IP6_PRI_RAW
+NF_IP6_PRI_SECURITY
+NF_IP6_PRI_SELINUX_FIRST
+NF_IP6_PRI_SELINUX_LAST
+NF_IP_FORWARD
+NF_IP_LOCAL_IN
+NF_IP_LOCAL_OUT
+NF_IP_NUMHOOKS
+NF_IP_POST_ROUTING
+NF_IP_PRE_ROUTING
+NF_IP_PRI_CONNTRACK
+NF_IP_PRI_CONNTRACK_CONFIRM
+NF_IP_PRI_CONNTRACK_DEFRAG
+NF_IP_PRI_CONNTRACK_HELPER
+NF_IP_PRI_FILTER
+NF_IP_PRI_FIRST
+NF_IP_PRI_LAST
+NF_IP_PRI_MANGLE
+NF_IP_PRI_NAT_DST
+NF_IP_PRI_NAT_SRC
+NF_IP_PRI_RAW
+NF_IP_PRI_SECURITY
+NF_IP_PRI_SELINUX_FIRST
+NF_IP_PRI_SELINUX_LAST
+NF_MAX_VERDICT
+NF_NETDEV_INGRESS
+NF_NETDEV_NUMHOOKS
+NF_QUEUE
+NF_REPEAT
+NF_STOLEN
+NF_STOP
+NF_VERDICT_BITS
+NF_VERDICT_FLAG_QUEUE_BYPASS
+NF_VERDICT_MASK
+NF_VERDICT_QBITS
+NF_VERDICT_QMASK
+NI_DGRAM
+NI_MAXHOST
+NI_MAX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TIPC
+PF_UNIX
+PF_UNSPEC
+PF_VSOCK
+PF_WANPIPE
+PF_X25
+PIPE_BUF
+POLLERR
+POLLHUP
+POLLIN
+POLLNVAL
+POLLOUT
+POLLPRI
+POLLRDBAND
+POLLRDNORM
+POLLWRBAND
+POLLWRNORM
+POSIX_FADV_DONTNEED
+POSIX_FADV_NOREUSE
+POSIX_FADV_NORMAL
+POSIX_FADV_RANDOM
+POSIX_FADV_SEQUENTIAL
+POSIX_FADV_WILLNEED
+PRIO_MAX
+PRIO_MIN
+PRIO_PGRP
+PRIO_PROCESS
+PRIO_USER
+PROC_SUPER_MAGIC
+PROT_EXEC
+PROT_GROWSDOWN
+PROT_GROWSUP
+PROT_NONE
+PROT_READ
+PROT_WRITE
+PTHREAD_COND_INITIALIZER
+PTHREAD_CREATE_DETACHED
+PTHREAD_CREATE_JOINABLE
+PTHREAD_MUTEX_DEFAULT
+PTHREAD_MUTEX_ERRORCHECK
+PTHREAD_MUTEX_INITIALIZER
+PTHREAD_MUTEX_NORMAL
+PTHREAD_MUTEX_RECURSIVE
+PTHREAD_RWLOCK_INITIALIZER
+PTHREAD_STACK_MIN
+PTRACE_ATTACH
+PTRACE_CONT
+PTRACE_DETACH
+PTRACE_EVENT_CLONE
+PTRACE_EVENT_EXEC
+PTRACE_EVENT_EXIT
+PTRACE_EVENT_FORK
+PTRACE_EVENT_SECCOMP
+PTRACE_EVENT_STOP
+PTRACE_EVENT_VFORK
+PTRACE_EVENT_VFORK_DONE
+PTRACE_GETEVENTMSG
+PTRACE_GETSIGINFO
+PTRACE_KILL
+PTRACE_O_EXITKILL
+PTRACE_O_MASK
+PTRACE_O_SUSPEND_SECCOMP
+PTRACE_O_TRACECLONE
+PTRACE_O_TRACEEXEC
+PTRACE_O_TRACEEXIT
+PTRACE_O_TRACEFORK
+PTRACE_O_TRACESECCOMP
+PTRACE_O_TRACESYSGOOD
+PTRACE_O_TRACEVFORK
+PTRACE_O_TRACEVFORKDONE
+PTRACE_PEEKDATA
+PTRACE_PEEKTEXT
+PTRACE_PEEKUSER
+PTRACE_POKEDATA
+PTRACE_POKETEXT
+PTRACE_POKEUSER
+PTRACE_SETOPTIONS
+PTRACE_SETSIGINFO
+PTRACE_SINGLESTEP
+PTRACE_SYSCALL
+PTRACE_TRACEME
+P_ALL
+P_PGID
+P_PID
+P_PIDFD
+QCMD
+QIF_ALL
+QIF_BLIMITS
+QIF_BTIME
+QIF_ILIMITS
+QIF_INODES
+QIF_ITIME
+QIF_LIMITS
+QIF_SPACE
+QIF_TIMES
+QIF_USAGE
+QNX4_SUPER_MAGIC
+Q_GETFMT
+Q_GETINFO
+Q_GETQUOTA
+Q_QUOTAOFF
+Q_QUOTAON
+Q_SETINFO
+Q_SETQUOTA
+Q_SYNC
+RAND_MAX
+READ_IMPLIES_EXEC
+REG_ASSERT
+REG_ATOI
+REG_BACKR
+REG_BADBR
+REG_BADPAT
+REG_BADRPT
+REG_BASIC
+REG_DUMP
+REG_EBRACE
+REG_EBRACK
+REG_ECOLLATE
+REG_ECTYPE
+REG_EESCAPE
+REG_EMPTY
+REG_EPAREN
+REG_ERANGE
+REG_ESPACE
+REG_ESUBREG
+REG_EXTENDED
+REG_ICASE
+REG_INVARG
+REG_ITOA
+REG_LARGE
+REG_NEWLINE
+REG_NOMATCH
+REG_NOSPEC
+REG_NOSUB
+REG_NOTBOL
+REG_NOTEOL
+REG_PEND
+REG_STARTEND
+REG_TRACE
+REISERFS_SUPER_MAGIC
+RENAME_EXCHANGE
+RENAME_NOREPLACE
+RENAME_WHITEOUT
+RLIMIT_AS
+RLIMIT_CORE
+RLIMIT_CPU
+RLIMIT_DATA
+RLIMIT_FSIZE
+RLIMIT_LOCKS
+RLIMIT_MEMLOCK
+RLIMIT_MSGQUEUE
+RLIMIT_NICE
+RLIMIT_NOFILE
+RLIMIT_NPROC
+RLIMIT_RSS
+RLIMIT_RTPRIO
+RLIMIT_SIGPENDING
+RLIMIT_STACK
+RLIM_INFINITY
+RTLD_DEFAULT
+RT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O_PASSSEC
+SO_PEEK_OFF
+SO_PEERCRED
+SO_PEERSEC
+SO_PRIORITY
+SO_PROTOCOL
+SO_RCVBUF
+SO_RCVBUFFORCE
+SO_RCVLOWAT
+SO_RCVTIMEO
+SO_REUSEADDR
+SO_REUSEPORT
+SO_RXQ_OVFL
+SO_SNDBUF
+SO_SNDBUFFORCE
+SO_SNDLOWAT
+SO_SNDTIMEO
+SO_TIMESTAMP
+SO_TYPE
+SPLICE_F_GIFT
+SPLICE_F_MORE
+SPLICE_F_MOVE
+SPLICE_F_NONBLOCK
+SS_DISABLE
+SS_ONSTACK
+STDERR_FILENO
+STDIN_FILENO
+STDOUT_FILENO
+STICKY_TIMEOUTS
+ST_MANDLOCK
+ST_NOATIME
+ST_NODEV
+ST_NODIRATIME
+ST_NOEXEC
+ST_NOSUID
+ST_RDONLY
+ST_RELATIME
+ST_SYNCHRONOUS
+SYS_accept4
+SYS_acct
+SYS_add_key
+SYS_adjtimex
+SYS_bind
+SYS_bpf
+SYS_brk
+SYS_capget
+SYS_capset
+SYS_chdir
+SYS_chroot
+SYS_clock_adjtime
+SYS_clock_getres
+SYS_clock_gettime
+SYS_clock_nanosleep
+SYS_clock_settime
+SYS_clone
+SYS_close
+SYS_connect
+SYS_copy_file_range
+SYS_delete_module
+SYS_dup
+SYS_dup3
+SYS_epoll_create1
+SYS_epoll_ctl
+SYS_epoll_pwait
+SYS_eventfd2
+SYS_execve
+SYS_execveat
+SYS_exit
+SYS_exit_group
+SYS_faccessat
+SYS_fallocate
+SYS_fanotify_init
+SYS_fanotify_mark
+SYS_fchdir
+SYS_fchmod
+SYS_fchmodat
+SYS_fchown
+SYS_fchownat
+SYS_fdatasync
+SYS_fgetxattr
+SYS_finit_module
+SYS_flistxattr
+SYS_flock
+SYS_fremovexattr
+SYS_fsetxattr
+SYS_fsync
+SYS_futex
+SYS_get_mempolicy
+SYS_get_robust_list
+SYS_getcpu
+SYS_getcwd
+SYS_getdents64
+SYS_getegid
+SYS_geteuid
+SYS_getgid
+SYS_getgroups
+SYS_getitimer
+SYS_getpeername
+SYS_getpgid
+SYS_getpid
+SYS_getppid
+SYS_getpriority
+SYS_getrandom
+SYS_getresgid
+SYS_getresuid
+SYS_getrusage
+SYS_getsid
+SYS_getsockname
+SYS_getsockopt
+SYS_gettid
+SYS_gettimeofday
+SYS_getuid
+SYS_getxattr
+SYS_init_module
+SYS_inotify_add_watch
+SYS_inotify_init1
+SYS_inotify_rm_watch
+SYS_io_cancel
+SYS_io_destroy
+SYS_io_getevents
+SYS_io_setup
+SYS_io_submit
+SYS_ioctl
+SYS_ioprio_get
+SYS_ioprio_set
+SYS_kcmp
+SYS_kexec_load
+SYS_keyctl
+SYS_kill
+SYS_lgetxattr
+SYS_linkat
+SYS_listen
+SYS_listxattr
+SYS_llistxattr
+SYS_lookup_dcookie
+SYS_lremovexattr
+SYS_lsetxattr
+SYS_madvise
+SYS_mbind
+SYS_membarrier
+SYS_memfd_create
+SYS_mincore
+SYS_mkdirat
+SYS_mknodat
+SYS_mlock
+SYS_mlock2
+SYS_mlockall
+SYS_mount
+SYS_move_pages
+SYS_mprotect
+SYS_mq_getsetattr
+SYS_mq_notify
+SYS_mq_open
+SYS_mq_timedreceive
+SYS_mq_timedsend
+SYS_mq_unlink
+SYS_mremap
+SYS_msync
+SYS_munlock
+SYS_munlockall
+SYS_munmap
+SYS_name_to_handle_at
+SYS_nanosleep
+SYS_nfsservctl
+SYS_open_by_handle_at
+SYS_openat
+SYS_perf_event_open
+SYS_personality
+SYS_pipe2
+SYS_pivot_root
+SYS_pkey_alloc
+SYS_pkey_free
+SYS_pkey_mprotect
+SYS_ppoll
+SYS_prctl
+SYS_pread64
+SYS_preadv
+SYS_preadv2
+SYS_prlimit64
+SYS_process_vm_readv
+SYS_process_vm_writev
+SYS_pselect6
+SYS_ptrace
+SYS_pwrite64
+SYS_pwritev
+SYS_pwritev2
+SYS_quotactl
+SYS_read
+SYS_readahead
+SYS_readlinkat
+SYS_readv
+SYS_reboot
+SYS_recvfrom
+SYS_recvmmsg
+SYS_recvmsg
+SYS_remap_file_pages
+SYS_removexattr
+SYS_renameat
+SYS_renameat2
+SYS_request_key
+SYS_restart_syscall
+SYS_rt_sigaction
+SYS_rt_sigpending
+SYS_rt_sigprocmask
+SYS_rt_sigqueueinfo
+SYS_rt_sigreturn
+SYS_rt_sigsuspend
+SYS_rt_sigtimedwait
+SYS_rt_tgsigqueueinfo
+SYS_sched_get_priority_max
+SYS_sched_get_priority_min
+SYS_sched_getaffinity
+SYS_sched_getattr
+SYS_sched_getparam
+SYS_sched_getscheduler
+SYS_sched_rr_get_interval
+SYS_sched_setaffinity
+SYS_sched_setattr
+SYS_sched_setparam
+SYS_sched_setscheduler
+SYS_sched_yield
+SYS_seccomp
+SYS_sendmmsg
+SYS_sendmsg
+SYS_sendto
+SYS_set_mempolicy
+SYS_set_robust_list
+SYS_set_tid_address
+SYS_setdomainname
+SYS_setfsgid
+SYS_setfsuid
+SYS_setgid
+SYS_setgroups
+SYS_sethostname
+SYS_setitimer
+SYS_setns
+SYS_setpgid
+SYS_setpriority
+SYS_setregid
+SYS_setresgid
+SYS_setresuid
+SYS_setreuid
+SYS_setrlimit
+SYS_setsid
+SYS_setsockopt
+SYS_settimeofday
+SYS_setuid
+SYS_setxattr
+SYS_shutdown
+SYS_sigaltstack
+SYS_signalfd4
+SYS_socket
+SYS_socketpair
+SYS_splice
+SYS_swapoff
+SYS_swapon
+SYS_symlinkat
+SYS_sync
+SYS_syncfs
+SYS_sysinfo
+SYS_syslog
+SYS_tee
+SYS_tgkill
+SYS_timer_create
+SYS_timer_delete
+SYS_timer_getoverrun
+SYS_timer_gettime
+SYS_timer_settime
+SYS_timerfd_create
+SYS_timerfd_gettime
+SYS_timerfd_settime
+SYS_times
+SYS_tkill
+SYS_umask
+SYS_umount2
+SYS_uname
+SYS_unlinkat
+SYS_unshare
+SYS_userfaultfd
+SYS_utimensat
+SYS_vhangup
+SYS_vmsplice
+SYS_wait4
+SYS_waitid
+S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GIC
+TMP_MAX
+TOSTOP
+UIO_MAXIOV
+USBDEVICE_SUPER_MAGIC
+USER_PROCESS
+USRQUOTA
+UTIME_NOW
+UTIME_OMIT
+UT_HOSTSIZE
+UT_LINESIZE
+UT_NAMESIZE
+VDISCARD
+VEOF
+VEOL
+VEOL2
+VERASE
+VINTR
+VKILL
+VLNEXT
+VMADDR_CID_ANY
+VMADDR_CID_HOST
+VMADDR_CID_HYPERVISOR
+VMADDR_CID_LOCAL
+VMADDR_PORT_ANY
+VMIN
+VQUIT
+VREPRINT
+VSTART
+VSTOP
+VSUSP
+VSWTC
+VT0
+VT1
+VTDLY
+VTIME
+VWERASE
+WCONTINUED
+WCOREDUMP
+WEXITED
+WEXITSTATUS
+WHOLE_SECONDS
+WIFCONTINUED
+WIFEXITED
+WIFSIGNALED
+WIFSTOPPED
+WNOHANG
+WNOWAIT
+WSTOPPED
+WSTOPSIG
+WTERMSIG
+WUNTRACED
+W_EXITCODE
+W_OK
+W_STOPCODE
+XTABS
+X_OK
+_IOFBF
+_IOLBF
+_IONBF
+_PC_2_SYMLINKS
+_PC_ALLOC_SIZE_MIN
+_PC_ASYNC_IO
+_PC_CHOWN_RESTRICTED
+_PC_LINK_MAX
+_PC_MAX_CANON
+_PC_MAX_INPUT
+_PC_NAME_MAX
+_PC_NO_TRUNC
+_PC_PATH_MAX
+_PC_PIPE_BUF
+_PC_PRIO_IO
+_PC_REC_INCR_XFER_SIZE
+_PC_REC_MAX_XFER_SIZE
+_PC_REC_MIN_XFER_SIZE
+_PC_REC_XFER_ALIGN
+_PC_SYMLINK_MAX
+_PC_SYNC_IO
+_PC_VDISABLE
+_SC_2_CHAR_TERM
+_SC_2_C_BIND
+_SC_2_C_DEV
+_SC_2_C_VERSION
+_SC_2_FORT_DEV
+_SC_2_FORT_RUN
+_SC_2_LOCALEDEF
+_SC_2_PBS
+_SC_2_PBS_ACCOUNTING
+_SC_2_PBS_CHECKPOINT
+_SC_2_PBS_LOCATE
+_SC_2_PBS_M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UEUE_MAX
+_SC_SPAWN
+_SC_SPIN_LOCKS
+_SC_SPORADIC_SERVER
+_SC_SS_REPL_MAX
+_SC_STREAM_MAX
+_SC_SYMLOOP_MAX
+_SC_SYNCHRONIZED_IO
+_SC_THREADS
+_SC_THREAD_ATTR_STACKADDR
+_SC_THREAD_ATTR_STACKSIZE
+_SC_THREAD_CPUTIME
+_SC_THREAD_DESTRUCTOR_ITERATIONS
+_SC_THREAD_KEYS_MAX
+_SC_THREAD_PRIORITY_SCHEDULING
+_SC_THREAD_PRIO_INHERIT
+_SC_THREAD_PRIO_PROTECT
+_SC_THREAD_PROCESS_SHARED
+_SC_THREAD_ROBUST_PRIO_INHERIT
+_SC_THREAD_ROBUST_PRIO_PROTECT
+_SC_THREAD_SAFE_FUNCTIONS
+_SC_THREAD_SPORADIC_SERVER
+_SC_THREAD_STACK_MIN
+_SC_THREAD_THREADS_MAX
+_SC_TIMEOUTS
+_SC_TIMERS
+_SC_TIMER_MAX
+_SC_TRACE
+_SC_TRACE_EVENT_FILTER
+_SC_TRACE_EVENT_NAME_MAX
+_SC_TRACE_INHERIT
+_SC_TRACE_LOG
+_SC_TRACE_NAME_MAX
+_SC_TRACE_SYS_MAX
+_SC_TRACE_USER_EVENT_MAX
+_SC_TTY_NAME_MAX
+_SC_TYPED_MEMORY_OBJECTS
+_SC_TZNAME_MAX
+_SC_V7_ILP32_OFF32
+_SC_V7_ILP32_OFFBIG
+_SC_V7_LP64_OFF64
+_SC_V7_LPBIG_OFFBIG
+_SC_VERSION
+_SC_XBS5_ILP32_OFF32
+_SC_XBS5_ILP32_OFFBIG
+_SC_XBS5_LP64_OFF64
+_SC_XBS5_LPBIG_OFFBIG
+_SC_XOPEN_CRYPT
+_SC_XOPEN_ENH_I18N
+_SC_XOPEN_LEGACY
+_SC_XOPEN_REALTIME
+_SC_XOPEN_REALTIME_THREADS
+_SC_XOPEN_SHM
+_SC_XOPEN_STREAMS
+_SC_XOPEN_UNIX
+_SC_XOPEN_UUCP
+_SC_XOPEN_VERSION
+_SC_XOPEN_XCU_VERSION
+__CPU_BITS
+__CPU_BITTYPE
+__NFT_REG_MAX
+__WALL
+__WCLONE
+__WNOTHREAD
+__errno
+__fsid_t
+__kernel_loff_t
+__kernel_pid_t
+__sched_cpualloc
+__sched_cpucount
+__sched_cpufree
+_exit
+abort
+accept
+accept4
+access
+acct
+addrinfo
+af_alg_iv
+alarm
+android_set_abort_message
+arphdr
+arpreq
+arpreq_old
+atexit
+atoi
+bind
+blkcnt_t
+blksize_t
+brk
+bsearch
+c_char
+c_double
+c_float
+c_int
+c_long
+c_longlong
+c_schar
+c_short
+c_uchar
+c_uint
+c_ulong
+c_ulonglong
+c_ushort
+c_void
+calloc
+cc_t
+cfgetispeed
+cfgetospeed
+cfmakeraw
+cfsetispeed
+cfsetospeed
+cfsetspeed
+chdir
+chmod
+chown
+chroot
+clearenv
+clearerr
+clock_getcpuclockid
+clock_getres
+clock_gettime
+clock_nanosleep
+clock_settime
+clock_t
+clockid_t
+clone
+close
+closedir
+closelog
+cmsghdr
+connect
+cpu_set_t
+creat
+creat64
+daemon
+dev_t
+difftime
+dirent
+dirent64
+dirfd
+dladdr
+dlclose
+dlerror
+dlopen
+dlsym
+dup
+dup2
+duplocale
+endservent
+epoll_create
+epoll_create1
+epoll_ctl
+epoll_event
+epoll_wait
+eventfd
+execl
+execle
+execlp
+execv
+execve
+execvp
+execvpe
+exit
+exit_status
+faccessat
+fallocate
+fallocate64
+fchdir
+fchmod
+fchmodat
+fchown
+fchownat
+fclose
+fcntl
+fd_set
+fdatasync
+fdopen
+fdopendir
+feof
+ferror
+fexecve
+fflush
+fgetc
+fgetpos
+fgets
+fgetxattr
+fileno
+flistxattr
+flock
+flock64
+fmemopen
+fopen
+fork
+forkpty
+fpathconf
+fpos_t
+fprintf
+fputc
+fputs
+fread
+free
+freeaddrinfo
+freeifaddrs
+freelocale
+fremovexattr
+freopen
+fsblkcnt_t
+fscanf
+fseek
+fseeko
+fsetpos
+fsetxattr
+fsfilcnt_t
+fstat
+fstat64
+fstatat
+fstatat64
+fstatfs
+fstatfs64
+fstatvfs
+fstatvfs64
+fsync
+ftell
+ftello
+ftruncate
+ftruncate64
+futimens
+fwrite
+gai_strerror
+genlmsghdr
+getaddrinfo
+getchar
+getchar_unlocked
+getcwd
+getegid
+getenv
+geteuid
+getgid
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+getgroups
+gethostname
+getifaddrs
+getline
+getlogin
+getnameinfo
+getopt
+getpeername
+getpgid
+getpgrp
+getpid
+getppid
+getpriority
+getprotobyname
+getprotobynumber
+getpwnam
+getpwnam_r
+getpwuid
+getpwuid_r
+getresgid
+getresuid
+getrlimit
+getrlimit64
+getrusage
+getservbyname
+getservbyport
+getservent
+getsid
+getsockname
+getsockopt
+gettid
+gettimeofday
+getuid
+getutent
+getxattr
+gid_t
+gmtime
+gmtime_r
+grantpt
+group
+hostent
+id_t
+idtype_t
+if_indextoname
+if_nametoindex
+ifaddrs
+in6_addr
+in6_pktinfo
+in6_rtmsg
+in_addr
+in_addr_t
+in_pktinfo
+in_port_t
+initgroups
+ino64_t
+ino_t
+inotify_add_watch
+inotify_event
+inotify_init
+inotify_init1
+inotify_rm_watch
+int16_t
+int32_t
+int64_t
+int8_t
+intmax_t
+intptr_t
+ioctl
+iovec
+ip_mreq
+ip_mreq_source
+ipv6_mreq
+isalnum
+isalpha
+isatty
+isblank
+iscntrl
+isdigit
+isgraph
+islower
+isprint
+ispunct
+isspace
+isupper
+isxdigit
+itimerspec
+itimerval
+key_t
+kill
+killpg
+lastlog
+lchown
+lconv
+lgetxattr
+linger
+link
+linkat
+listen
+listxattr
+llistxattr
+locale_t
+localeconv
+localtime
+localtime_r
+lockf
+loff_t
+login_tty
+lremovexattr
+lseek
+lseek64
+lsetxattr
+lstat
+lstat64
+madvise
+major
+makedev
+malloc
+mcontext_t
+memalign
+memchr
+memcmp
+memcpy
+memmove
+memrchr
+memset
+mincore
+minor
+mkdir
+mkdirat
+mkdtemp
+mkfifo
+mknod
+mknodat
+mkstemp
+mktime
+mlock
+mlockall
+mmap
+mmap64
+mmsghdr
+mode_t
+mount
+mprotect
+msghdr
+msync
+munlock
+munlockall
+munmap
+nanosleep
+newlocale
+nfds_t
+nice
+nl_mmap_hdr
+nl_mmap_req
+nl_pktinfo
+nlattr
+nlink_t
+nlmsgerr
+nlmsghdr
+off64_t
+off_t
+open
+open64
+open_memstream
+open_wmemstream
+openat
+openat64
+opendir
+openlog
+openpty
+passwd
+pathconf
+pause
+pclose
+perror
+personality
+pid_t
+pipe
+pipe2
+poll
+pollfd
+popen
+posix_fadvise
+posix_fadvise64
+posix_fallocate
+posix_fallocate64
+posix_memalign
+posix_openpt
+ppoll
+prctl
+pread
+pread64
+preadv
+preadv64
+printf
+prlimit
+prlimit64
+process_vm_readv
+process_vm_writev
+protoent
+pselect
+pthread_atfork
+pthread_attr_destroy
+pthread_attr_getguardsize
+pthread_attr_getstack
+pthread_attr_init
+pthread_attr_setdetachstate
+pthread_attr_setstacksize
+pthread_attr_t
+pthread_cond_broadcast
+pthread_cond_destroy
+pthread_cond_init
+pthread_cond_signal
+pthread_cond_t
+pthread_cond_timedwait
+pthread_cond_wait
+pthread_condattr_destroy
+pthread_condattr_getclock
+pthread_condattr_getpshared
+pthread_condattr_init
+pthread_condattr_setclock
+pthread_condattr_setpshared
+pthread_condattr_t
+pthread_create
+pthread_detach
+pthread_exit
+pthread_getattr_np
+pthread_getschedparam
+pthread_getspecific
+pthread_join
+pthread_key_create
+pthread_key_delete
+pthread_key_t
+pthread_kill
+pthread_mutex_destroy
+pthread_mutex_init
+pthread_mutex_lock
+pthread_mutex_t
+pthread_mutex_timedlock
+pthread_mutex_trylock
+pthread_mutex_unlock
+pthread_mutexattr_destroy
+pthread_mutexattr_getpshared
+pthread_mutexattr_init
+pthread_mutexattr_setpshared
+pthread_mutexattr_settype
+pthread_mutexattr_t
+pthread_rwlock_destroy
+pthread_rwlock_init
+pthread_rwlock_rdlock
+pthread_rwlock_t
+pthread_rwlock_tryrdlock
+pthread_rwlock_trywrlock
+pthread_rwlock_unlock
+pthread_rwlock_wrlock
+pthread_rwlockattr_destroy
+pthread_rwlockattr_getpshared
+pthread_rwlockattr_init
+pthread_rwlockattr_setpshared
+pthread_rwlockattr_t
+pthread_self
+pthread_setschedparam
+pthread_setspecific
+pthread_sigmask
+pthread_t
+ptrace
+ptrdiff_t
+ptsname
+ptsname_r
+
+putchar
+putchar_unlocked
+putenv
+puts
+pwrite
+pwrite64
+pwritev
+pwritev64
+qsort
+raise
+read
+readdir
+readdir64
+readdir64_r
+readdir_r
+readlink
+readlinkat
+readv
+realloc
+realpath
+recv
+recvfrom
+recvmmsg
+recvmsg
+regcomp
+regerror
+regex_t
+regexec
+regfree
+regmatch_t
+remove
+removexattr
+rename
+renameat
+res_init
+rewind
+rewinddir
+rlim_t
+rlimit
+rlimit64
+rmdir
+rusage
+sa_family_t
+sbrk
+scanf
+sched_get_priority_max
+sched_get_priority_min
+sched_getaffinity
+sched_getcpu
+sched_getparam
+sched_getscheduler
+sched_param
+sched_rr_get_interval
+sched_setaffinity
+sched_setparam
+sched_setscheduler
+sched_yield
+seekdir
+select
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_post
+sem_t
+sem_timedwait
+sem_trywait
+sem_unlink
+sem_wait
+send
+sendfile
+sendmmsg
+sendmsg
+sendto
+servent
+setbuf
+setegid
+setenv
+seteuid
+setfsgid
+setfsuid
+setgid
+setgroups
+sethostname
+setlocale
+setlogmask
+setns
+setpgid
+setpriority
+setregid
+setresgid
+setresuid
+setreuid
+setrlimit
+setrlimit64
+setservent
+setsid
+setsockopt
+settimeofday
+setuid
+setutent
+setvbuf
+setxattr
+shutdown
+sigaction
+sigaddset
+sigaltstack
+sigdelset
+sigemptyset
+sigevent
+sigfillset
+sighandler_t
+siginfo_t
+sigismember
+signal
+signalfd
+signalfd_siginfo
+sigpending
+sigprocmask
+sigset64_t
+sigset_t
+sigsuspend
+sigtimedwait
+sigval
+sigwait
+size_t
+sleep
+snprintf
+sock_extended_err
+sockaddr
+sockaddr_alg
+sockaddr_in
+sockaddr_in6
+sockaddr_ll
+sockaddr_nl
+sockaddr_storage
+sockaddr_un
+sockaddr_vm
+socket
+socketpair
+socklen_t
+speed_t
+splice
+sprintf
+sscanf
+ssize_t
+stack_t
+stat
+stat64
+statfs
+statfs64
+statvfs
+statvfs64
+strcasecmp
+strcasestr
+strcat
+strchr
+strcmp
+strcoll
+strcpy
+strcspn
+strdup
+strerror
+strerror_r
+strlen
+strncasecmp
+strncat
+strncmp
+strncpy
+strndup
+strnlen
+strpbrk
+strrchr
+strsignal
+strspn
+strstr
+strtod
+strtok
+strtol
+strtoul
+strxfrm
+suseconds_t
+swapoff
+swapon
+symlink
+symlinkat
+syscall
+sysconf
+sysinfo
+syslog
+system
+tcdrain
+tcflag_t
+tcflow
+tcflush
+tcgetattr
+tcgetpgrp
+tcgetsid
+tcsendbreak
+tcsetattr
+tcsetpgrp
+tee
+telldir
+termios
+termios2
+time
+time_t
+timegm
+timerfd_create
+timerfd_gettime
+timerfd_settime
+times
+timespec
+timeval
+timezone
+tm
+tmpfile
+tmpnam
+tms
+tolower
+toupper
+truncate
+truncate64
+ttyname
+ttyname_r
+ucontext_t
+ucred
+uid_t
+uint16_t
+uint32_t
+uint64_t
+uint8_t
+uintmax_t
+uintptr_t
+umask
+umount
+umount2
+uname
+ungetc
+unlink
+unlinkat
+unlockpt
+unsetenv
+unshare
+useconds_t
+uselocale
+usleep
+utimbuf
+utime
+utimensat
+utimes
+utmp
+utmpname
+utsname
+vfork
+vmsplice
+wait
+wait4
+waitid
+waitpid
+wchar_t
+wcslen
+wcstombs
+winsize
+wmemchr
+write
+writev
diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt
new file mode 100644
index 0000000000000..d8a3a7dddcd5c
--- /dev/null
+++ b/libc-test/semver/apple.txt
@@ -0,0 +1,1771 @@
+ABDAY_1
+ABDAY_2
+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AI_FAMILY
+EAI_MEMORY
+EAI_NODATA
+EAI_NONAME
+EAI_OVERFLOW
+EAI_SERVICE
+EAI_SOCKTYPE
+EAUTH
+EBADARCH
+EBADEXEC
+EBADMACHO
+EBADRPC
+ECHOCTL
+ECHOKE
+ECHOPRT
+EDEVERR
+EFTYPE
+ELAST
+EMPTY
+ENEEDAUTH
+ENOATTR
+ENODATA
+ENOPOLICY
+ENOSR
+ENOSTR
+ENOTRECOVERABLE
+ENOTSUP
+EOF
+EOWNERDEAD
+EPROCLIM
+EPROCUNAVAIL
+EPROGMISMATCH
+EPROGUNAVAIL
+EPWROFF
+EQFULL
+ERA
+ERA_D_FMT
+ERA_D_T_FMT
+ERA_T_FMT
+ERPCMISMATCH
+ESHLIBVERS
+ETIME
+EVFILT_AIO
+EVFILT_FS
+EVFILT_MACHPORT
+EVFILT_PROC
+EVFILT_READ
+EVFILT_SIGNAL
+EVFILT_TIMER
+EVFILT_USER
+EVFILT_VM
+EVFILT_VNODE
+EVFILT_WRITE
+EV_ADD
+EV_CLEAR
+EV_DELETE
+EV_DISABLE
+EV_DISPATCH
+EV_ENABLE
+EV_EOF
+EV_ERROR
+EV_FLAG0
+EV_FLAG1
+EV_ONESHOT
+EV_OOBAND
+EV_POLL
+EV_RECEIPT
+EV_SYSFLAGS
+EXTA
+EXTB
+EXTPROC
+FF0
+FF1
+FFDLY
+FILENAME_MAX
+FIOASYNC
+FIODTYPE
+FIOGETOWN
+FIONCLEX
+FIONREAD
+FIOSETOWN
+FLUSHO
+FOPEN_MAX
+F_ALLOCATEALL
+F_ALLOCATECONTIG
+F_FREEZE_FS
+F_FULLFSYNC
+F_GETOWN
+F_GETPATH
+F_GLOBAL_NOCACHE
+F_LOCK
+F_NOCACHE
+F_NODIRECT
+F_PEOFPOSMODE
+F_PREALLOCATE
+F_RDADVISE
+F_RDAHEAD
+F_RDLCK
+F_SETOWN
+F_TEST
+F_THAW_FS
+F_TLOCK
+F_ULOCK
+F_UNLCK
+F_VOLPOSMODE
+F_WRLCK
+GETALL
+GETNCNT
+GETPID
+GETVAL
+GETZCNT
+GLOB_ABORTED
+GLOB_APPEND
+GLOB_DOOFFS
+GLOB_ERR
+GLOB_MARK
+GLOB_NOCHECK
+GLOB_NOESCAPE
+GLOB_NOMATCH
+GLOB_NOSORT
+GLOB_NOSPACE
+HW_AVAILCPU
+HW_BUS_FREQ
+HW_BYTEORDER
+HW_CACHELINE
+HW_CPU_FREQ
+HW_DISKNAMES
+HW_DISKSTATS
+HW_EPOCH
+HW_FLOATINGPT
+HW_L1DCACHESIZE
+HW_L1ICACHESIZE
+HW_L2CACHESIZE
+HW_L2SETTINGS
+HW_L3CACHESIZE
+HW_L3SETTINGS
+HW_MACHINE
+HW_MACHINE_ARCH
+HW_MAXID
+HW_MEMSIZE
+HW_MODEL
+HW_NCPU
+HW_PAGESIZE
+HW_PHYSMEM
+HW_PRODUCT
+HW_TARGET
+HW_TB_FREQ
+HW_USERMEM
+HW_VECTORUNIT
+IFF_ALLMULTI
+IFF_ALTPHYS
+IFF_BROADCAST
+IFF_DEBUG
+IFF_LINK0
+IFF_LINK1
+IFF_LINK2
+IFF_LOOPBACK
+IFF_MULTICAST
+IFF_NOARP
+IFF_NOTRAILERS
+IFF_OACTIVE
+IFF_POINTOPOINT
+IFF_PROMISC
+IFF_RUNNING
+IFF_SIMPLEX
+IFF_UP
+INIT_PROCESS
+IOV_MAX
+IPC_CREAT
+IPC_EXCL
+IPC_M
+IPC_NOWAIT
+IPC_PRIVATE
+IPC_R
+IPC_RMID
+IPC_SET
+IPC_STAT
+IPC_W
+IPPROTO_3PC
+IPPROTO_ADFS
+IPPROTO_AH
+IPPROTO_AHIP
+IPPROTO_APES
+IPPROTO_ARGUS
+IPPROTO_AX25
+IPPROTO_BHA
+IPPROTO_BLT
+IPPROTO_BRSATMON
+IPPROTO_CFTP
+IPPROTO_CHAOS
+IPPROTO_CMTP
+IPPROTO_CPHB
+IPPROTO_CPNX
+IPPROTO_DDP
+IPPROTO_D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BEXPAK
+IPPROTO_WBMON
+IPPROTO_WSN
+IPPROTO_XNET
+IPPROTO_XTP
+IPTOS_ECN_CE
+IPTOS_ECN_ECT0
+IPTOS_ECN_ECT1
+IPTOS_ECN_MASK
+IPTOS_ECN_NOTECT
+IPV6_CHECKSUM
+IPV6_HOPLIMIT
+IPV6_JOIN_GROUP
+IPV6_LEAVE_GROUP
+IPV6_PKTINFO
+IPV6_RECVPKTINFO
+IPV6_RECVTCLASS
+IPV6_TCLASS
+IP_HDRINCL
+IP_PKTINFO
+IP_RECVDSTADDR
+IP_RECVIF
+IP_RECVTOS
+IP_TOS
+ITIMER_PROF
+ITIMER_REAL
+ITIMER_VIRTUAL
+IUTF8
+KERN_AFFINITY
+KERN_AIOMAX
+KERN_AIOPROCMAX
+KERN_AIOTHREADS
+KERN_ARGMAX
+KERN_BOOTFILE
+KERN_BOOTTIME
+KERN_CHECKOPENEVT
+KERN_CLASSIC
+KERN_CLASSICHANDLER
+KERN_CLOCKRATE
+KERN_COREDUMP
+KERN_COREFILE
+KERN_DOMAINNAME
+KERN_DUMMY
+KERN_DUMPDEV
+KERN_EXEC
+KERN_FILE
+KERN_HOSTID
+KERN_HOSTNAME
+KERN_IPC
+KERN_JOB_CONTROL
+KERN_KDBUFWAIT
+KERN_KDCPUMAP
+KERN_KDDFLAGS
+KERN_KDEBUG
+KERN_KDEFLAGS
+KERN_KDENABLE
+KERN_KDGETBUF
+KERN_KDGETENTROPY
+KERN_KDGETREG
+KERN_KDPIDEX
+KERN_KDPIDTR
+KERN_KDREADCURTHRMAP
+KERN_KDREADTR
+KERN_KDREMOVE
+KERN_KDSETBUF
+KERN_KDSETREG
+KERN_KDSETRTCDEC
+KERN_KDSETUP
+KERN_KDSET_TYPEFILTER
+KERN_KDTHRMAP
+KERN_KDWRITEMAP
+KERN_KDWRITETR
+KERN_LOGSIGEXIT
+KERN_LOW_PRI_DELAY
+KERN_LOW_PRI_WINDOW
+KERN_MAXFILES
+KERN_MAXFILESPERPROC
+KERN_MAXID
+KERN_MAXPARTITIONS
+KERN_MAXPROC
+KERN_MAXPROCPERUID
+KERN_MAXVNODES
+KERN_NETBOOT
+KERN_NGROUPS
+KERN_NISDOMAINNAME
+KERN_NTP_PLL
+KERN_NX_PROTECTION
+KERN_OPENEVT_PROC
+KERN_OSRELDATE
+KERN_OSRELEASE
+KERN_OSREV
+KERN_OSTYPE
+KERN_OSVERSION
+KERN_POSIX
+KERN_POSIX1
+KERN_PROC
+KERN_PROCARGS
+KERN_PROCARGS2
+KERN_PROCDELAYTERM
+KERN_PROCNAME
+KERN_PROC_ALL
+KERN_PROC_LCID
+KERN_PROC_PGRP
+KERN_PROC_PID
+KERN_PROC_RUID
+KERN_PROC_SESSION
+KERN_PROC_TTY
+KERN_PROC_UID
+KERN_PROF
+KERN_PS_STRINGS
+KERN_RAGEVNODE
+KERN_RAGE_PROC
+KERN_RAGE_THREAD
+KERN_SAFEBOOT
+KERN_SAVED_IDS
+KERN_SECURELVL
+KERN_SHREG_PRIVATIZABLE
+KERN_SPECULATIVE_READS
+KERN_SUGID_COREDUMP
+KERN_SYMFILE
+KERN_SYSV
+KERN_TFP
+KERN_TFP_POLICY
+KERN_TFP_POLICY_DEFAULT
+KERN_TFP_POLICY_DENY
+KERN_THALTSTACK
+KERN_THREADNAME
+KERN_TRANSLATE
+KERN_TTY
+KERN_UNOPENEVT_PROC
+KERN_UNRAGE_PROC
+KERN_UNRAGE_THREAD
+KERN_UPDATEINTERVAL
+KERN_USRSTACK32
+KERN_USRSTACK64
+KERN_VERSION
+KERN_VNODE
+KIPC_MAXSOCKBUF
+KIPC_MAX_DATALEN
+KIPC_MAX_HDR
+KIPC_MAX_LINKHDR
+KIPC_MAX_PROTOHDR
+KIPC_MBSTAT
+KIPC_NMBCLUSTERS
+KIPC_SOCKBUF_WASTE
+KIPC_SOMAXCONN
+KIPC_SOQLIMITCOMPAT
+LC_ALL
+LC_ALL_MASK
+LC_COLLATE
+LC_COLLATE_MASK
+LC_CTYPE
+LC_CTYPE_MASK
+LC_MESSAGES
+LC_MESSAGES_MASK
+LC_MONETARY
+LC_MONETARY_MASK
+LC_NUMERIC
+LC_NUMERIC_MASK
+LC_SEGMENT
+LC_SEGMENT_64
+LC_TIME
+LC_TIME_MASK
+LIO_NOP
+LIO_NOWAIT
+LIO_READ
+LIO_WAIT
+LIO_WRITE
+LOCAL_PEERCRED
+LOCAL_PEEREPID
+LOCAL_PEEREUUID
+LOCAL_PEERPID
+LOCAL_PEERUUID
+LOGIN_PROCESS
+LOG_AUTHPRIV
+LOG_CRON
+LOG_FTP
+LOG_INSTALL
+LOG_LAUNCHD
+LOG_NETINFO
+LOG_NFACILITIES
+LOG_PERROR
+LOG_RAS
+LOG_REMOTEAUTH
+L_tmpnam
+MADV_CAN_REUSE
+MADV_DONTNEED
+MADV_FREE
+MADV_FREE_REUSABLE
+MADV_FREE_REUSE
+MADV_NORMAL
+MADV_RANDOM
+MADV_SEQUENTIAL
+MADV_WILLNEED
+MADV_ZERO_WIRED_PAGES
+MAP_COPY
+MAP_FILE
+MAP_HASSEMAPHORE
+MAP_JIT
+MAP_NOCACHE
+MAP_NOEXTEND
+MAP_NORESERVE
+MAP_RENAME
+MAXCOMLEN
+MAXFREQ
+MAXPHASE
+MAXSEC
+MAXTC
+MAXTHREADNAMESIZE
+MCL_CURRENT
+MCL_FUTURE
+MDMBUF
+MH_MAGIC
+MH_MAGIC_64
+MINCORE_INCORE
+MINCORE_MODIFIED
+MINCORE_MODIFIED_OTHER
+MINCORE_REFERENCED
+MINCORE_REFERENCED_OTHER
+MINSEC
+MINSIGSTKSZ
+MNT_ASYNC
+MNT_AUTOMOUNTED
+MNT_CPROTECT
+MNT_DEFWRITE
+MNT_DONTBROWSE
+MNT_DOVOLFS
+MNT_EXPORTED
+MNT_FORCE
+MNT_IGNORE_OWNERSHIP
+MNT_JOURNALED
+MNT_LOCAL
+MNT_MULTILABEL
+MNT_NOATIME
+MNT_NOBLOCK
+MNT_NODEV
+MNT_NOEXE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S
+NOTE_PCTRLMASK
+NOTE_PDATAMASK
+NOTE_RENAME
+NOTE_REVOKE
+NOTE_SECONDS
+NOTE_SIGNAL
+NOTE_TRACK
+NOTE_TRACKERR
+NOTE_TRIGGER
+NOTE_USECONDS
+NOTE_VM_ERROR
+NOTE_VM_PRESSURE
+NOTE_VM_PRESSURE_SUDDEN_TERMINATE
+NOTE_VM_PRESSURE_TERMINATE
+NOTE_WRITE
+NTP_API
+OFDEL
+OFILL
+OLD_TIME
+ONOEOT
+OXTABS
+O_DSYNC
+O_EXLOCK
+O_FSYNC
+O_NDELAY
+O_NOCTTY
+O_SHLOCK
+O_SYMLINK
+O_SYNC
+PENDIN
+PF_APPLETALK
+PF_CCITT
+PF_CHAOS
+PF_CNT
+PF_COIP
+PF_DATAKIT
+PF_DECnet
+PF_DLI
+PF_ECMA
+PF_HYLINK
+PF_IMPLINK
+PF_IPX
+PF_ISDN
+PF_ISO
+PF_KEY
+PF_LAT
+PF_LINK
+PF_LOCAL
+PF_NATM
+PF_NETBIOS
+PF_NS
+PF_OSI
+PF_PIP
+PF_PPP
+PF_PUP
+PF_ROUTE
+PF_RTIP
+PF_SIP
+PF_SNA
+PF_SYSTEM
+PF_XTP
+PIPE_BUF
+PM_STR
+POLLRDBAND
+POLLRDNORM
+POLLWRBAND
+POLLWRNORM
+POSIX_MADV_DONTNEED
+POSIX_MADV_NORMAL
+POSIX_MADV_RANDOM
+POSIX_MADV_SEQUENTIAL
+POSIX_MADV_WILLNEED
+POSIX_SPAWN_CLOEXEC_DEFAULT
+POSIX_SPAWN_RESETIDS
+POSIX_SPAWN_SETEXEC
+POSIX_SPAWN_SETPGROUP
+POSIX_SPAWN_SETSIGDEF
+POSIX_SPAWN_SETSIGMASK
+POSIX_SPAWN_START_SUSPENDED
+PRIO_DARWIN_BG
+PRIO_DARWIN_NONUI
+PRIO_DARWIN_PROCESS
+PRIO_DARWIN_THREAD
+PROC_PIDTASKALLINFO
+PROC_PIDTASKINFO
+PROC_PIDTHREADINFO
+PTHREAD_CREATE_DETACHED
+PTHREAD_CREATE_JOINABLE
+PTHREAD_MUTEX_DEFAULT
+PTHREAD_MUTEX_ERRORCHECK
+PTHREAD_PROCESS_PRIVATE
+PTHREAD_PROCESS_SHARED
+PTHREAD_STACK_MIN
+PT_ATTACH
+PT_ATTACHEXC
+PT_CONTINUE
+PT_DENY_ATTACH
+PT_DETACH
+PT_FIRSTMACH
+PT_FORCEQUOTA
+PT_KILL
+PT_READ_D
+PT_READ_I
+PT_READ_U
+PT_SIGEXC
+PT_STEP
+PT_THUPDATE
+PT_TRACE_ME
+PT_WRITE_D
+PT_WRITE_I
+PT_WRITE_U
+P_ALL
+P_PGID
+P_PID
+QCMD
+Q_GETQUOTA
+Q_QUOTAOFF
+Q_QUOTAON
+Q_SETQUOTA
+Q_SYNC
+RADIXCHAR
+RAND_MAX
+REG_ASSERT
+REG_ATOI
+REG_BACKR
+REG_BADBR
+REG_BADPAT
+REG_BADRPT
+REG_BASIC
+REG_DUMP
+REG_EBRACE
+REG_EBRACK
+REG_ECOLLATE
+REG_ECTYPE
+REG_EESCAPE
+REG_EMPTY
+REG_EPAREN
+REG_ERANGE
+REG_ESPACE
+REG_ESUBREG
+REG_EXTENDED
+REG_ICASE
+REG_INVARG
+REG_ITOA
+REG_LARGE
+REG_NEWLINE
+REG_NOMATCH
+REG_NOSPEC
+REG_NOSUB
+REG_NOTBOL
+REG_NOTEOL
+REG_PEND
+REG_STARTEND
+REG_TRACE
+RENAME_EXCL
+RENAME_SWAP
+RLIMIT_AS
+RLIMIT_CORE
+RLIMIT_CPU
+RLIMIT_DATA
+RLIMIT_FSIZE
+RLIMIT_MEMLOCK
+RLIMIT_NOFILE
+RLIMIT_NPROC
+RLIMIT_RSS
+RLIMIT_STACK
+RLIM_INFINITY
+RLIM_NLIMITS
+RTAX_AUTHOR
+RTAX_BRD
+RTAX_DST
+RTAX_GATEWAY
+RTAX_GENMASK
+RTAX_IFA
+RTAX_IFP
+RTAX_MAX
+RTAX_NETMASK
+RTA_AUTHOR
+RTA_BRD
+RTA_DST
+RTA_GATEWAY
+RTA_GENMASK
+RTA_IFA
+RTA_IFP
+RTA_NETMASK
+RTF_BLACKHOLE
+RTF_BROADCAST
+RTF_CLONING
+RTF_CONDEMNED
+RTF_DELCLONE
+RTF_DONE
+RTF_DYNAMIC
+RTF_GATEWAY
+RTF_HOST
+RTF_IFREF
+RTF_IFSCOPE
+RTF_LLINFO
+RTF_LOCAL
+RTF_MODIFIED
+RTF_MULTICAST
+RTF_NOIFREF
+RTF_PINNED
+RTF_PRCLONING
+RTF_PROTO1
+RTF_PROTO2
+RTF_PROTO3
+RTF_PROXY
+RTF_REJECT
+RTF_ROUTER
+RTF_STATIC
+RTF_UP
+RTF_WASCLONED
+RTF_XRESOLVE
+RTLD_FIRST
+RTLD_NEXT
+RTLD_NODELETE
+RTLD_NOLOAD
+RTLD_SELF
+RTM_ADD
+RTM_CHANGE
+RTM_DELADDR
+RTM_DELETE
+RTM_DELMADDR
+RTM_GET
+RTM_GET2
+RTM_IFINFO
+RTM_IFINFO2
+RTM_LOCK
+RTM_LOSING
+RTM_MISS
+RTM_NEWADDR
+RTM_NEWMADDR
+RTM_NEWMADDR2
+RTM_OLDADD
+RTM_OLDDEL
+RTM_REDIRECT
+RTM_RESOLVE
+RTM_VERSION
+RTV_EXPIRE
+RTV_HOPCOUNT
+RTV_MTU
+RTV_RPIPE
+RTV_RTT
+RTV_RTTVAR
+RTV_SPIPE
+RTV_SSTHRESH
+RUN_LVL
+RUSAGE_CHILDREN
+RUSAGE_SELF
+SAE_ASSOCID_ALL
+SAE_ASSOCID_ANY
+SAE_CONNID_ALL
+SAE_CONNID_ANY
+SCALE_PPM
+SCM_CREDS
+SCM_RIGHTS
+SCM_TIMESTAMP
+SEM_FAILED
+SEM_UNDO
+SETALL
+SETVAL
+SF_APPEND
+SF_ARCHIVED
+SF_IMMUTABLE
+SF_SETTABLE
+SHMLBA
+SHM_R
+SHM_RDONLY
+SHM_RND
+SHM_W
+SHUTDOWN_TIME
+SIGEMT
+SIGEV_NONE
+SIGEV_SIGNAL
+SIGEV_THREAD
+SIGINFO
+SIGNATURE
+SIGSTKSZ
+SIOCGIFADDR
+SOCK_MAXADDRLEN
+SOCK_RAW
+SOCK_RDM
+SOL_LOCAL
+SOMAXCONN
+SO_DONTTRUNC
+SO_LABEL
+SO_LINGER_SEC
+SO_NKE
+SO_NOADDRERR
+SO_NOSIGPIPE
+SO_NOTIFYCONFLICT
+SO_NP_EXTENSIONS
+SO_NREAD
+SO_NWRITE
+SO_PEERLABEL
+SO_RANDOMPORT
+SO_REUSESHAREUID
+SO_TIMESTAMP
+SO_TIMESTAMP_MONOTONIC
+SO_USELOOPBACK
+SO_WANTMORE
+SO_WANTOOBFLAG
+SS_DISABLE
+SS_ONSTACK
+STA_CLK
+STA_CLOCKERR
+STA_DEL
+STA_FLL
+STA_FREQHOLD
+STA_INS
+STA_MODE
+STA_NANO
+STA_PLL
+STA_PPSERROR
+STA_PPSFREQ
+STA_PPSJITTER
+STA_PPSSIGNAL
+STA_PPSTIME
+STA_PPSWANDER
+STA_RONLY
+STA_UNSYNC
+ST_NOSUID
+ST_RDONLY
+SUPERPAGE_NONE
+SUPERPAGE_SIZE_2MB
+SUPERPAGE_SIZE_ANY
+SYSPROTO_CONTROL
+SYSPROTO_EVENT
+S_IEXEC
+S_IREAD
+S_IWRITE
+TAB0
+TAB1
+TAB2
+TAB3
+TABDLY
+TCP_FASTOPEN
+TCP_KEEPALIVE
+TCP_KEEPCNT
+TCP_KEEPINTVL
+TCP_MAXSEG
+TCP_NOOPT
+TCP_NOPUSH
+THOUSEP
+TIME_DEL
+TIME_ERROR
+TIME_INS
+TIME_OK
+TIME_OOP
+TIME_WAIT
+TIOCCBRK
+TIOCCDTR
+TIOCCONS
+TIOCDCDTIMESTAMP
+TIOCDRAIN
+TIOCDSIMICROCODE
+TIOCEXCL
+TIOCEXT
+TIOCFLUSH
+TIOCGDRAINWAIT
+TIOCGETD
+TIOCGPGRP
+TIOCIXOFF
+TIOCIXON
+TIOCMBIC
+TIOCMBIS
+TIOCMGDTRWAIT
+TIOCMGET
+TIOCMODG
+TIOCMODS
+TIOCMSDTRWAIT
+TIOCMSET
+TIOCM_CAR
+TIOCM_CD
+TIOCM_CTS
+TIOCM_DSR
+TIOCM_DTR
+TIOCM_LE
+TIOCM_RI
+TIOCM_RNG
+TIOCM_RTS
+TIOCM_SR
+TIOCM_ST
+TIOCNOTTY
+TIOCNXCL
+TIOCOUTQ
+TIOCPKT
+TIOCPKT_DATA
+TIOCPKT_DOSTOP
+TIOCPKT_FLUSHREAD
+TIOCPKT_FLUSHWRITE
+TIOCPKT_IOCTL
+TIOCPKT_NOSTOP
+TIOCPKT_START
+TIOCPKT_STOP
+TIOCPTYGNAME
+TIOCPTYGRANT
+TIOCPTYUNLK
+TIOCREMOTE
+TIOCSBRK
+TIOCSCONS
+TIOCSCTTY
+TIOCSDRAINWAIT
+TIOCSDTR
+TIOCSETD
+TIOCSIG
+TIOCSPGRP
+TIOCSTART
+TIOCSTAT
+TIOCSTI
+TIOCSTOP
+TIOCTIMESTAMP
+TIOCUCNTL
+TMP_MAX
+T_FMT
+T_FMT_AMPM
+UF_APPEND
+UF_COMPRESSED
+UF_HIDDEN
+UF_IMMUTABLE
+UF_NODUMP
+UF_OPAQUE
+UF_SETTABLE
+UF_TRACKED
+USER_BC_BASE_MAX
+USER_BC_DIM_MAX
+USER_BC_SCALE_MAX
+USER_BC_STRING_MAX
+USER_COLL_WEIGHTS_MAX
+USER_CS_PATH
+USER_EXPR_NEST_MAX
+USER_LINE_MAX
+USER_MAXID
+USER_POSIX2_CHAR_TERM
+USER_POSIX2_C_BIND
+USER_POSIX2_C_DEV
+USER_POSIX2_FORT_DEV
+USER_POSIX2_FORT_RUN
+USER_POSIX2_LOCALEDEF
+USER_POSIX2_SW_DEV
+USER_POSIX2_UPE
+USER_POSIX2_VERSION
+USER_PROCESS
+USER_RE_DUP_MAX
+USER_STREAM_MAX
+USER_TZNAME_MAX
+UTIME_NOW
+UTIME_OMIT
+UTUN_OPT_FLAGS
+UTUN_OPT_IFNAME
+VDSUSP
+VM_FLAGS_ALIAS_MASK
+VM_FLAGS_ANYWHERE
+VM_FLAGS_FIXED
+VM_FLAGS_NO_CACHE
+VM_FLAGS_OVERWRITE
+VM_FLAGS_PURGABLE
+VM_FLAGS_RANDOM_ADDR
+VM_FLAGS_RESILIENT_CODESIGN
+VM_FLAGS_RESILIENT_MEDIA
+VM_FLAGS_RETURN_4K_DATA_ADDR
+VM_FLAGS_RETURN_DATA_ADDR
+VM_FLAGS_SUPERPAGE_MASK
+VM_FLAGS_SUPERPAGE_NONE
+VM_FLAGS_SUPERPAGE_SHIFT
+VM_FLAGS_SUPERPAGE_SIZE_2MB
+VM_FLAGS_SUPERPAGE_SIZE_ANY
+VM_FLAGS_USER_ALLOCATE
+VM_FLAGS_USER_MAP
+VM_FLAGS_USER_REMAP
+VM_LOADAVG
+VM_MACHFACTOR
+VM_MAXID
+VM_MEMORY_ACCELERATE
+VM_MEMORY_ANALYSIS_TOOL
+VM_MEMORY_APPKIT
+VM_MEMORY_APPLICATION_SPECIFIC_1
+VM_MEMORY_APPLICATION_SPECIFIC_16
+VM_MEMORY_ASL
+VM_MEMORY_ASSETSD
+VM_MEMORY_ATS
+VM_MEMORY_CARBON
+VM_MEMORY_CGIMAGE
+VM_MEMORY_COREDATA
+VM_MEMORY_COREDATA_OBJECTIDS
+VM_MEMORY_COREGRAPHICS
+VM_MEMORY_COREGRAPHICS_BACKINGSTORES
+VM_MEMORY_COREGRAPHICS_DATA
+VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS
+VM_MEMORY_COREGRAPHICS_MISC
+VM_MEMORY_COREGRAPHICS_SHARED
+VM_MEMORY_COREGRAPHICS_XALLOC
+VM_MEMORY_COREIMAGE
+VM_MEMORY_COREPROFILE
+VM_MEMORY_CORESERVICES
+VM_MEMORY_COREUI
+VM_MEMORY_COREUIFILE
+VM_MEMORY_CORPSEINFO
+VM_MEMORY_DHMM
+VM_MEMORY_DYLD
+VM_MEMORY_DYLD_MALLOC
+VM_MEMORY_DYLIB
+VM_MEMORY_FOUNDATION
+VM_MEMORY_GENEALOGY
+VM_MEMORY_GLSL
+VM_MEMORY_GUARD
+VM_MEMORY_IMAGEIO
+VM_MEMORY_IOKIT
+VM_MEMORY_JAVA
+VM_MEMORY_JAVASCRIPT_CORE
+VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR
+VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE
+VM_MEMORY_LAYERKIT
+VM_MEMORY_LIBDISPATCH
+VM_MEMORY_MACH_MSG
+VM_MEMORY_MALLOC
+VM_MEMORY_MALLOC_HUGE
+VM_MEMORY_MALLOC_LARGE
+VM_MEMORY_MALLOC_LARGE_REUSABLE
+VM_MEMORY_MALLOC_LARGE_REUSED
+VM_MEMORY_MALLOC_NANO
+VM_MEMORY_MALLOC_SMALL
+VM_MEMORY_MALLOC_TINY
+VM_MEMORY_OBJC_DISPATCHERS
+VM_MEMORY_OPENCL
+VM_MEMORY_OS_ALLOC_ONCE
+VM_MEMORY_RAWCAMERA
+VM_MEMORY_REALLOC
+VM_MEMORY_SBRK
+VM_MEMORY_SCENEKIT
+VM_MEMORY_SHARED_PMAP
+VM_MEMORY_SKYWALK
+VM_MEMORY_SQLITE
+VM_MEMORY_STACK
+VM_MEMORY_SWIFT_METADATA
+VM_MEMORY_SWIFT_RUNTIME
+VM_MEMORY_TCMALLOC
+VM_MEMORY_UNSHARED_PMAP
+VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS
+VM_METER
+VM_SWAPUSAGE
+VSTATUS
+VT0
+VT1
+VTDLY
+XATTR_CREATE
+XATTR_NODEFAULT
+XATTR_NOFOLLOW
+XATTR_NOSECURITY
+XATTR_REPLACE
+XATTR_SHOWCOMPRESSION
+XUCRED_VERSION
+YESEXPR
+YESSTR
+_IOFBF
+_IOLBF
+_IONBF
+_POSIX_VDISABLE
+_PTHREAD_COND_SIG_init
+_PTHREAD_MUTEX_SIG_init
+_PTHREAD_RWLOCK_SIG_init
+_RLIMIT_POSIX_FLAG
+_SC_2_CHAR_TERM
+_SC_2_C_BIND
+_SC_2_C_DEV
+_SC_2_FORT_DEV
+_SC_2_FORT_RUN
+_SC_2_LOCALEDEF
+_SC_2_PBS
+_SC_2_PBS_ACCOUNTING
+_SC_2_PBS_CHECKPOINT
+_SC_2_PBS_LOCATE
+_SC_2_PBS_MESSAGE
+_SC_2_PBS_TRACK
+_SC_2_SW_DEV
+_SC_2_UPE
+_SC_2_VERSION
+_SC_ADVISORY_INFO
+_SC_AIO_LISTIO_MAX
+_SC_AIO_MAX
+_SC_AIO_PRIO_DELTA_MAX
+_SC_ASYNCHRONOUS_IO
+_SC_ATEXIT_MAX
+_SC_BARRIERS
+_SC_BC_BASE_MAX
+_SC_BC_DIM_MAX
+_SC_BC_SCALE_MAX
+_SC_BC_STRING_MAX
+_SC_CLOCK_SELECTION
+_SC_COLL_WEIGHTS_MAX
+_SC_CPUTIME
+_SC_DELAYTIMER_MAX
+_SC_EXPR_NEST_MAX
+_SC_FILE_LOCKING
+_SC_FSYNC
+_SC_GETGR_R_SIZE_MAX
+_SC_GETPW_R_SIZE_MAX
+_SC_IOV_MAX
+_SC_IPV6
+_SC_JOB_CONTROL
+_SC_LINE_MAX
+_SC_MAPPED_FILES
+_SC_MEMLOCK
+_SC_MEMLOCK_RANGE
+_SC_MEMORY_PROTECTION
+_SC_MESSAGE_PASSING
+_SC_MONOTONIC_CLOCK
+_SC_MQ_OPEN_MAX
+_SC_MQ_PRIO_MAX
+_SC_NPROCESSORS_CONF
+_SC_NPROCESSORS_ONLN
+_SC_PASS_MAX
+_SC_PHYS_PAGES
+_SC_PRIORITIZED_IO
+_SC_PRIORITY_SCHEDULING
+_SC_RAW_SOCKETS
+_SC_READER_WRITER_LOCKS
+_SC_REALTIME_SIGNALS
+_SC_REGEXP
+_SC_RTSIG_MAX
+_SC_SAVED_IDS
+_SC_SEMAPHORES
+_SC_SEM_NSEMS_MAX
+_SC_SEM_VALUE_MAX
+_SC_SHARED_MEMORY_OBJECTS
+_SC_SHELL
+_SC_SIGQUEUE_MAX
+_SC_SPAWN
+_SC_SPIN_LOCKS
+_SC_SPORADIC_SERVER
+_SC_SS_REPL_MAX
+_SC_SYNCHRONIZED_IO
+_SC_THREADS
+_SC_THREAD_ATTR_STACKADDR
+_SC_THREAD_ATTR_STACKSIZE
+_SC_THREAD_CPUTIME
+_SC_THREAD_DESTRUCTOR_ITERATIONS
+_SC_THREAD_KEYS_MAX
+_SC_THREAD_PRIORITY_SCHEDULING
+_SC_THREAD_PRIO_INHERIT
+_SC_THREAD_PRIO_PROTECT
+_SC_THREAD_PROCESS_SHARED
+_SC_THREAD_SAFE_FUNCTIONS
+_SC_THREAD_SPORADIC_SERVER
+_SC_THREAD_STACK_MIN
+_SC_THREAD_THREADS_MAX
+_SC_TIMEOUTS
+_SC_TIMERS
+_SC_TIMER_MAX
+_SC_TRACE
+_SC_TRACE_EVENT_FILTER
+_SC_TRACE_EVENT_NAME_MAX
+_SC_TRACE_INHERIT
+_SC_TRACE_LOG
+_SC_TRACE_NAME_MAX
+_SC_TRACE_SYS_MAX
+_SC_TRACE_USER_EVENT_MAX
+_SC_TYPED_MEMORY_OBJECTS
+_SC_V6_ILP32_OFF32
+_SC_V6_ILP32_OFFBIG
+_SC_V6_LP64_OFF64
+_SC_V6_LPBIG_OFFBIG
+_SC_XBS5_ILP32_OFF32
+_SC_XBS5_ILP32_OFFBIG
+_SC_XBS5_LP64_OFF64
+_SC_XBS5_LPBIG_OFFBIG
+_SC_XOPEN_CRYPT
+_SC_XOPEN_ENH_I18N
+_SC_XOPEN_LEGACY
+_SC_XOPEN_REALTIME
+_SC_XOPEN_REALTIME_THREADS
+_SC_XOPEN_SHM
+_SC_XOPEN_STREAMS
+_SC_XOPEN_UNIX
+_SC_XOPEN_VERSION
+_SC_XOPEN_XCU_VERSION
+_UTX_HOSTSIZE
+_UTX_IDSIZE
+_UTX_LINESIZE
+_UTX_USERSIZE
+_WSTATUS
+_WSTOPPED
+__PTHREAD_CONDATTR_SIZE__
+__PTHREAD_COND_SIZE__
+__PTHREAD_MUTEX_SIZE__
+__PTHREAD_RWLOCKATTR_SIZE__
+__PTHREAD_RWLOCK_SIZE__
+__darwin_mcontext64
+__error
+_dyld_get_image_header
+_dyld_get_image_name
+_dyld_get_image_vmaddr_slide
+_dyld_image_count
+abs
+acct
+aio_cancel
+aio_error
+aio_fsync
+aio_read
+aio_return
+aio_suspend
+aio_write
+aiocb
+arphdr
+atof
+backtrace
+boolean_t
+bpf_hdr
+brk
+bsearch
+chflags
+chroot
+clearerr
+clock_getres
+cmsghdr
+connectx
+cpu_subtype_t
+cpu_type_t
+difftime
+dirfd
+disconnectx
+dqblk
+duplocale
+endgrent
+endpwent
+endservent
+endutxent
+exchangedata
+faccessat
+fchdir
+fchflags
+fdopendir
+fgetxattr
+flistxattr
+fmemopen
+forkpty
+freeifaddrs
+freelocale
+fremovexattr
+fsetxattr
+fsid_t
+fstatfs
+fstore_t
+ftok
+futimes
+getdomainname
+getdtablesize
+getfsstat
+getgrent
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+getifaddrs
+getitimer
+getline
+getloadavg
+getmntinfo
+getnameinfo
+getpeereid
+getpriority
+getprogname
+getpwent
+getpwnam_r
+getrlimit
+getrusage
+getservbyport
+getservent
+getsid
+getutxent
+getutxid
+getutxline
+getxattr
+glob
+glob_t
+globfree
+iconv
+iconv_close
+iconv_open
+iconv_t
+id_t
+idtype_t
+if_data
+if_freenameindex
+if_msghdr
+if_nameindex
+ifaddrs
+in6_pktinfo
+in_pktinfo
+initgroups
+integer_t
+ipc_perm
+kevent
+kevent64
+kevent64_s
+key_t
+killpg
+kqueue
+labs
+lio_listio
+listxattr
+load_command
+localeconv_l
+lockf
+login_tty
+lutimes
+mach_absolute_time
+mach_header
+mach_header_64
+mach_port_t
+mach_timebase_info
+mach_timebase_info_data_t
+madvise
+max_align_t
+mcontext_t
+mincore
+mkdirat
+mkstemps
+mount
+msghdr
+newlocale
+nice
+nl_item
+nl_langinfo
+ntp_adjtime
+ntp_gettime
+ntptimeval
+open_memstream
+open_wmemstream
+openat
+openpty
+pause
+popen
+posix_madvise
+posix_spawn
+posix_spawn_file_actions_addclose
+posix_spawn_file_actions_adddup2
+posix_spawn_file_actions_addopen
+posix_spawn_file_actions_destroy
+posix_spawn_file_actions_init
+posix_spawn_file_actions_t
+posix_spawnattr_destroy
+posix_spawnattr_getflags
+posix_spawnattr_getpgroup
+posix_spawnattr_getsigdefault
+posix_spawnattr_getsigmask
+posix_spawnattr_init
+posix_spawnattr_setflags
+posix_spawnattr_setpgroup
+posix_spawnattr_setsigdefault
+posix_spawnattr_setsigmask
+posix_spawnattr_t
+posix_spawnp
+preadv
+proc_bsdinfo
+proc_taskallinfo
+proc_taskinfo
+proc_threadinfo
+pseudo_AF_HDRCMPLT
+pseudo_AF_KEY
+pseudo_AF_PIP
+pseudo_AF_RTIP
+pseudo_AF_XTP
+pthread_cancel
+pthread_condattr_getpshared
+pthread_condattr_setpshared
+pthread_from_mach_thread_np
+pthread_get_stackaddr_np
+pthread_get_stacksize_np
+pthread_getname_np
+pthread_kill
+pthread_mutexattr_getpshared
+pthread_mutexattr_setpshared
+pthread_rwlockattr_getpshared
+pthread_rwlockattr_setpshared
+pthread_setname_np
+ptrace
+pututxline
+pwritev
+qsort
+querylocale
+quotactl
+radvisory
+rand
+readdir_r
+readlinkat
+recvmsg
+regcomp
+regerror
+regex_t
+regexec
+regfree
+regmatch_t
+regoff_t
+removexattr
+renameatx_np
+renamex_np
+sa_endpoints_t
+sae_associd_t
+sae_connid_t
+sbrk
+seekdir
+segment_command
+segment_command_64
+sem_close
+sem_open
+sem_unlink
+sembuf
+semctl
+semget
+semid_ds
+semop
+semun
+sendfile
+sendmsg
+setdomainname
+setgrent
+setgroups
+sethostname
+setitimer
+setpriority
+setprogname
+setpwent
+setrlimit
+setservent
+settimeofday
+setutxent
+setxattr
+sf_hdtr
+shmat
+shmatt_t
+shmctl
+shmdt
+shmget
+shmid_ds
+sigaltstack
+sigevent
+siginfo_t
+sigwait
+sockaddr_ctl
+sockaddr_dl
+sockaddr_inarp
+srand
+stack_t
+statfs
+strcasecmp
+strcasestr
+strncasecmp
+strndup
+strsignal
+sync
+syscall
+sysctl
+sysctlbyname
+sysctlnametomib
+telldir
+timeval32
+timex
+truncate
+ttyname_r
+ucontext_t
+unmount
+useconds_t
+uselocale
+utimensat
+utmpx
+utmpxname
+vm_prot_t
+vm_size_t
+wait4
+waitid
+xsw_usage
+xucred
diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt
new file mode 100644
index 0000000000000..b90bbdc9e32c8
--- /dev/null
+++ b/libc-test/semver/dragonfly.txt
@@ -0,0 +1,1380 @@
+ABDAY_1
+ABDAY_2
+ABDAY_3
+ABDAY_4
+ABDAY_5
+ABDAY_6
+ABDAY_7
+ABMON_1
+ABMON_10
+ABMON_11
+ABMON_12
+ABMON_2
+ABMON_3
+ABMON_4
+ABMON_5
+ABMON_6
+ABMON_7
+ABMON_8
+ABMON_9
+ACCOUNTING
+AF_APPLETALK
+AF_ATM
+AF_BLUETOOTH
+AF_CCITT
+AF_CHAOS
+AF_CNT
+AF_COIP
+AF_DATAKIT
+AF_DECnet
+AF_DLI
+AF_E164
+AF_ECMA
+AF_HYLINK
+AF_IEEE80211
+AF_IMPLINK
+AF_IPX
+AF_ISDN
+AF_ISO
+AF_LAT
+AF_LINK
+AF_LOCAL
+AF_MPLS
+AF_NATM
+AF_NETBIOS
+AF_NETGRAPH
+AF_OSI
+AF_PUP
+AF_ROUTE
+AF_SIP
+AF_SNA
+AIO_ALLDONE
+AIO_CANCELED
+AIO_LISTIO_MAX
+AIO_NOTCANCELED
+ALTMON_1
+ALTMON_10
+ALTMON_11
+ALTMON_12
+ALTMON_2
+ALTMON_3
+ALTMON_4
+ALTMON_5
+ALTMON_6
+ALTMON_7
+ALTMON_8
+ALTMON_9
+ALTWERASE
+ALT_DIGITS
+AM_STR
+ARPOP_REPLY
+ARPOP_REQUEST
+ATF_COM
+ATF_PERM
+ATF_PUBL
+ATF_USETRAILERS
+AT_EACCESS
+AT_FDCWD
+AT_REMOVEDIR
+AT_SYMLINK_FOLLOW
+AT_SYMLINK_NOFOLLOW
+B14400
+B28800
+B7200
+B76800
+BIOCFLUSH
+BIOCGBLEN
+BIOCGDLT
+BIOCGDLTLIST
+BIOCGETIF
+BIOCGHDRCMPLT
+BIOCGRSIG
+BIOCGRTIMEOUT
+BIOCGSEESENT
+BIOCGSTATS
+BIOCIMMEDIATE
+BIOCPROMISC
+BIOCSBLEN
+BIOCSDLT
+BIOCSETF
+BIOCSETIF
+BIOCSHDRCMPLT
+BIOCSRSIG
+BIOCSRTIMEOUT
+BIOCSSEESENT
+BIOCVERSION
+BOOT_TIME
+BPF_ALIGNMENT
+BTUARTDISC
+BUFSIZ
+CCAR_OFLOW
+CCTS_OFLOW
+CDSR_OFLOW
+CDTR_IFLOW
+CIGNORE
+CLD_CONTINUED
+CLD_DUMPED
+CLD_EXITED
+CLD_KILLED
+CLD_STOPPED
+CLD_TRAPPED
+CLOCK_MONOTONIC_FAST
+CLOCK_MONOTONIC_PRECISE
+CLOCK_PROCESS_CPUTIME_ID
+CLOCK_PROF
+CLOCK_REALTIME_FAST
+CLOCK_REALTIME_PRECISE
+CLOCK_SECOND
+CLOCK_THREAD_CPUTIME_ID
+CLOCK_UPTIME
+CLOCK_UPTIME_FAST
+CLOCK_UPTIME_PRECISE
+CLOCK_VIRTUAL
+CMGROUP_MAX
+CMSG_DATA
+CMSG_FIRSTHDR
+CMSG_LEN
+CMSG_NXTHDR
+CMSG_SPACE
+CODESET
+CRNCYSTR
+CRTSCTS
+CRTS_IFLOW
+CTL_DEBUG
+CTL_HW
+CTL_KERN
+CTL_LWKT
+CTL_MACHDEP
+CTL_MAXID
+CTL_NET
+CTL_P1003_1B
+CTL_P1003_1B_AIO_LISTIO_MAX
+CTL_P1003_1B_AIO_MAX
+CTL_P1003_1B_AIO_PRIO_DELTA_MAX
+CTL_P1003_1B_ASYNCHRONOUS_IO
+CTL_P1003_1B_DELAYTIMER_MAX
+CTL_P1003_1B_FSYNC
+CTL_P1003_1B_MAPPED_FILES
+CTL_P1003_1B_MAXID
+CTL_P1003_1B_MEMLOCK
+CTL_P1003_1B_MEMLOCK_RANGE
+CTL_P1003_1B_MEMORY_PROTECTION
+CTL_P1003_1B_MESSAGE_PASSING
+CTL_P1003_1B_PAGESIZE
+CTL_P1003_1B_PRIORITIZED_IO
+CTL_P1003_1B_PRIORITY_SCHEDULING
+CTL_P1003_1B_REALTIME_SIGNALS
+CTL_P1003_1B_RTSIG_MAX
+CTL_P1003_1B_SEMAPHORES
+CTL_P1003_1B_SEM_NSEMS_MAX
+CTL_P1003_1B_SEM_VALUE_MAX
+CTL_P1003_1B_SHARED_MEMORY_OBJECTS
+CTL_P1003_1B_SIGQUEUE_MAX
+CTL_P1003_1B_SYNCHRONIZED_IO
+CTL_P1003_1B_TIMERS
+CTL_P1003_1B_TIMER_MAX
+CTL_P1003_1B_UNUSED1
+CTL_UNSPEC
+CTL_USER
+CTL_VFS
+CTL_VM
+DAY_1
+DAY_2
+DAY_3
+DAY_4
+DAY_5
+DAY_6
+DAY_7
+DEAD_PROCESS
+DOWNTIME
+DT_UNKNOWN
+D_FMT
+D_MD_ORDER
+D_T_FMT
+EAI_AGAIN
+EAI_BADFLAGS
+EAI_FAIL
+EAI_FAMILY
+EAI_MEMORY
+EAI_NONAME
+EAI_OVERFLOW
+EAI_SERVICE
+EAI_SOCKTYPE
+EASYNC
+EAUTH
+EBADRPC
+ECHOCTL
+ECHOKE
+ECHOPRT
+EDOOFUS
+EFTYPE
+ELAST
+EMPTY
+ENEEDAUTH
+ENOATTR
+ENOMEDIUM
+ENOTSUP
+EOF
+EPROCLIM
+EPROCUNAVAIL
+EPROGMISMATCH
+EPROGUNAVAIL
+ERA
+ERA_D_FMT
+ERA_D_T_FMT
+ERA_T_FMT
+ERPCMISMATCH
+EVFILT_AIO
+EVFILT_EXCEPT
+EVFILT_FS
+EVFILT_PROC
+EVFILT_READ
+EVFILT_SIGNAL
+EVFILT_TIMER
+EVFILT_USER
+EVFILT_VNODE
+EVFILT_WRITE
+EV_ADD
+EV_CLEAR
+EV_DELETE
+EV_DISABLE
+EV_DISPATCH
+EV_ENABLE
+EV_EOF
+EV_ERROR
+EV_FLAG1
+EV_NODATA
+EV_ONESHOT
+EV_RECEIPT
+EV_SYSFLAGS
+EXTA
+EXTB
+EXTPROC
+Elf32_Addr
+Elf32_Half
+Elf32_Lword
+Elf32_Off
+Elf32_Phdr
+Elf32_Sword
+Elf32_Word
+Elf64_Addr
+Elf64_Half
+Elf64_Lword
+Elf64_Off
+Elf64_Phdr
+Elf64_Sword
+Elf64_Sxword
+Elf64_Word
+Elf64_Xword
+FILENAME_MAX
+FIOASYNC
+FIODGNAME
+FIODTYPE
+FIOGETLBA
+FIOGETOWN
+FIONCLEX
+FIONREAD
+FIOSETOWN
+FLUSHO
+FOPEN_MAX
+F_GETOWN
+F_LOCK
+F_RDLCK
+F_SETOWN
+F_TEST
+F_TLOCK
+F_ULOCK
+F_UNLCK
+F_WRLCK
+GLOB_ABORTED
+GLOB_APPEND
+GLOB_DOOFFS
+GLOB_ERR
+GLOB_MARK
+GLOB_NOCHECK
+GLOB_NOESCAPE
+GLOB_NOMATCH
+GLOB_NOSORT
+GLOB_NOSPACE
+HW_BYTEORDER
+HW_DISKNAMES
+HW_DISKSTATS
+HW_FLOATINGPT
+HW_MACHINE
+HW_MACHINE_ARCH
+HW_MACHINE_PLATFORM
+HW_MAXID
+HW_MODEL
+HW_NCPU
+HW_PAGESIZE
+HW_PHYSMEM
+HW_SENSORS
+HW_USERMEM
+IFF_ALLMULTI
+IFF_ALTPHYS
+IFF_BROADCAST
+IFF_DEBUG
+IFF_IDIRECT
+IFF_LINK0
+IFF_LINK1
+IFF_LINK2
+IFF_LOOPBACK
+IFF_MONITOR
+IFF_MULTICAST
+IFF_NOARP
+IFF_NPOLLING
+IFF_OACTIVE_COMPAT
+IFF_POINTOPOINT
+IFF_POLLING_COMPAT
+IFF_PPROMISC
+IFF_PROMISC
+IFF_RUNNING
+IFF_SIMPLEX
+IFF_SMART
+IFF_STATICARP
+IFF_UP
+INIT_PROCESS
+IOV_MAX
+IPPROTO_3PC
+IPPROTO_ADFS
+IPPROTO_AH
+IPPROTO_AHIP
+IPPROTO_APES
+IPPROTO_ARGUS
+IPPROTO_AX25
+IPPROTO_BHA
+IPPROTO_BLT
+IPPROTO_BRSATMON
+IPPROTO_CARP
+IPPROTO_CFTP
+IPPROTO_CHAOS
+IPPROTO_CMTP
+IPPROTO_CPHB
+IPPROTO_CPNX
+IPPROTO_DDP
+IPPROTO_DGP
+IPPROTO_DIVERT
+IPPROTO_DONE
+IPPROTO_DSTOPTS
+IPPROTO_EGP
+IPPROTO_EMCON
+IPPROTO_ENCAP
+IPPROTO_EON
+IPPROTO_ESP
+IPPROTO_ETHERIP
+IPPROTO_FRAGMENT
+IPPROTO_GGP
+IPPROTO_GMTP
+IPPROTO_GRE
+IPPROTO_HELLO
+IPPROTO_HMP
+IPPROTO_HOPOPTS
+IPPROTO_IDP
+IPPROTO_IDPR
+IPPROTO_IDRP
+IPPROTO_IGMP
+IPPROTO_IGP
+IPPROTO_IGRP
+IPPROTO_IL
+IPPROTO_INLSP
+IPPROTO_INP
+IPPROTO_IPCOMP
+IPPROTO_IPCV
+IPPROTO_IPEIP
+IPPROTO_IPIP
+IPPROTO_IPPC
+IPPROTO_IRTP
+IPPROTO_KRYPTOLAN
+IPPROTO_LARP
+IPPROTO_LEAF1
+IPPROTO_LEAF2
+IPPROTO_MAX
+IPPROTO_MEAS
+IPPROTO_MHRP
+IPPROTO_MICP
+IPPROTO_MOBILE
+IPPROTO_MTP
+IPPROTO_MUX
+IPPROTO_ND
+IPPROTO_NHRP
+I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ERN_MAXFILESPERPROC
+KERN_MAXID
+KERN_MAXPOSIXLOCKSPERUID
+KERN_MAXPROC
+KERN_MAXPROCPERUID
+KERN_MAXVNODES
+KERN_NGROUPS
+KERN_NISDOMAINNAME
+KERN_NTP_PLL
+KERN_OSRELDATE
+KERN_OSRELEASE
+KERN_OSREV
+KERN_OSTYPE
+KERN_POSIX1
+KERN_PROC
+KERN_PROC_ALL
+KERN_PROC_ARGS
+KERN_PROC_CWD
+KERN_PROC_FLAGMASK
+KERN_PROC_FLAG_LWP
+KERN_PROC_PATHNAME
+KERN_PROC_PGRP
+KERN_PROC_PID
+KERN_PROC_RUID
+KERN_PROC_SESSION
+KERN_PROC_TTY
+KERN_PROC_UID
+KERN_PROF
+KERN_PS_STRINGS
+KERN_SAVED_IDS
+KERN_SECURELVL
+KERN_UPDATEINTERVAL
+KERN_USRSTACK
+KERN_VERSION
+KERN_VNODE
+KIPC_MAXSOCKBUF
+KIPC_MAX_DATALEN
+KIPC_MAX_HDR
+KIPC_MAX_LINKHDR
+KIPC_MAX_PROTOHDR
+KIPC_MBSTAT
+KIPC_NMBCLUSTERS
+KIPC_SOCKBUF_WASTE
+KIPC_SOMAXCONN
+LC_ALL
+LC_ALL_MASK
+LC_COLLATE
+LC_COLLATE_MASK
+LC_CTYPE
+LC_CTYPE_MASK
+LC_MESSAGES
+LC_MESSAGES_MASK
+LC_MONETARY
+LC_MONETARY_MASK
+LC_NUMERIC
+LC_NUMERIC_MASK
+LC_TIME
+LC_TIME_MASK
+LIO_NOP
+LIO_NOWAIT
+LIO_READ
+LIO_WAIT
+LIO_WRITE
+LOCAL_PEERCRED
+LOGIN_PROCESS
+LOG_AUTHPRIV
+LOG_CONSOLE
+LOG_CRON
+LOG_FTP
+LOG_NFACILITIES
+LOG_NTP
+LOG_PERROR
+LOG_SECURITY
+L_tmpnam
+MADV_AUTOSYNC
+MADV_CORE
+MADV_DONTNEED
+MADV_FREE
+MADV_INVAL
+MADV_NOCORE
+MADV_NORMAL
+MADV_NOSYNC
+MADV_RANDOM
+MADV_SEQUENTIAL
+MADV_SETMAP
+MADV_WILLNEED
+MAP_COPY
+MAP_FILE
+MAP_HASSEMAPHORE
+MAP_NOCORE
+MAP_NOSYNC
+MAP_STACK
+MAXFREQ
+MAXPHASE
+MAXSEC
+MAXTC
+MCL_CURRENT
+MCL_FUTURE
+MDMBUF
+MINCORE_INCORE
+MINCORE_MODIFIED
+MINCORE_MODIFIED_OTHER
+MINCORE_REFERENCED
+MINCORE_REFERENCED_OTHER
+MINCORE_SUPER
+MINSEC
+MNT_FORCE
+MOD_CLKA
+MOD_CLKB
+MOD_ESTERROR
+MOD_FREQUENCY
+MOD_MAXERROR
+MOD_MICRO
+MOD_NANO
+MOD_OFFSET
+MOD_PPSMAX
+MOD_STATUS
+MOD_TAI
+MOD_TIMECONST
+MON_1
+MON_10
+MON_11
+MON_12
+MON_2
+MON_3
+MON_4
+MON_5
+MON_6
+MON_7
+MON_8
+MON_9
+MSG_CMSG_CLOEXEC
+MSG_DONTWAIT
+MSG_EOF
+MSG_FBLOCKING
+MSG_FMASK
+MSG_FNONBLOCKING
+MSG_NOSIGNAL
+MSG_SYNC
+MSG_UNUSED09
+NANOSECOND
+NETGRAPHDISC
+NET_RT_DUMP
+NET_RT_FLAGS
+NET_RT_IFLIST
+NET_RT_MAXID
+NEW_TIME
+NOEXPR
+NOKERNINFO
+NOSTR
+NOTE_ATTRIB
+NOTE_CHILD
+NOTE_DELETE
+NOTE_EXEC
+NOTE_EXIT
+NOTE_EXTEND
+NOTE_FFAND
+NOTE_FFCOPY
+NOTE_FFCTRLMASK
+NOTE_FFLAGSMASK
+NOTE_FFNOP
+NOTE_FFOR
+NOTE_FORK
+NOTE_LINK
+NOTE_LOWAT
+NOTE_OOB
+NOTE_PCTRLMASK
+NOTE_PDATAMASK
+NOTE_RENAME
+NOTE_REVOKE
+NOTE_TRACK
+NOTE_TRACKERR
+NOTE_TRIGGER
+NOTE_WRITE
+NTP_API
+OLD_TIME
+ONOEOT
+OXTABS
+O_DIRECT
+O_EXLOCK
+O_FSYNC
+O_NDELAY
+O_NOCTTY
+O_SHLOCK
+O_SYNC
+PENDIN
+PF_APPLETALK
+PF_ATM
+PF_BLUETOOTH
+PF_CCITT
+PF_CHAOS
+PF_CNT
+PF_COIP
+PF_DATAKIT
+PF_DECnet
+PF_DLI
+PF_ECMA
+PF_HYLINK
+PF_IMPLINK
+PF_IPX
+PF_ISDN
+PF_ISO
+PF_KEY
+PF_LAT
+PF_LINK
+PF_LOCAL
+PF_NATM
+PF_NETBIOS
+PF_NETGRAPH
+PF_OSI
+PF_PIP
+PF_PUP
+PF_ROUTE
+PF_RTIP
+PF_SIP
+PF_SNA
+PF_XTP
+PIOD_READ_D
+PIOD_READ_I
+PIOD_WRITE_D
+PIOD_WRITE_I
+PIPE_BUF
+PM_STR
+POLLRDBAND
+POLLRDNORM
+POLLSTANDARD
+POLLWRBAND
+POLLWRNORM
+POSIX_MADV_DONTNEED
+POSIX_MADV_NORMAL
+POSIX_MADV_RANDOM
+POSIX_MADV_SEQUENTIAL
+POSIX_MADV_WILLNEED
+PPPDISC
+PTHREAD_CREATE_DETACHED
+PTHREAD_CREATE_JOINABLE
+PTHREAD_MUTEX_DEFAULT
+PTHREAD_MUTEX_ERRORCHECK
+PTHREAD_PROCESS_PRIVATE
+PTHREAD_PROCESS_SHARED
+PTHREAD_STACK_MIN
+PT_ATTACH
+PT_CONTINUE
+PT_DETACH
+PT_FIRSTMACH
+PT_IO
+PT_KILL
+PT_READ_D
+PT_READ_I
+PT_STEP
+PT_TRACE_ME
+PT_WRITE_D
+PT_WRITE_I
+P_ALL
+P_PGID
+P_PID
+QCMD
+Q_GETQUOTA
+Q_QUOTAOFF
+Q_QUOTAON
+Q_SETQUOTA
+Q_SYNC
+RADIXCHAR
+RAND_MAX
+REG_ASSERT
+REG_ATOI
+REG_BACKR
+REG_BADBR
+REG_BADPAT
+REG_BADRPT
+REG_BASIC
+REG_DUMP
+REG_EBRACE
+RE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KT_START
+TIOCPKT_STOP
+TIOCREMOTE
+TIOCSBRK
+TIOCSCTTY
+TIOCSDRAINWAIT
+TIOCSDTR
+TIOCSETA
+TIOCSETAF
+TIOCSETAW
+TIOCSETD
+TIOCSIG
+TIOCSPGRP
+TIOCSTART
+TIOCSTAT
+TIOCSTI
+TIOCSTOP
+TIOCTIMESTAMP
+TIOCUCNTL
+TMP_MAX
+TTYDISC
+T_FMT
+T_FMT_AMPM
+UF_APPEND
+UF_CACHE
+UF_IMMUTABLE
+UF_NODUMP
+UF_NOHISTORY
+UF_NOUNLINK
+UF_OPAQUE
+UF_SETTABLE
+UF_XLINK
+USER_BC_BASE_MAX
+USER_BC_DIM_MAX
+USER_BC_SCALE_MAX
+USER_BC_STRING_MAX
+USER_COLL_WEIGHTS_MAX
+USER_CS_PATH
+USER_EXPR_NEST_MAX
+USER_LINE_MAX
+USER_MAXID
+USER_POSIX2_CHAR_TERM
+USER_POSIX2_C_BIND
+USER_POSIX2_C_DEV
+USER_POSIX2_FORT_DEV
+USER_POSIX2_FORT_RUN
+USER_POSIX2_LOCALEDEF
+USER_POSIX2_SW_DEV
+USER_POSIX2_UPE
+USER_POSIX2_VERSION
+USER_PROCESS
+USER_RE_DUP_MAX
+USER_STREAM_MAX
+USER_TZNAME_MAX
+UTIME_NOW
+UTIME_OMIT
+UTX_DB_LASTLOG
+UTX_DB_UTMPX
+UTX_DB_WTMPX
+VCHECKPT
+VDSUSP
+VERASE2
+VSTATUS
+WTRAPPED
+XUCRED_VERSION
+XU_NGROUPS
+YESEXPR
+YESSTR
+_IOFBF
+_IOLBF
+_IONBF
+_PC_2_SYMLINKS
+_PC_ACL_EXTENDED
+_PC_ACL_PATH_MAX
+_PC_ALLOC_SIZE_MIN
+_PC_ASYNC_IO
+_PC_CAP_PRESENT
+_PC_FILESIZEBITS
+_PC_INF_PRESENT
+_PC_MAC_PRESENT
+_PC_MIN_HOLE_SIZE
+_PC_PRIO_IO
+_PC_REC_INCR_XFER_SIZE
+_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EXP
+_SC_RTSIG_MAX
+_SC_SAVED_IDS
+_SC_SEMAPHORES
+_SC_SEM_NSEMS_MAX
+_SC_SEM_VALUE_MAX
+_SC_SHARED_MEMORY_OBJECTS
+_SC_SHELL
+_SC_SIGQUEUE_MAX
+_SC_SPAWN
+_SC_SPIN_LOCKS
+_SC_SPORADIC_SERVER
+_SC_SYNCHRONIZED_IO
+_SC_THREADS
+_SC_THREAD_ATTR_STACKADDR
+_SC_THREAD_ATTR_STACKSIZE
+_SC_THREAD_DESTRUCTOR_ITERATIONS
+_SC_THREAD_KEYS_MAX
+_SC_THREAD_PRIORITY_SCHEDULING
+_SC_THREAD_PRIO_INHERIT
+_SC_THREAD_PRIO_PROTECT
+_SC_THREAD_PROCESS_SHARED
+_SC_THREAD_ROBUST_PRIO_INHERIT
+_SC_THREAD_ROBUST_PRIO_PROTECT
+_SC_THREAD_SAFE_FUNCTIONS
+_SC_THREAD_SPORADIC_SERVER
+_SC_THREAD_STACK_MIN
+_SC_THREAD_THREADS_MAX
+_SC_TIMEOUTS
+_SC_TIMERS
+_SC_TIMER_MAX
+_SC_TRACE
+_SC_TRACE_EVENT_FILTER
+_SC_TRACE_INHERIT
+_SC_TRACE_LOG
+_SC_TYPED_MEMORY_OBJECTS
+_SC_V6_ILP32_OFF32
+_SC_V6_ILP32_OFFBIG
+_SC_V6_LP64_OFF64
+_SC_V6_LPBIG_OFFBIG
+_SC_V7_ILP32_OFF32
+_SC_V7_ILP32_OFFBIG
+_SC_V7_LP64_OFF64
+_SC_V7_LPBIG_OFFBIG
+_SC_XOPEN_CRYPT
+_SC_XOPEN_ENH_I18N
+_SC_XOPEN_LEGACY
+_SC_XOPEN_REALTIME
+_SC_XOPEN_REALTIME_THREADS
+_SC_XOPEN_SHM
+_SC_XOPEN_STREAMS
+_SC_XOPEN_UNIX
+_SC_XOPEN_VERSION
+_SC_XOPEN_XCU_VERSION
+__errno_location
+abs
+accept4
+acct
+aio_cancel
+aio_error
+aio_fsync
+aio_read
+aio_return
+aio_suspend
+aio_waitcomplete
+aio_write
+aiocb
+arphdr
+atof
+bpf_dltlist
+bpf_hdr
+bpf_insn
+bpf_program
+bpf_stat
+bpf_version
+bsearch
+chflags
+chflagsat
+chroot
+clearerr
+clock_getcpuclockid
+clock_getres
+clock_settime
+cmsgcred
+cmsghdr
+daemon
+difftime
+dirfd
+dl_iterate_phdr
+dl_phdr_info
+duplocale
+endgrent
+endpwent
+endservent
+endutxent
+exit_status
+faccessat
+fchdir
+fchflags
+fdopendir
+fmemopen
+forkpty
+freeifaddrs
+freelocale
+fsid_t
+fstatfs
+futimes
+getdomainname
+getdtablesize
+getgrent
+getgrent_r
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+getifaddrs
+getitimer
+getline
+getloadavg
+getnameinfo
+getpeereid
+getpriority
+getprogname
+getpwent
+getpwent_r
+getpwnam_r
+getrlimit
+getrusage
+getservbyport
+getservent
+getsid
+getutxent
+getutxid
+getutxline
+glob
+glob_t
+globfree
+iconv
+iconv_close
+iconv_open
+iconv_t
+id_t
+idtype_t
+if_data
+if_freenameindex
+if_msghdr
+if_nameindex
+ifaddrs
+in6_pktinfo
+initgroups
+kevent
+killpg
+kqueue
+labs
+lchflags
+lio_listio
+lockf
+login_tty
+lutimes
+lwp_rtprio
+lwpid_t
+madvise
+memmem
+memrchr
+mincore
+mkdirat
+mkfifoat
+mknodat
+mkstemps
+mq_attr
+mq_close
+mq_getattr
+mq_notify
+mq_open
+mq_receive
+mq_send
+mq_setattr
+mq_timedreceive
+mq_timedsend
+mq_unlink
+mqd_t
+msghdr
+newlocale
+nice
+nl_item
+nl_langinfo
+nl_langinfo_l
+ntp_adjtime
+ntp_gettime
+ntptimeval
+open_memstream
+open_wmemstream
+openat
+openpty
+pause
+pipe2
+popen
+posix_madvise
+ppoll
+preadv
+pseudo_AF_HDRCMPLT
+pseudo_AF_KEY
+pseudo_AF_PIP
+pseudo_AF_RTIP
+pseudo_AF_XTP
+pthread_attr_get_np
+pthread_attr_getguardsize
+pthread_attr_getstack
+pthread_cancel
+pthread_condattr_getclock
+pthread_condattr_getpshared
+pthread_condattr_setclock
+pthread_condattr_setpshared
+pthread_kill
+pthread_main_np
+pthread_mutex_timedlock
+pthread_mutexattr_getpshared
+pthread_mutexattr_setpshared
+pthread_rwlockattr_getpshared
+pthread_rwlockattr_setpshared
+pthread_set_name_np
+ptrace
+ptrace_io_desc
+pututxline
+pwritev
+qsort
+querylocale
+rand
+readdir_r
+readlinkat
+recvmsg
+regcomp
+regerror
+regex_t
+regexec
+regfree
+regmatch_t
+regoff_t
+rtprio
+sched_getscheduler
+sched_param
+sched_setscheduler
+seekdir
+sem
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_timedwait
+sem_unlink
+sendfile
+sendmsg
+setdomainname
+setgrent
+setgroups
+sethostname
+setitimer
+setpriority
+setprogname
+setpwent
+setresgid
+setresuid
+setrlimit
+setservent
+settimeofday
+setutxdb
+setutxent
+sf_hdtr
+sigaltstack
+sigevent
+siginfo_t
+sigtimedwait
+sigwait
+sigwaitinfo
+sockaddr_dl
+srand
+stack_t
+statfs
+strcasecmp
+strcasestr
+strncasecmp
+strndup
+strsignal
+sync
+syscall
+sysctl
+sysctlbyname
+sysctlnametomib
+telldir
+timex
+truncate
+ttyname_r
+unmount
+useconds_t
+uselocale
+utimensat
+utmpx
+uuid
+uuid_t
+vm_size_t
+wait4
+waitid
+xucred
diff --git a/libc-test/semver/freebsd-x86_64.txt b/libc-test/semver/freebsd-x86_64.txt
new file mode 100644
index 0000000000000..2b170e7d6ae00
--- /dev/null
+++ b/libc-test/semver/freebsd-x86_64.txt
@@ -0,0 +1,18 @@
+MAP_32BIT
+_MC_FLAG_MASK
+_MC_FPFMT_NODEV
+_MC_FPFMT_XMM
+_MC_FPOWNED_FPU
+_MC_FPOWNED_NONE
+_MC_FPOWNED_PCB
+_MC_HASBASES
+_MC_HASFPXSTATE
+_MC_HASSEGS
+fpreg
+fpreg32
+max_align_t
+mcontext_t
+reg
+reg32
+ucontext_t
+xmmreg
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt
new file mode 100644
index 0000000000000..94c1dd75cf898
--- /dev/null
+++ b/libc-test/semver/freebsd.txt
@@ -0,0 +1,1627 @@
+ABDAY_1
+ABDAY_2
+ABDAY_3
+ABDAY_4
+ABDAY_5
+ABDAY_6
+ABDAY_7
+ABMON_1
+ABMON_10
+ABMON_11
+ABMON_12
+ABMON_2
+ABMON_3
+ABMON_4
+ABMON_5
+ABMON_6
+ABMON_7
+ABMON_8
+ABMON_9
+AF_APPLETALK
+AF_ARP
+AF_ATM
+AF_BLUETOOTH
+AF_CCITT
+AF_CHAOS
+AF_CNT
+AF_COIP
+AF_DATAKIT
+AF_DECnet
+AF_DLI
+AF_E164
+AF_ECMA
+AF_HYLINK
+AF_IEEE80211
+AF_IMPLINK
+AF_INET6_SDP
+AF_INET_SDP
+AF_IPX
+AF_ISDN
+AF_ISO
+AF_LAT
+AF_LINK
+AF_LOCAL
+AF_NATM
+AF_NETBIOS
+AF_NETGRAPH
+AF_OSI
+AF_PUP
+AF_ROUTE
+AF_SCLUSTER
+AF_SIP
+AF_SLOW
+AF_SNA
+AIO_ALLDONE
+AIO_CANCELED
+AIO_LISTIO_MAX
+AIO_NOTCANCELED
+ALTMON_1
+ALTMON_10
+ALTMON_11
+ALTMON_12
+ALTMON_2
+ALTMON_3
+ALTMON_4
+ALTMON_5
+ALTMON_6
+ALTMON_7
+ALTMON_8
+ALTMON_9
+ALTWERASE
+ALT_DIGITS
+AM_STR
+ARPOP_REPLY
+ARPOP_REQUEST
+ATF_COM
+ATF_PERM
+ATF_PUBL
+ATF_USETRAILERS
+AT_EACCESS
+AT_FDCWD
+AT_REMOVEDIR
+AT_SYMLINK_FOLLOW
+AT_SYMLINK_NOFOLLOW
+B14400
+B28800
+B460800
+B7200
+B76800
+B921600
+BIOCFLUSH
+BIOCGBLEN
+BIOCGDLT
+BIOCGDLTLIST
+BIOCGETIF
+BIOCGHDRCMPLT
+BIOCGRSIG
+BIOCGRTIMEOUT
+BIOCGSEESENT
+BIOCGSTATS
+BIOCIMMEDIATE
+BIOCPROMISC
+BIOCSBLEN
+BIOCSDLT
+BIOCSETF
+BIOCSETFNR
+BIOCSETIF
+BIOCSHDRCMPLT
+BIOCSRSIG
+BIOCSRTIMEOUT
+BIOCSSEESENT
+BIOCVERSION
+BOOT_TIME
+BPF_ALIGNMENT
+BUFSIZ
+CCAR_OFLOW
+CCTS_OFLOW
+CDSR_OFLOW
+CDTR_IFLOW
+CIGNORE
+CLD_CONTINUED
+CLD_DUMPED
+CLD_EXITED
+CLD_KILLED
+CLD_STOPPED
+CLD_TRAPPED
+CLOCK_MONOTONIC_FAST
+CLOCK_MONOTONIC_PRECISE
+CLOCK_PROCESS_CPUTIME_ID
+CLOCK_PROF
+CLOCK_REALTIME_FAST
+CLOCK_REALTIME_PRECISE
+CLOCK_SECOND
+CLOCK_THREAD_CPUTIME_ID
+CLOCK_UPTIME
+CLOCK_UPTIME_FAST
+CLOCK_UPTIME_PRECISE
+CLOCK_VIRTUAL
+CMGROUP_MAX
+CMSG_DATA
+CMSG_FIRSTHDR
+CMSG_LEN
+CMSG_NXTHDR
+CMSG_SPACE
+CODESET
+CRNCYSTR
+CRTSCTS
+CRTS_IFLOW
+CTL_DEBUG
+CTL_HW
+CTL_KERN
+CTL_MACHDEP
+CTL_NET
+CTL_P1003_1B
+CTL_P1003_1B_AIO_LISTIO_MAX
+CTL_P1003_1B_AIO_MAX
+CTL_P1003_1B_AIO_PRIO_DELTA_MAX
+CTL_P1003_1B_ASYNCHRONOUS_IO
+CTL_P1003_1B_DELAYTIMER_MAX
+CTL_P1003_1B_FSYNC
+CTL_P1003_1B_MAPPED_FILES
+CTL_P1003_1B_MEMLOCK
+CTL_P1003_1B_MEMLOCK_RANGE
+CTL_P1003_1B_MEMORY_PROTECTION
+CTL_P1003_1B_MESSAGE_PASSING
+CTL_P1003_1B_MQ_OP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ENDFILE
+EVFILT_SIGNAL
+EVFILT_TIMER
+EVFILT_USER
+EVFILT_VNODE
+EVFILT_WRITE
+EV_ADD
+EV_CLEAR
+EV_DELETE
+EV_DISABLE
+EV_DISPATCH
+EV_DROP
+EV_ENABLE
+EV_EOF
+EV_ERROR
+EV_FLAG1
+EV_ONESHOT
+EV_RECEIPT
+EV_SYSFLAGS
+EXTA
+EXTATTR_NAMESPACE_EMPTY
+EXTATTR_NAMESPACE_SYSTEM
+EXTATTR_NAMESPACE_USER
+EXTB
+EXTPROC
+Elf32_Addr
+Elf32_Half
+Elf32_Lword
+Elf32_Off
+Elf32_Phdr
+Elf32_Sword
+Elf32_Word
+Elf64_Addr
+Elf64_Half
+Elf64_Lword
+Elf64_Off
+Elf64_Phdr
+Elf64_Sword
+Elf64_Sxword
+Elf64_Word
+Elf64_Xword
+FILENAME_MAX
+FIOASYNC
+FIODGNAME
+FIODTYPE
+FIOGETLBA
+FIOGETOWN
+FIONCLEX
+FIONREAD
+FIONSPACE
+FIONWRITE
+FIOSEEKDATA
+FIOSEEKHOLE
+FIOSETOWN
+FLUSHO
+FOPEN_MAX
+F_DUP2FD
+F_DUP2FD_CLOEXEC
+F_GETOWN
+F_LOCK
+F_OGETLK
+F_OSETLK
+F_OSETLKW
+F_RDAHEAD
+F_RDLCK
+F_READAHEAD
+F_SETLK_REMOTE
+F_SETOWN
+F_TEST
+F_TLOCK
+F_ULOCK
+F_UNLCK
+F_WRLCK
+GLOB_ABORTED
+GLOB_APPEND
+GLOB_DOOFFS
+GLOB_ERR
+GLOB_MARK
+GLOB_NOCHECK
+GLOB_NOESCAPE
+GLOB_NOMATCH
+GLOB_NOSORT
+GLOB_NOSPACE
+H4DISC
+HW_BYTEORDER
+HW_DISKNAMES
+HW_DISKSTATS
+HW_FLOATINGPT
+HW_MACHINE
+HW_MACHINE_ARCH
+HW_MODEL
+HW_NCPU
+HW_PAGESIZE
+HW_PHYSMEM
+HW_REALMEM
+HW_USERMEM
+IFF_ALLMULTI
+IFF_ALTPHYS
+IFF_BROADCAST
+IFF_CANTCONFIG
+IFF_DEBUG
+IFF_DYING
+IFF_LINK0
+IFF_LINK1
+IFF_LINK2
+IFF_LOOPBACK
+IFF_MONITOR
+IFF_MULTICAST
+IFF_NOARP
+IFF_OACTIVE
+IFF_POINTOPOINT
+IFF_PPROMISC
+IFF_PROMISC
+IFF_RENAMING
+IFF_RUNNING
+IFF_SIMPLEX
+IFF_STATICARP
+IFF_UP
+INIT_PROCESS
+IOV_MAX
+IPC_CREAT
+IPC_EXCL
+IPC_INFO
+IPC_M
+IPC_NOWAIT
+IPC_PRIVATE
+IPC_R
+IPC_RMID
+IPC_SET
+IPC_STAT
+IPC_W
+IPPROTO_3PC
+IPPROTO_ADFS
+IPPROTO_AH
+IPPROTO_AHIP
+IPPROTO_APES
+IPPROTO_ARGUS
+IPPROTO_AX25
+IPPROTO_BHA
+IPPROTO_BLT
+IPPROTO_BRSATMON
+IPPROTO_CARP
+IPPROTO_CFTP
+IPPROTO_CHAOS
+IPPROTO_CMTP
+IPPROTO_CPHB
+IPPROTO_CPNX
+IPPROTO_DCCP
+IPPROTO_DDP
+IPPROTO_DGP
+IPPROTO_DIVERT
+IPPROTO_DONE
+IPPROTO_DSTOPTS
+IPPROTO_EGP
+IPPROTO_EMCON
+IPPROTO_ENCAP
+IPPROTO_EON
+IPPROTO_ESP
+IPPROTO_ETHERIP
+IPPROTO_FRAGMENT
+IPPROTO_GGP
+IPPROTO_GMTP
+IPPROTO_GRE
+IPPROTO_HELLO
+IPPROTO_HIP
+IPPROTO_HMP
+IPPROTO_HOPOPTS
+IPPROTO_IDP
+IPPROTO_IDPR
+IPPROTO_IDRP
+IPPROTO_IGMP
+IPPROTO_IGP
+IPPROTO_IGRP
+IPPROTO_IL
+IPPROTO_INLSP
+IPPROTO_INP
+IPPROTO_IPCOMP
+IPPROTO_IPCV
+IPPROTO_IPEIP
+IPPROTO_IPIP
+IPPROTO_IPPC
+IPPROTO_IRTP
+IPPRO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
+IPV6_TCLASS
+IP_BINDANY
+IP_BINDMULTI
+IP_HDRINCL
+IP_ORIGDSTADDR
+IP_RECVDSTADDR
+IP_RECVIF
+IP_RECVORIGDSTADDR
+IP_RECVTOS
+IP_RSS_LISTEN_BUCKET
+IP_SENDSRCADDR
+IP_TOS
+ITIMER_PROF
+ITIMER_REAL
+ITIMER_VIRTUAL
+JAIL_API_VERSION
+JAIL_ATTACH
+JAIL_CREATE
+JAIL_DYING
+JAIL_GET_MASK
+JAIL_SET_MASK
+JAIL_SYS_DISABLE
+JAIL_SYS_INHERIT
+JAIL_SYS_NEW
+JAIL_UPDATE
+KERN_ARGMAX
+KERN_ARND
+KERN_BOOTFILE
+KERN_BOOTTIME
+KERN_CLOCKRATE
+KERN_DUMMY
+KERN_DUMPDEV
+KERN_FILE
+KERN_HOSTID
+KERN_HOSTNAME
+KERN_HOSTUUID
+KERN_IOV_MAX
+KERN_IPC
+KERN_JOB_CONTROL
+KERN_LOGSIGEXIT
+KERN_MAXFILES
+KERN_MAXFILESPERPROC
+KERN_MAXPROC
+KERN_MAXPROCPERUID
+KERN_MAXVNODES
+KERN_NGROUPS
+KERN_NISDOMAINNAME
+KERN_NTP_PLL
+KERN_OSRELDATE
+KERN_OSRELEASE
+KERN_OSREV
+KERN_OSTYPE
+KERN_POSIX1
+KERN_PROC
+KERN_PROC_ALL
+KERN_PROC_ARGS
+KERN_PROC_AUXV
+KERN_PROC_ENV
+KERN_PROC_FILEDESC
+KERN_PROC_GID
+KERN_PROC_GROUPS
+KERN_PROC_INC_THREAD
+KERN_PROC_KSTACK
+KERN_PROC_OFILEDESC
+KERN_PROC_OSREL
+KERN_PROC_OVMMAP
+KERN_PROC_PATHNAME
+KERN_PROC_PGRP
+KERN_PROC_PID
+KERN_PROC_PROC
+KERN_PROC_PS_STRINGS
+KERN_PROC_RGID
+KERN_PROC_RLIMIT
+KERN_PROC_RUID
+KERN_PROC_SESSION
+KERN_PROC_SIGTRAMP
+KERN_PROC_SV_NAME
+KERN_PROC_TTY
+KERN_PROC_UID
+KERN_PROC_UMASK
+KERN_PROC_VMMAP
+KERN_PROF
+KERN_PS_STRINGS
+KERN_SAVED_IDS
+KERN_SECURELVL
+KERN_UPDATEINTERVAL
+KERN_USRSTACK
+KERN_VERSION
+KERN_VNODE
+KIPC_MAXSOCKBUF
+KIPC_MAX_DATALEN
+KIPC_MAX_HDR
+KIPC_MAX_LINKHDR
+KIPC_MAX_PROTOHDR
+KIPC_SOCKBUF_WASTE
+KIPC_SOMAXCONN
+LC_ALL
+LC_ALL_MASK
+LC_COLLATE
+LC_COLLATE_MASK
+LC_CTYPE
+LC_CTYPE_MASK
+LC_MESSAGES
+LC_MESSAGES_MASK
+LC_MONETARY
+LC_MONETARY_MASK
+LC_NUMERIC
+LC_NUMERIC_MASK
+LC_TIME
+LC_TIME_MASK
+LIO_NOP
+LIO_NOWAIT
+LIO_READ
+LIO_WAIT
+LIO_WRITE
+LOCAL_CONNWAIT
+LOCAL_CREDS
+LOCAL_PEERCRED
+LOCAL_VENDOR
+LOGIN_PROCESS
+LOG_AUTHPRIV
+LOG_CONSOLE
+LOG_CRON
+LOG_FTP
+LOG_NFACILITIES
+LOG_NTP
+LOG_PERROR
+LOG_SECURITY
+L_tmpnam
+MADV_AUTOSYNC
+MADV_CORE
+MADV_DONTNEED
+MADV_FREE
+MADV_NOCORE
+MADV_NORMAL
+MADV_NOSYNC
+MADV_PROTECT
+MADV_RANDOM
+MADV_SEQUENTIAL
+MADV_WILLNEED
+MAP_COPY
+MAP_FILE
+MAP_HASSEMAPHORE
+MAP_NOCORE
+MAP_NOSYNC
+MAP_STACK
+MAXFREQ
+MAXPHASE
+MAXSEC
+MAXTC
+MCL_CURRENT
+MCL_FUTURE
+MDMBUF
+MINCORE_INCORE
+MINCORE_MODIFIED
+MINCORE_MODIFIED_OTHER
+MINCORE_REFERENCED
+MINCORE_REFERENCED_OTHER
+MINCORE_SUPER
+MINSEC
+MINSIGSTKSZ
+MNT_FORCE
+MOD_CLKA
+MOD_CLKB
+MOD_ESTERROR
+MOD_FREQUENCY
+MOD_MAXERROR
+MOD_MICRO
+MOD_NANO
+MOD_OFFSET
+MOD_PPSMAX
+MOD_STATUS
+MOD_TAI
+MOD_TIMECONST
+MON_1
+MON_10
+MON_11
+MON_12
+MON_2
+MON_3
+MON_4
+MON_5
+MON_6
+MON_7
+MON_8
+MON_9
+MSG_CMSG_CLOEXEC
+MSG_COMPAT
+MSG_DONTWAIT
+MSG_EOF
+MSG_NBIO
+MSG_NOERROR
+MSG_NOSIGNAL
+MSG_NOTIFICATION
+NANOSECOND
+NETGRAPHDISC
+NET_RT_DUMP
+NET_RT_FLAGS
+NET_RT_IFLIST
+NET_RT_IFLISTL
+NET_RT_IFMALIST
+NEW_TIME
+NI_DGRAM
+NI_NAMEREQD
+NI_NOFQDN
+NI_NUMERICHOST
+NI_NUMERICSCOPE
+NI_NUMERICSERV
+NOEXPR
+NOKERNINFO
+NOSTR
+NOTE_ATTRIB
+NOTE_CHILD
+NOTE_DELETE
+NOTE_EXEC
+NOTE_EXIT
+NOTE_EXTEND
+NOTE_FFAND
+NOTE_FFCOPY
+NOTE_FFCTRLMASK
+NOTE_FFLAGSMASK
+NOTE_FFNOP
+NOTE_FFOR
+NOTE_FORK
+NOTE_LINK
+NOTE_LOWAT
+NOTE_MSECONDS
+NOTE_NSECONDS
+NOTE_PCTRLMASK
+NOTE_PDATAMASK
+NOTE_RENAME
+NOTE_REVOKE
+NOTE_SECONDS
+NOTE_TRACK
+NOTE_TRACKERR
+NOTE_TRIGGER
+NOTE_USECONDS
+NOTE_WRITE
+NTP_API
+OLD_TIME
+ONOEOT
+OXTABS
+O_DIRECT
+O_EXEC
+O_EXLOCK
+O_FSYNC
+O_NDELAY
+O_NOCTTY
+O_SHLOCK
+O_SYNC
+O_TTY_INIT
+PD_ALLOWED_AT_FORK
+PD_CLOEXEC
+PD_DAEMON
+PENDIN
+PF_APPLETALK
+PF_ARP
+PF_ATM
+PF_BLUETOOTH
+PF_CCITT
+PF_CHAOS
+PF_CNT
+PF_COIP
+PF_DATAKIT
+PF_DECnet
+PF_DLI
+PF_ECMA
+PF_HYLINK
+PF_IEEE80211
+PF_IMPLINK
+PF_INET6_SDP
+PF_INET_SDP
+PF_IPX
+PF_ISDN
+PF_ISO
+PF_KEY
+PF_LAT
+PF_LINK
+PF_LOCAL
+PF_NATM
+PF_NETBIOS
+PF_NETGRAPH
+PF_OSI
+PF_PIP
+PF_PUP
+PF_ROUTE
+PF_RTIP
+PF_SCLUSTER
+PF_SIP
+PF_SLOW
+PF_SNA
+PF_XTP
+PIOD_READ_D
+PIOD_READ_I
+PIOD_WRITE_D
+PIOD_WRITE_I
+PIPE_BUF
+PM_STR
+POLLINIGNEOF
+POLLRDBAND
+POLLRDNORM
+POLLSTANDARD
+POLLWRBAND
+POLLWRNORM
+POSIX_FADV_DONTNEED
+POSIX_FADV_NOREUSE
+POSIX_FADV_NORMAL
+POSIX_FADV_RANDOM
+POSIX_FADV_SEQUENTIAL
+POSIX_FADV_WILLNEED
+POSIX_MADV_DONTNEED
+POSIX_MADV_NORMAL
+POSIX_MADV_RANDOM
+POSIX_MADV_SEQUENTIAL
+POSIX_MADV_WILLNEED
+POSIX_SPAWN_RESETIDS
+POSIX_SPAWN_SETPGROUP
+POSIX_SPAWN_SETSCHEDPARAM
+POSIX_SPAWN_SETSCHEDULER
+POSIX_SPAWN_SETSIGDEF
+POSIX_SPAWN_SETSIGMASK
+PPPDISC
+PTHREAD_CREATE_DETACHED
+PTHREAD_CREATE_JOINABLE
+PTHREAD_MUTEX_ADAPTIVE_NP
+PTHREAD_MUTEX_DEFAULT
+PTHREAD_MUTEX_ERRORCHECK
+PTHREAD_PROCESS_PRIVATE
+PTHREAD_PROCESS_SHARED
+PTHREAD_STACK_MIN
+PTRACE_DEFAULT
+PTRACE_EXEC
+PTRACE_FORK
+PTRACE_LWP
+PTRACE_SCE
+PTRACE_SCX
+PTRACE_SYSCALL
+PTRACE_VFORK
+PT_ATTACH
+PT_CLEARSTEP
+PT_CONTINUE
+PT_DETACH
+PT_FIRSTMACH
+PT_FOLLOW_FORK
+PT_GETDBREGS
+PT_GETFPREGS
+PT_GETLWPLIST
+PT_GETNUMLWPS
+PT_GETREGS
+PT_GET_EVENT_MASK
+PT_IO
+PT_KILL
+PT_LWPINFO
+PT_LWP_EVENTS
+PT_READ_D
+PT_READ_I
+PT_RESUME
+PT_SETDBREGS
+PT_SETFPREGS
+PT_SETREGS
+PT_SETSTEP
+PT_SET_EVENT_MASK
+PT_STEP
+PT_SUSPEND
+PT_SYSCALL
+PT_TO_SCE
+PT_TO_SCX
+PT_TRACE_ME
+PT_VM_ENTRY
+PT_VM_TIMESTAMP
+PT_WRITE_D
+PT_WRITE_I
+P_ALL
+P_PGID
+P_PID
+QCMD
+Q_GETQUOTA
+Q_QUOTAOFF
+Q_QUOTAON
+Q_SETQUOTA
+Q_SYNC
+RADIXCHAR
+RAND_MAX
+REG_ASSERT
+REG_ATOI
+REG_BACKR
+REG_BADBR
+REG_BADPAT
+REG_BADRPT
+REG_BASIC
+REG_DUMP
+REG_EBRACE
+REG_EBRACK
+REG_ECOLLATE
+REG_ECTYPE
+REG_EESCAPE
+REG_EMPTY
+REG_ENOSYS
+REG_EPAREN
+REG_ERANGE
+REG_ESPACE
+REG_ESUBREG
+REG_EXTENDED
+REG_ICASE
+REG_ILLSEQ
+REG_INVARG
+REG_ITOA
+REG_LARGE
+REG_NEWLINE
+REG_NOMATCH
+REG_NOSPEC
+REG_NOSUB
+REG_NOTBOL
+REG_NOTEOL
+REG_PEND
+REG_STARTEND
+REG_TRACE
+RLIMIT_AS
+RLIMIT_CORE
+RLIMIT_CPU
+RLIMIT_DATA
+RLIMIT_FSIZE
+RLIMIT_KQUEUES
+RLIMIT_MEMLOCK
+RLIMIT_NOFILE
+RLIMIT_NPROC
+RLIMIT_NPTS
+RLIMIT_RSS
+RLIMIT_SBSIZE
+RLIMIT_STACK
+RLIMIT_SWAP
+RLIMIT_UM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TIOCSETAF
+TIOCSETAW
+TIOCSETD
+TIOCSIG
+TIOCSPGRP
+TIOCSTART
+TIOCSTAT
+TIOCSTI
+TIOCSTOP
+TIOCTIMESTAMP
+TIOCUCNTL
+TMP_MAX
+TTYDISC
+T_FMT
+T_FMT_AMPM
+UF_APPEND
+UF_ARCHIVE
+UF_HIDDEN
+UF_IMMUTABLE
+UF_NODUMP
+UF_NOUNLINK
+UF_OFFLINE
+UF_OPAQUE
+UF_READONLY
+UF_REPARSE
+UF_SETTABLE
+UF_SPARSE
+UF_SYSTEM
+USER_BC_BASE_MAX
+USER_BC_DIM_MAX
+USER_BC_SCALE_MAX
+USER_BC_STRING_MAX
+USER_COLL_WEIGHTS_MAX
+USER_CS_PATH
+USER_EXPR_NEST_MAX
+USER_LINE_MAX
+USER_POSIX2_CHAR_TERM
+USER_POSIX2_C_BIND
+USER_POSIX2_C_DEV
+USER_POSIX2_FORT_DEV
+USER_POSIX2_FORT_RUN
+USER_POSIX2_LOCALEDEF
+USER_POSIX2_SW_DEV
+USER_POSIX2_UPE
+USER_POSIX2_VERSION
+USER_PROCESS
+USER_RE_DUP_MAX
+USER_STREAM_MAX
+USER_TZNAME_MAX
+UTIME_NOW
+UTIME_OMIT
+UTXDB_ACTIVE
+UTXDB_LASTLOGIN
+UTXDB_LOG
+VDSUSP
+VERASE2
+VSTATUS
+WTRAPPED
+XUCRED_VERSION
+XU_NGROUPS
+YESEXPR
+YESSTR
+_IOFBF
+_IOLBF
+_IONBF
+_PC_ACL_EXTENDED
+_PC_ACL_NFS4
+_PC_ACL_PATH_MAX
+_PC_ALLOC_SIZE_MIN
+_PC_ASYNC_IO
+_PC_CAP_PRESENT
+_PC_FILESIZEBITS
+_PC_INF_PRESENT
+_PC_MAC_PRESENT
+_PC_MIN_HOLE_SIZE
+_PC_PRIO_IO
+_PC_REC_INCR_XFER_SIZE
+_PC_REC_MAX_XFER_SIZE
+_PC_REC_MIN_XFER_SIZE
+_PC_REC_XFER_ALIGN
+_PC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SC_SEM_VALUE_MAX
+_SC_SHARED_MEMORY_OBJECTS
+_SC_SHELL
+_SC_SIGQUEUE_MAX
+_SC_SPAWN
+_SC_SPIN_LOCKS
+_SC_SPORADIC_SERVER
+_SC_SYNCHRONIZED_IO
+_SC_THREADS
+_SC_THREAD_ATTR_STACKADDR
+_SC_THREAD_ATTR_STACKSIZE
+_SC_THREAD_DESTRUCTOR_ITERATIONS
+_SC_THREAD_KEYS_MAX
+_SC_THREAD_PRIORITY_SCHEDULING
+_SC_THREAD_PRIO_INHERIT
+_SC_THREAD_PRIO_PROTECT
+_SC_THREAD_PROCESS_SHARED
+_SC_THREAD_SAFE_FUNCTIONS
+_SC_THREAD_SPORADIC_SERVER
+_SC_THREAD_STACK_MIN
+_SC_THREAD_THREADS_MAX
+_SC_TIMEOUTS
+_SC_TIMERS
+_SC_TIMER_MAX
+_SC_TRACE
+_SC_TRACE_EVENT_FILTER
+_SC_TRACE_INHERIT
+_SC_TRACE_LOG
+_SC_TYPED_MEMORY_OBJECTS
+_SC_V6_ILP32_OFF32
+_SC_V6_ILP32_OFFBIG
+_SC_V6_LP64_OFF64
+_SC_V6_LPBIG_OFFBIG
+_SC_XOPEN_CRYPT
+_SC_XOPEN_ENH_I18N
+_SC_XOPEN_LEGACY
+_SC_XOPEN_REALTIME
+_SC_XOPEN_REALTIME_THREADS
+_SC_XOPEN_SHM
+_SC_XOPEN_STREAMS
+_SC_XOPEN_UNIX
+_SC_XOPEN_VERSION
+_SC_XOPEN_XCU_VERSION
+__c_anonymous_cr_pid
+__error
+__xuname
+_sem
+abs
+accept4
+acct
+aio_cancel
+aio_error
+aio_fsync
+aio_read
+aio_return
+aio_suspend
+aio_waitcomplete
+aio_write
+aiocb
+arphdr
+atof
+bpf_dltlist
+bpf_hdr
+bpf_insn
+bpf_program
+bpf_stat
+bpf_version
+bsearch
+cfmakesane
+chflags
+chflagsat
+chroot
+clearerr
+clock_getcpuclockid
+clock_getres
+clock_settime
+cmsgcred
+cmsghdr
+daemon
+difftime
+dirfd
+dl_iterate_phdr
+dl_phdr_info
+dup3
+duplocale
+endgrent
+endpwent
+endservent
+endutxent
+extattr_delete_fd
+extattr_delete_file
+extattr_delete_link
+extattr_get_fd
+extattr_get_file
+extattr_get_link
+extattr_list_fd
+extattr_list_file
+extattr_list_link
+extattr_namespace_to_string
+extattr_set_fd
+extattr_set_file
+extattr_set_link
+extattr_string_to_namespace
+faccessat
+fchdir
+fchflags
+fdatasync
+fdopendir
+fexecve
+fflags_t
+fmemopen
+forkpty
+freeifaddrs
+freelocale
+fsid_t
+fstatfs
+ftok
+futimes
+getdomainname
+getdtablesize
+getgrent
+getgrent_r
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+getifaddrs
+getitimer
+getline
+getloadavg
+getnameinfo
+getpeereid
+getpriority
+getprogname
+getpwent
+getpwent_r
+getpwnam_r
+getrlimit
+getrusage
+getservbyport
+getservent
+getsid
+getutxent
+getutxid
+getutxline
+getutxuser
+glob
+glob_t
+globfree
+iconv
+iconv_close
+iconv_open
+iconv_t
+id_t
+idtype_t
+if_freenameindex
+if_nameindex
+ifaddrs
+in6_pktinfo
+initgroups
+ipc_perm
+jail
+jail_attach
+jail_get
+jail_remove
+jail_set
+kevent
+key_t
+killpg
+kqueue
+labs
+lchflags
+lio_listio
+lockf
+login_tty
+lutimes
+lwpid_t
+madvise
+memmem
+memrchr
+mincore
+mkdirat
+mkfifoat
+mknodat
+mkostemp
+mkostemps
+mkstemps
+mmsghdr
+mq_attr
+mq_close
+mq_getattr
+mq_getfd_np
+mq_notify
+mq_open
+mq_receive
+mq_send
+mq_setattr
+mq_timedreceive
+mq_timedsend
+mq_unlink
+mqd_t
+msgctl
+msgget
+msghdr
+msglen_t
+msgqnum_t
+msgrcv
+msgsnd
+msqid_ds
+newlocale
+nice
+nl_item
+nl_langinfo
+nl_langinfo_l
+nmount
+ntp_adjtime
+ntp_gettime
+ntptimeval
+open_memstream
+open_wmemstream
+openat
+openpty
+pause
+pdfork
+pdgetpid
+pdkill
+pipe2
+popen
+posix_fadvise
+posix_fallocate
+posix_madvise
+posix_spawn
+posix_spawn_file_actions_addclose
+posix_spawn_file_actions_adddup2
+posix_spawn_file_actions_addopen
+posix_spawn_file_actions_destroy
+posix_spawn_file_actions_init
+posix_spawn_file_actions_t
+posix_spawnattr_destroy
+posix_spawnattr_getflags
+posix_spawnattr_getpgroup
+posix_spawnattr_getschedparam
+posix_spawnattr_getschedpolicy
+posix_spawnattr_getsigdefault
+posix_spawnattr_getsigmask
+posix_spawnattr_init
+posix_spawnattr_setflags
+posix_spawnattr_setpgroup
+posix_spawnattr_setschedparam
+posix_spawnattr_setschedpolicy
+posix_spawnattr_setsigdefault
+posix_spawnattr_setsigmask
+posix_spawnattr_t
+posix_spawnp
+ppoll
+preadv
+pseudo_AF_HDRCMPLT
+pseudo_AF_KEY
+pseudo_AF_PIP
+pseudo_AF_RTIP
+pseudo_AF_XTP
+pthread_attr_get_np
+pthread_attr_getguardsize
+pthread_attr_getstack
+pthread_cancel
+pthread_condattr_getclock
+pthread_condattr_getpshared
+pthread_condattr_setclock
+pthread_condattr_setpshared
+pthread_kill
+pthread_main_np
+pthread_mutex_timedlock
+pthread_mutexattr_getpshared
+pthread_mutexattr_setpshared
+pthread_rwlockattr_getpshared
+pthread_rwlockattr_setpshared
+pthread_set_name_np
+ptrace
+ptrace_io_desc
+ptrace_vm_entry
+pututxline
+pwritev
+qsort
+querylocale
+rand
+readdir_r
+readlinkat
+recvmmsg
+recvmsg
+regcomp
+regerror
+regex_t
+regexec
+regfree
+register_t
+regmatch_t
+regoff_t
+rtprio
+rtprio_thread
+sched_getscheduler
+sched_param
+sched_setscheduler
+seekdir
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_timedwait
+sem_unlink
+sendfile
+sendmmsg
+sendmsg
+setdomainname
+setgrent
+setgroups
+sethostname
+setitimer
+setpriority
+setprogname
+setpwent
+setresgid
+setresuid
+setrlimit
+setservent
+settimeofday
+setutxdb
+setutxent
+sf_hdtr
+shmat
+shmctl
+shmdt
+shmget
+shmid_ds
+sigaltstack
+sigevent
+siginfo_t
+sigtimedwait
+sigwait
+sigwaitinfo
+sockaddr_dl
+sockcred
+srand
+stack_t
+statfs
+strcasecmp
+strcasestr
+strncasecmp
+strndup
+strsignal
+sync
+syscall
+sysctl
+sysctlbyname
+sysctlnametomib
+telldir
+timex
+truncate
+ttyname_r
+unmount
+useconds_t
+uselocale
+utimensat
+utmpx
+vm_size_t
+wait4
+waitid
+xucred
diff --git a/libc-test/semver/fuchsia-x86_64.txt b/libc-test/semver/fuchsia-x86_64.txt
new file mode 100644
index 0000000000000..cd3d548ac3c5f
--- /dev/null
+++ b/libc-test/semver/fuchsia-x86_64.txt
@@ -0,0 +1,30 @@
+CS
+DS
+EFLAGS
+ES
+FS
+FS_BASE
+GS
+GS_BASE
+MAP_32BIT
+ORIG_RAX
+R10
+R11
+R12
+R13
+R14
+R15
+R8
+R9
+RAX
+RBP
+RBX
+RCX
+RDI
+RDX
+RIP
+RSI
+RSP
+SS
+mcontext_t
+ucontext_t
diff --git a/libc-test/semver/fuchsia.txt b/libc-test/semver/fuchsia.txt
new file mode 100644
index 0000000000000..837b130ecc2cd
--- /dev/null
+++ b/libc-test/semver/fuchsia.txt
@@ -0,0 +1,1365 @@
+ABDAY_1
+ABDAY_2
+ABDAY_3
+ABDAY_4
+ABDAY_5
+ABDAY_6
+ABDAY_7
+ABMON_1
+ABMON_10
+ABMON_11
+ABMON_12
+ABMON_2
+ABMON_3
+ABMON_4
+ABMON_5
+ABMON_6
+ABMON_7
+ABMON_8
+ABMON_9
+AF_ALG
+AF_APPLETALK
+AF_ASH
+AF_ATMPVC
+AF_ATMSVC
+AF_AX25
+AF_BLUETOOTH
+AF_BRIDGE
+AF_CAIF
+AF_CAN
+AF_DECnet
+AF_ECONET
+AF_IB
+AF_IEEE802154
+AF_IPX
+AF_IRDA
+AF_ISDN
+AF_IUCV
+AF_KEY
+AF_LLC
+AF_LOCAL
+AF_MPLS
+AF_NETBEUI
+AF_NETLINK
+AF_NETROM
+AF_NFC
+AF_PACKET
+AF_PHONET
+AF_PPPOX
+AF_RDS
+AF_ROSE
+AF_ROUTE
+AF_RXRPC
+AF_SECURITY
+AF_SNA
+AF_TIPC
+AF_VSOCK
+AF_WANPIPE
+AF_X25
+AIO_ALLDONE
+AIO_CANCELED
+AIO_NOTCANCELED
+AI_ADDRCONFIG
+AI_ALL
+AI_CANONNAME
+AI_NUMERICHOST
+AI_NUMERICSERV
+AI_PASSIVE
+AI_V4MAPPED
+ALT_DIGITS
+AM_STR
+AT_EACCESS
+AT_EMPTY_PATH
+AT_FDCWD
+AT_NO_AUTOMOUNT
+AT_REMOVEDIR
+AT_SYMLINK_FOLLOW
+AT_SYMLINK_NOFOLLOW
+B1000000
+B1152000
+B1500000
+B2000000
+B2500000
+B3000000
+B3500000
+B4000000
+B460800
+B500000
+B576000
+B921600
+BS0
+BS1
+BSDLY
+BUFSIZ
+CBAUD
+CBAUDEX
+CIBAUD
+CLD_CONTINUED
+CLD_DUMPED
+CLD_EXITED
+CLD_KILLED
+CLD_STOPPED
+CLD_TRAPPED
+CLOCK_BOOTTIME
+CLOCK_BOOTTIME_ALARM
+CLOCK_MONOTONIC_COARSE
+CLOCK_MONOTONIC_RAW
+CLOCK_PROCESS_CPUTIME_ID
+CLOCK_REALTIME_ALARM
+CLOCK_REALTIME_COARSE
+CLOCK_SGI_CYCLE
+CLOCK_TAI
+CLOCK_THREAD_CPUTIME_ID
+CLONE_CHILD_CLEARTID
+CLONE_CHILD_SETTID
+CLONE_DETACHED
+CLONE_FILES
+CLONE_FS
+CLONE_IO
+CLONE_NEWCGROUP
+CLONE_NEWIPC
+CLONE_NEWNET
+CLONE_NEWNS
+CLONE_NEWPID
+CLONE_NEWUSER
+CLONE_NEWUTS
+CLONE_PARENT
+CLONE_PARENT_SETTID
+CLONE_PTRACE
+CLONE_SETTLS
+CLONE_SIGHAND
+CLONE_SYSVS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LOEXEC
+EPOLL_CTL_ADD
+EPOLL_CTL_DEL
+EPOLL_CTL_MOD
+ERA
+ERA_D_FMT
+ERA_D_T_FMT
+ERA_T_FMT
+EREMCHG
+EREMOTEIO
+ERESTART
+ERFKILL
+ESRMNT
+ESTRPIPE
+ETIME
+EUCLEAN
+EUNATCH
+EXFULL
+EXTA
+EXTB
+EXTPROC
+Elf32_Addr
+Elf32_Half
+Elf32_Off
+Elf32_Phdr
+Elf32_Word
+Elf64_Addr
+Elf64_Half
+Elf64_Off
+Elf64_Phdr
+Elf64_Word
+Elf64_Xword
+FALLOC_FL_COLLAPSE_RANGE
+FALLOC_FL_INSERT_RANGE
+FALLOC_FL_KEEP_SIZE
+FALLOC_FL_PUNCH_HOLE
+FALLOC_FL_UNSHARE_RANGE
+FALLOC_FL_ZERO_RANGE
+FF0
+FF1
+FFDLY
+FILENAME_MAX
+FIONREAD
+FLUSHO
+FOPEN_MAX
+F_ADD_SEALS
+F_CANCELLK
+F_GETLEASE
+F_GETOWN
+F_GETPIPE_SZ
+F_GET_SEALS
+F_LOCK
+F_NOTIFY
+F_SEAL_GROW
+F_SEAL_SEAL
+F_SEAL_SHRINK
+F_SEAL_WRITE
+F_SETLEASE
+F_SETOWN
+F_SETPIPE_SZ
+F_TEST
+F_TLOCK
+F_ULOCK
+GLOB_ABORTED
+GLOB_APPEND
+GLOB_DOOFFS
+GLOB_ERR
+GLOB_MARK
+GLOB_NOCHECK
+GLOB_NOESCAPE
+GLOB_NOMATCH
+GLOB_NOSORT
+GLOB_NOSPACE
+IFF_ALLMULTI
+IFF_AUTOMEDIA
+IFF_BROADCAST
+IFF_DEBUG
+IFF_DORMANT
+IFF_DYNAMIC
+IFF_ECHO
+IFF_LOOPBACK
+IFF_LOWER_UP
+IFF_MASTER
+IFF_MULTICAST
+IFF_NOARP
+IFF_NOTRAILERS
+IFF_NO_PI
+IFF_POINTOPOINT
+IFF_PORTSEL
+IFF_PROMISC
+IFF_RUNNING
+IFF_SLAVE
+IFF_TAP
+IFF_TUN
+IFF_UP
+IPC_CREAT
+IPC_EXCL
+IPC_INFO
+IPC_NOWAIT
+IPC_PRIVATE
+IPC_RMID
+IPC_SET
+IPC_STAT
+IPPROTO_AH
+IPPROTO_BEETPH
+IPPROTO_COMP
+IPPROTO_DCCP
+IPPROTO_DSTOPTS
+IPPROTO_EGP
+IPPROTO_ENCAP
+IPPROTO_ESP
+IPPROTO_FRAGMENT
+IPPROTO_GRE
+IPPROTO_HOPOPTS
+IPPROTO_IDP
+IPPROTO_IGMP
+IPPROTO_IPIP
+IPPROTO_MAX
+IPPROTO_MH
+IPPROTO_MPLS
+IPPROTO_MTP
+IPPROTO_NONE
+IPPROTO_PIM
+IPPROTO_PUP
+IPPROTO_RAW
+IPPROTO_ROUTING
+IPPROTO_RSVP
+IPPROTO_SCTP
+IPPROTO_TP
+IPPROTO_UDPLITE
+IPV6_ADD_MEMBERSHIP
+IPV6_DROP_MEMBERSHIP
+IP_FREEBIND
+IP_HDRINCL
+IP_TRANSPARENT
+ITIMER_PROF
+ITIMER_REAL
+ITIMER_VIRTUAL
+IUTF8
+LC_ALL
+LC_COLLATE
+LC_COLLATE_MASK
+LC_CTYPE
+LC_CTYPE_MASK
+LC_MESSAGES
+LC_MESSAGES_MASK
+LC_MONETARY
+LC_MONETARY_MASK
+LC_NUMERIC
+LC_NUMERIC_MASK
+LC_TIME
+LC_TIME_MASK
+LIO_NOP
+LIO_NOWAIT
+LIO_READ
+LIO_WAIT
+LIO_WRITE
+LOG_AUTHPRIV
+LOG_CRON
+LOG_FTP
+LOG_NFACILITIES
+LOG_PERROR
+L_tmpnam
+MADV_DODUMP
+MADV_DOFORK
+MADV_DONTDUMP
+MADV_DONTFORK
+MADV_DONTNEED
+MADV_FREE
+MADV_HUGEPAGE
+MADV_HWPOISON
+MADV_MERGEABLE
+MADV_NOHUGEPAGE
+MADV_NORMAL
+MADV_RANDOM
+MADV_REMOVE
+MADV_SEQUENTIAL
+MADV_SOFT_OFFLINE
+MADV_UNMERGEABLE
+MADV_WILLNEED
+MAP_DENYWRITE
+MAP_EXECUTABLE
+MAP_FILE
+MAP_GROWSDOWN
+MAP_HUGETLB
+MAP_LOCKED
+MAP_NONBLOCK
+MAP_NORESERVE
+MAP_POPULATE
+MAP_STACK
+MAP_TYPE
+MCL_CURRENT
+MCL_FUTURE
+MFD_ALLOW_SEALING
+MFD_CLOEXEC
+MINSIGSTKSZ
+MNT_DETACH
+MNT_EXPIRE
+MNT_FORCE
+MON_1
+MON_10
+MON_11
+MON_12
+MON_2
+MON_3
+MON_4
+MON_5
+MON_6
+MON_7
+MON_8
+MON_9
+MREMAP_FIXED
+MREMAP_MAYMOVE
+MSG_CMSG_CLOEXEC
+MSG_CONFIRM
+MSG_COPY
+MSG_DONTWAIT
+MSG_ERRQUEUE
+MSG_EXCEPT
+MSG_FASTOPEN
+MSG_FIN
+MSG_INFO
+MSG_MORE
+MSG_NOERROR
+MSG_NOSIGNAL
+MSG_RST
+MSG_STAT
+MSG_SYN
+MSG_WAITFORONE
+MS_ACTIVE
+MS_BIND
+MS_DIRSYNC
+MS_I_VERSION
+MS_KERNMOUNT
+MS_MANDLOCK
+MS_MGC_MSK
+MS_MGC_VAL
+MS_MOVE
+MS_NOATIME
+MS_NODEV
+MS_NODIRATIME
+MS_NOEXEC
+MS_NOSUID
+MS_NOUSER
+MS_POSIXACL
+MS_PRIVATE
+MS_RDONLY
+MS_REC
+MS_RELATIME
+MS_REMOUNT
+MS_RMT_MASK
+MS_SHARED
+MS_SILENT
+MS_SLAVE
+MS_STRICTATIME
+MS_SYNCHRONOUS
+MS_UNBINDABLE
+NI_DGRAM
+NI_NAMEREQD
+NI_NOFQDN
+NI_NUMERICHOST
+NI_NUMERICSERV
+NL0
+NL1
+NLDLY
+NOEXPR
+NOSTR
+OFDEL
+OFILL
+OLCUC
+O_DIRECT
+O_DSYNC
+O_EXEC
+O_LARGEFILE
+O_NDELAY
+O_NOATIME
+O_NOCTTY
+O_PATH
+O_RSYNC
+O_SEARCH
+O_SYNC
+O_TMPFILE
+PENDIN
+PF_ALG
+PF_APPLETALK
+PF_ASH
+PF_ATMPVC
+PF_ATMSVC
+PF_AX25
+PF_BLUETOOTH
+PF_BRIDGE
+PF_CAIF
+PF_CAN
+PF_DECnet
+PF_ECONET
+PF_IB
+PF_IEEE802154
+PF_IPX
+PF_IRDA
+PF_ISDN
+PF_IUCV
+PF_KEY
+PF_LLC
+PF_LOCAL
+PF_MPLS
+PF_NETBEUI
+PF_NETLINK
+PF_NETROM
+PF_NFC
+PF_PACKET
+PF_PHONET
+PF_PPPOX
+PF_RDS
+PF_ROSE
+PF_ROUTE
+PF_RXRPC
+PF_SECURITY
+PF_SNA
+PF_TIPC
+PF_VSOCK
+PF_WANPIPE
+PF_X25
+PIPE_BUF
+PM_STR
+POLLRDBAND
+POLLRDNORM
+POLLWRBAND
+POLLWRNORM
+POSIX_FADV_DONTNEED
+POSIX_FADV_NOREUSE
+POSIX_FADV_NORMAL
+POSIX_FADV_RANDOM
+POSIX_FADV_SEQUENTIAL
+POSIX_FADV_WILLNEED
+POSIX_MADV_DONTNEED
+POSIX_MADV_NORMAL
+POSIX_MADV_RANDOM
+POSIX_MADV_SEQUENTIAL
+POSIX_MADV_WILLNEED
+PROT_GROWSDOWN
+PROT_GROWSUP
+PR_CAPBSET_DROP
+PR_CAPBSET_READ
+PR_CAP_AMBIENT
+PR_CAP_AMBIENT_CLEAR_ALL
+PR_CAP_AMBIENT_IS_SET
+PR_CAP_AMBIENT_LOWER
+PR_CAP_AMBIENT_RAISE
+PR_ENDIAN_BIG
+PR_ENDIAN_LITTLE
+PR_ENDIAN_PPC_LITTLE
+PR_FPEMU_NOPRINT
+PR_FPEMU_SIGFPE
+PR_FP_EXC_ASYNC
+PR_FP_EXC_DISABLED
+PR_FP_EXC_DIV
+PR_FP_EXC_INV
+PR_FP_EXC_NONRECOV
+PR_FP_EXC_OVF
+PR_FP_EXC_PRECISE
+PR_FP_EXC_RES
+PR_FP_EXC_SW_ENABLE
+PR_FP_EXC_UND
+PR_FP_MODE_FR
+PR_FP_MODE_FRE
+PR_GET_CHILD_SUBREAPER
+PR_GET_DUMPABLE
+PR_GET_ENDIAN
+PR_GET_FPEMU
+PR_GET_FPEXC
+PR_GET_FP_MODE
+PR_GET_KEEPCAPS
+PR_GET_NAME
+PR_GET_NO_NEW_PRIVS
+PR_GET_PDEATHSIG
+PR_GET_SECCOMP
+PR_GET_SECUREBITS
+PR_GET_THP_DISABLE
+PR_GET_TID_ADDRESS
+PR_GET_TIMERSLACK
+PR_GET_TIMING
+PR_GET_TSC
+PR_GET_UNALIGN
+PR_MCE_KILL
+PR_MCE_KILL_CLEAR
+PR_MCE_KILL_DEFAULT
+PR_MCE_KILL_EARLY
+PR_MCE_KILL_GET
+PR_MCE_KILL_LATE
+PR_MCE_KILL_SET
+PR_MPX_DISABLE_MANAGEMENT
+PR_MPX_ENABLE_MANAGEMENT
+PR_SET_CHILD_SUBREAPER
+PR_SET_DUMPABLE
+PR_SET_ENDIAN
+PR_SET_FPEMU
+PR_SET_FPEXC
+PR_SET_FP_MODE
+PR_SET_KEEPCAPS
+PR_SET_MM
+PR_SET_MM_ARG_END
+PR_SET_MM_ARG_START
+PR_SET_MM_AUXV
+PR_SET_MM_BRK
+PR_SET_MM_END_CODE
+PR_SET_MM_END_DATA
+PR_SET_MM_ENV_END
+PR_SET_MM_ENV_START
+PR_SET_MM_EXE_FILE
+PR_SET_MM_MAP
+PR_SET_MM_MAP_SIZE
+PR_SET_MM_START_BRK
+PR_SET_MM_START_CODE
+PR_SET_MM_START_DATA
+PR_SET_MM_START_STACK
+PR_SET_NAME
+PR_SET_NO_NEW_PRIVS
+PR_SET_PDEATHSIG
+PR_SET_PTRACER
+PR_SET_SECCOMP
+PR_SET_SECUREBITS
+PR_SET_THP_DISABLE
+PR_SET_TIMERSLACK
+PR_SET_TIMING
+PR_SET_TSC
+PR_SET_UNALIGN
+PR_TASK_PERF_EVENTS_DISABLE
+PR_TASK_PERF_EVENTS_ENABLE
+PR_TIMING_STATISTICAL
+PR_TIMING_TIMESTAMP
+PR_TSC_ENABLE
+PR_TSC_SIGSEGV
+PR_UNALIGN_NOPRINT
+PR_UNALIGN_SIGBUS
+PTHREAD_CREATE_DETACHED
+PTHREAD_CREATE_JOINABLE
+PTHREAD_MUTEX_DEFAULT
+PTHREAD_MUTEX_ERRORCHECK
+PTHREAD_PROCESS_PRIVATE
+PTHREAD_PROCESS_SHARED
+PTHREAD_STACK_MIN
+PTRACE_ATTACH
+PTRACE_CONT
+PTRACE_DETACH
+PTRACE_EVENT_CLONE
+PTRACE_EVENT_EXEC
+PTRACE_EVENT_EXIT
+PTRACE_EVENT_FORK
+PTRACE_EVENT_SECCOMP
+PTRACE_EVENT_VFORK
+PTRACE_EVENT_VFORK_DONE
+PTRACE_GETEVENTMSG
+PTRACE_GETFPREGS
+PTRACE_GETFPXREGS
+PTRACE_GETREGS
+PTRACE_GETREGSET
+PTRACE_GETSIGINFO
+PTRACE_INTERRUPT
+PTRACE_KILL
+PTRACE_LISTEN
+PTRACE_O_EXITKILL
+PTRACE_O_MASK
+PTRACE_O_SUSPEND_SECCOMP
+PTRACE_O_TRACECLONE
+PTRACE_O_TRACEEXEC
+PTRACE_O_TRACEEXIT
+PTRACE_O_TRACEFORK
+PTRACE_O_TRACESECCOMP
+PTRACE_O_TRACESYSGOOD
+PTRACE_O_TRACEVFORK
+PTRACE_O_TRACEVFORKDONE
+PTRACE_PEEKDATA
+PTRACE_PEEKSIGINFO
+PTRACE_PEEKTEXT
+PTRACE_PEEKUSER
+PTRACE_POKEDATA
+PTRACE_POKETEXT
+PTRACE_POKEUSER
+PTRACE_SEIZE
+PTRACE_SETFPREGS
+PTRACE_SETFPXREGS
+PTRACE_SETOPTIONS
+PTRACE_SETREGS
+PTRACE_SETREGSET
+PTRACE_SETSIGINFO
+PTRACE_SINGLESTEP
+PTRACE_SYSCALL
+PTRACE_TRACEME
+PT_DYNAMIC
+PT_GNU_EH_FRAME
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ALUE_MAX
+_SC_SHARED_MEMORY_OBJECTS
+_SC_SHELL
+_SC_SIGQUEUE_MAX
+_SC_SPAWN
+_SC_SPIN_LOCKS
+_SC_SPORADIC_SERVER
+_SC_SS_REPL_MAX
+_SC_STREAMS
+_SC_SYNCHRONIZED_IO
+_SC_THREADS
+_SC_THREAD_ATTR_STACKADDR
+_SC_THREAD_ATTR_STACKSIZE
+_SC_THREAD_CPUTIME
+_SC_THREAD_DESTRUCTOR_ITERATIONS
+_SC_THREAD_KEYS_MAX
+_SC_THREAD_PRIORITY_SCHEDULING
+_SC_THREAD_PRIO_INHERIT
+_SC_THREAD_PRIO_PROTECT
+_SC_THREAD_PROCESS_SHARED
+_SC_THREAD_ROBUST_PRIO_INHERIT
+_SC_THREAD_ROBUST_PRIO_PROTECT
+_SC_THREAD_SAFE_FUNCTIONS
+_SC_THREAD_SPORADIC_SERVER
+_SC_THREAD_STACK_MIN
+_SC_THREAD_THREADS_MAX
+_SC_TIMEOUTS
+_SC_TIMERS
+_SC_TIMER_MAX
+_SC_TRACE
+_SC_TRACE_EVENT_FILTER
+_SC_TRACE_EVENT_NAME_MAX
+_SC_TRACE_INHERIT
+_SC_TRACE_LOG
+_SC_TRACE_NAME_MAX
+_SC_TRACE_SYS_MAX
+_SC_TRACE_USER_EVENT_MAX
+_SC_TYPED_MEMORY_OBJECTS
+_SC_UIO_MAXIOV
+_SC_V6_ILP32_OFF32
+_SC_V6_ILP32_OFFBIG
+_SC_V6_LP64_OFF64
+_SC_V6_LPBIG_OFFBIG
+_SC_V7_ILP32_OFF32
+_SC_V7_ILP32_OFFBIG
+_SC_V7_LP64_OFF64
+_SC_V7_LPBIG_OFFBIG
+_SC_XBS5_ILP32_OFF32
+_SC_XBS5_ILP32_OFFBIG
+_SC_XBS5_LP64_OFF64
+_SC_XBS5_LPBIG_OFFBIG
+_SC_XOPEN_CRYPT
+_SC_XOPEN_ENH_I18N
+_SC_XOPEN_LEGACY
+_SC_XOPEN_REALTIME
+_SC_XOPEN_REALTIME_THREADS
+_SC_XOPEN_SHM
+_SC_XOPEN_STREAMS
+_SC_XOPEN_UNIX
+_SC_XOPEN_VERSION
+_SC_XOPEN_XCU_VERSION
+_SC_XOPEN_XPG2
+_SC_XOPEN_XPG3
+_SC_XOPEN_XPG4
+__SIZEOF_PTHREAD_CONDATTR_T
+__SIZEOF_PTHREAD_COND_T
+__SIZEOF_PTHREAD_MUTEXATTR_T
+__SIZEOF_PTHREAD_MUTEX_T
+__SIZEOF_PTHREAD_RWLOCKATTR_T
+__SIZEOF_PTHREAD_RWLOCK_T
+__WALL
+__WCLONE
+__WNOTHREAD
+__errno_location
+__s16
+__s32
+__u16
+__u32
+__u64
+__u8
+abs
+accept4
+acct
+aiocb
+atof
+blkcnt64_t
+brk
+clearenv
+clock_getres
+clock_nanosleep
+clock_settime
+clone
+cmsghdr
+cpu_set_t
+daemon
+dirent64
+dirfd
+dl_iterate_phdr
+dl_phdr_info
+dqblk
+dup3
+duplocale
+endpwent
+epoll_event
+eventfd
+execvpe
+faccessat
+fallocate
+fdatasync
+fdopendir
+fexecve
+ff_condition_effect
+ff_constant_effect
+ff_effect
+ff_envelope
+ff_periodic_effect
+ff_ramp_effect
+ff_replay
+ff_rumble_effect
+ff_trigger
+fpos64_t
+freeifaddrs
+freelocale
+fsid_t
+fstatfs
+ftok
+futimes
+getdomainname
+getdtablesize
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+getifaddrs
+getnameinfo
+getpwent
+getpwnam_r
+getresgid
+getresuid
+getsid
+glob
+glob_t
+globfree
+id_t
+idtype_t
+if_freenameindex
+if_nameindex
+ifaddrs
+initgroups
+ino64_t
+input_absinfo
+input_event
+input_id
+input_keymap_entry
+input_mask
+ip_mreqn
+ipc_perm
+itimerspec
+key_t
+labs
+loff_t
+lutimes
+madvise
+major
+makedev
+memalign
+memrchr
+minor
+mkdirat
+mkfifoat
+mknodat
+mkostemp
+mkostemps
+mkstemps
+mmsghdr
+mount
+mq_attr
+mqd_t
+msgctl
+msgget
+msghdr
+msginfo
+msglen_t
+msgqnum_t
+msgrcv
+msgsnd
+msqid_ds
+newlocale
+nl_item
+nl_langinfo
+nl_langinfo_l
+off64_t
+openat
+openpty
+pause
+personality
+pipe2
+popen
+posix_fadvise
+posix_fallocate
+posix_madvise
+ppoll
+preadv
+pthread_attr_getguardsize
+pthread_attr_getstack
+pthread_cancel
+pthread_condattr_getclock
+pthread_condattr_setclock
+pthread_getattr_np
+pthread_kill
+pthread_mutex_timedlock
+ptsname_r
+pwritev
+quotactl
+rand
+readahead
+readdir_r
+readlinkat
+reboot
+recvmmsg
+recvmsg
+rlim64_t
+rlimit64
+sched_get_priority_max
+sched_get_priority_min
+sched_getaffinity
+sched_getparam
+sched_getscheduler
+sched_param
+sched_rr_get_interval
+sched_setaffinity
+sched_setparam
+sched_setscheduler
+seekdir
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_timedwait
+sem_unlink
+sembuf
+semctl
+semget
+semop
+sendmmsg
+sendmsg
+setdomainname
+setfsgid
+setfsuid
+setgroups
+sethostname
+setpwent
+setregid
+setresgid
+setresuid
+setreuid
+settimeofday
+shmat
+shmatt_t
+shmctl
+shmdt
+shmget
+shmid_ds
+sigaltstack
+sigevent
+siginfo_t
+signalfd
+signalfd_siginfo
+sigsuspend
+sigtimedwait
+sigwait
+sigwaitinfo
+sockaddr_ll
+sockaddr_nl
+splice
+spwd
+srand
+stack_t
+stat64
+statfs
+statfs64
+statvfs64
+swapoff
+swapon
+sync
+sync_file_range
+syscall
+sysinfo
+tee
+telldir
+termios2
+timerfd_create
+timerfd_gettime
+timerfd_settime
+ucred
+umount
+umount2
+useconds_t
+uselocale
+utimensat
+vhangup
+vmsplice
+waitid
diff --git a/libc-test/semver/ios.txt b/libc-test/semver/ios.txt
new file mode 100644
index 0000000000000..1a5fcd2ac3fe2
--- /dev/null
+++ b/libc-test/semver/ios.txt
@@ -0,0 +1,3 @@
+__darwin_arm_exception_state64
+__darwin_arm_neon_state64
+__darwin_arm_thread_state64
diff --git a/libc-test/semver/linux-aarch64.txt b/libc-test/semver/linux-aarch64.txt
new file mode 100644
index 0000000000000..cec47c02bd6c5
--- /dev/null
+++ b/libc-test/semver/linux-aarch64.txt
@@ -0,0 +1,39 @@
+B2500000
+B3000000
+B3500000
+B4000000
+CIBAUD
+MADV_SOFT_OFFLINE
+MAP_SYNC
+SIGSTKFLT
+SIGUNUSED
+SO_PRIORITY
+SO_PROTOCOL
+SYS_accept
+SYS_msgctl
+SYS_msgget
+SYS_msgrcv
+SYS_msgsnd
+SYS_newfstatat
+SYS_pkey_alloc
+SYS_pkey_free
+SYS_pkey_mprotect
+SYS_renameat
+SYS_semctl
+SYS_semget
+SYS_semop
+SYS_semtimedop
+SYS_shmat
+SYS_shmctl
+SYS_shmdt
+SYS_shmget
+SYS_sync_file_range
+TIOCCBRK
+TIOCGRS485
+TIOCSBRK
+TIOCSRS485
+flock64
+ip_mreqn
+max_align_t
+mcontext_t
+ucontext_t
diff --git a/libc-test/semver/linux-gnu-x86_64.txt b/libc-test/semver/linux-gnu-x86_64.txt
new file mode 100644
index 0000000000000..5d679db305b17
--- /dev/null
+++ b/libc-test/semver/linux-gnu-x86_64.txt
@@ -0,0 +1,29 @@
+BOTHER
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+NFT_MSG_DELOBJ
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_NEWOBJ
+PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+PTRACE_SYSEMU
+PTRACE_SYSEMU_SINGLESTEP
+_libc_fpstate
+flock64
+getcontext
+makecontext
+setcontext
+swapcontext
+termios2
diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt
new file mode 100644
index 0000000000000..ec686e815f501
--- /dev/null
+++ b/libc-test/semver/linux-gnu.txt
@@ -0,0 +1,575 @@
+ACCOUNTING
+ADFS_SUPER_MAGIC
+ADJ_ESTERROR
+ADJ_FREQUENCY
+ADJ_MAXERROR
+ADJ_MICRO
+ADJ_NANO
+ADJ_OFFSET
+ADJ_OFFSET_SINGLESHOT
+ADJ_OFFSET_SS_READ
+ADJ_SETOFFSET
+ADJ_STATUS
+ADJ_TAI
+ADJ_TICK
+ADJ_TIMECONST
+AFFS_SUPER_MAGIC
+AFS_SUPER_MAGIC
+AT_STATX_DONT_SYNC
+AT_STATX_FORCE_SYNC
+AT_STATX_SYNC_AS_STAT
+AT_STATX_SYNC_TYPE
+AUTOFS_SUPER_MAGIC
+BINDERFS_SUPER_MAGIC
+BOOT_TIME
+BPF_FS_MAGIC
+BTRFS_SUPER_MAGIC
+CGROUP2_SUPER_MAGIC
+CGROUP_SUPER_MAGIC
+CODA_SUPER_MAGIC
+CRAMFS_MAGIC
+DCCP_SERVICE_LIST_MAX_LEN
+DCCP_SOCKOPT_AVAILABLE_CCIDS
+DCCP_SOCKOPT_CCID
+DCCP_SOCKOPT_CCID_RX_INFO
+DCCP_SOCKOPT_CCID_TX_INFO
+DCCP_SOCKOPT_CHANGE_L
+DCCP_SOCKOPT_CHANGE_R
+DCCP_SOCKOPT_GET_CUR_MPS
+DCCP_SOCKOPT_PACKET_SIZE
+DCCP_SOCKOPT_QPOLICY_ID
+DCCP_SOCKOPT_QPOLICY_TXQLEN
+DCCP_SOCKOPT_RECV_CSCOV
+DCCP_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S_DECRYPT
+KEYCTL_SUPPORTS_ENCRYPT
+KEYCTL_SUPPORTS_SIGN
+KEYCTL_SUPPORTS_VERIFY
+LC_ADDRESS
+LC_ADDRESS_MASK
+LC_ALL
+LC_ALL_MASK
+LC_IDENTIFICATION
+LC_IDENTIFICATION_MASK
+LC_MEASUREMENT
+LC_MEASUREMENT_MASK
+LC_NAME
+LC_NAME_MASK
+LC_PAPER
+LC_PAPER_MASK
+LC_TELEPHONE
+LC_TELEPHONE_MASK
+LM_ID_BASE
+LM_ID_NEWLM
+LOGIN_PROCESS
+Lmid_t
+MAXTC
+MAX_LINKS
+MINIX2_SUPER_MAGIC
+MINIX2_SUPER_MAGIC2
+MINIX3_SUPER_MAGIC
+MINIX_SUPER_MAGIC
+MINIX_SUPER_MAGIC2
+MOD_CLKA
+MOD_CLKB
+MOD_ESTERROR
+MOD_FREQUENCY
+MOD_MAXERROR
+MOD_MICRO
+MOD_NANO
+MOD_OFFSET
+MOD_STATUS
+MOD_TAI
+MOD_TIMECONST
+MSDOS_SUPER_MAGIC
+MSG_TRYHARD
+MS_RELATIME
+M_ARENA_MAX
+M_ARENA_TEST
+M_CHECK_ACTION
+M_GRAIN
+M_KEEP
+M_MMAP_MAX
+M_MMAP_THRESHOLD
+M_MXFAST
+M_NLBLKS
+M_PERTURB
+M_TOP_PAD
+M_TRIM_THRESHOLD
+NCP_SUPER_MAGIC
+NDA_LINK_NETNSID
+NDA_LLADDR
+NDA_MASTER
+NDA_SRC_VNI
+NEW_TIME
+NFPROTO_INET
+NFPROTO_NETDEV
+NFS_SUPER_MAGIC
+NFT_BREAK
+NFT_BYTEORDER_HTON
+NFT_BYTEORDER_NTOH
+NFT_CHAIN_MAXNAMELEN
+NFT_CMP_EQ
+NFT_CMP_GT
+NFT_CMP_GTE
+NFT_CMP_LT
+NFT_CMP_LTE
+NFT_CMP_NEQ
+NFT_CONTINUE
+NFT_CT_BYTES
+NFT_CT_DIRECTION
+NFT_CT_DST
+NFT_CT_EXPIRATION
+NFT_CT_HELPER
+NFT_CT_L3PROTOCOL
+NFT_CT_LABELS
+NFT_CT_MARK
+NFT_CT_PKTS
+NFT_CT_PROTOCOL
+NFT_CT_PROTO_DST
+NFT_CT_PROTO_SRC
+NFT_CT_SECMARK
+NFT_CT_SRC
+NFT_CT_STATE
+NFT_CT_STATUS
+NFT_DATA_RESERVED_MASK
+NFT_DATA_VALUE
+NFT_DATA_VALUE_MAXLEN
+NFT_DATA_VERDICT
+NFT_DYNSET_F_INV
+NFT_DYNSET_OP_ADD
+NFT_DYNSET_OP_UPDATE
+NFT_GOTO
+NFT_JUMP
+NFT_LIMIT_F_INV
+NFT_LIMIT_PKTS
+NFT_LIMIT_PKT_BYTES
+NFT_LOOKUP_F_INV
+NFT_META_BRI_IIFNAME
+NFT_META_BRI_OIFNAME
+NFT_META_CGROUP
+NFT_META_CPU
+NFT_META_IIF
+NFT_META_IIFGROUP
+NFT_META_IIFNAME
+NFT_META_IIFTYPE
+NFT_META_L4PROTO
+NFT_META_LEN
+NFT_META_MARK
+NFT_META_NFPROTO
+NFT_META_NFTRACE
+NFT_META_OIF
+NFT_META_OIFGROUP
+NFT_META_OIFNAME
+NFT_META_OIFTYPE
+NFT_META_PKTTYPE
+NFT_META_PRANDOM
+NFT_META_PRIORITY
+NFT_META_PROTOCOL
+NFT_META_RTCLASSID
+NFT_META_SECMARK
+NFT_META_SKGID
+NFT_META_SKUID
+NFT_MSG_DELCHAIN
+NFT_MSG_DELRULE
+NFT_MSG_DELSET
+NFT_MSG_DELSETELEM
+NFT_MSG_DELTABLE
+NFT_MSG_GETCHAIN
+NFT_MSG_GETGEN
+NFT_MSG_GETRULE
+NFT_MSG_GETSET
+NFT_MSG_GETSETELEM
+NFT_MSG_GETTABLE
+NFT_MSG_MAX
+NFT_MSG_NEWCHAIN
+NFT_MSG_NEWGEN
+NFT_MSG_NEWRULE
+NFT_MSG_NEWSET
+NFT_MSG_NEWSETELEM
+NFT_MSG_NEWTABLE
+NFT_MSG_TRACE
+NFT_NAT_DNAT
+NFT_NAT_SNAT
+NFT_NG_INCREMENTAL
+NFT_NG_RANDOM
+NFT_OBJ_MAXNAMELEN
+NFT_PAYLOAD_CSUM_INET
+NFT_PAYLOAD_CSUM_NONE
+NFT_PAYLOAD_LL_HEADER
+NFT_PAYLOAD_NETWORK_HEADER
+NFT_PAYLOAD_TRANSPORT_HEADER
+NFT_QUEUE_FLAG_BYPASS
+NFT_QUEUE_FLAG_CPU_FANOUT
+NFT_QUEUE_FLAG_MASK
+NFT_QUOTA_F_INV
+NFT_RANGE_EQ
+NFT_RANGE_NEQ
+NFT_REG32_00
+NFT_REG32_01
+NFT_REG32_02
+NFT_REG32_03
+NFT_REG32_04
+NFT_REG32_05
+NFT_REG32_06
+NFT_REG32_07
+NFT_REG32_08
+NFT_REG32_09
+NFT_REG32_10
+NFT_REG32_11
+NFT_REG32_12
+NFT_REG32_13
+NFT_REG32_14
+NFT_REG32_15
+NFT_REG32_SIZE
+NFT_REG_1
+NFT_REG_2
+NFT_REG_3
+NFT_REG_4
+NFT_REG_SIZE
+NFT_REG_VERDICT
+NFT_REJECT_ICMPX_ADMIN_PROHIBITED
+NFT_REJECT_ICMPX_HOST_UNREACH
+NFT_REJECT_ICMPX_NO_ROUTE
+NFT_REJECT_ICMPX_PORT_UNREACH
+NFT_REJECT_ICMPX_UNREACH
+NFT_REJECT_ICMP_UNREACH
+NFT_REJECT_TCP_RST
+NFT_RETURN
+NFT_SET_ANONYMOUS
+NFT_SET_CONSTANT
+NFT_SET_ELEM_INTERVAL_END
+NFT_SET_EVAL
+NFT_SET_INTERVAL
+NFT_SET_MAP
+NFT_SET_MAXNAMELEN
+NFT_SET_POL_MEMORY
+NFT_SET_POL_PERFORMANCE
+NFT_SET_TIMEOUT
+NFT_TABLE_MAXNAMELEN
+NFT_TRACETYPE_POLICY
+NFT_TRACETYPE_RETURN
+NFT_TRACETYPE_RULE
+NFT_TRACETYPE_UNSPEC
+NFT_USERDATA_MAXLEN
+NF_NETDEV_INGRESS
+NF_NETDEV_NUMHOOKS
+NILFS_SUPER_MAGIC
+NTF_EXT_LEARNED
+NTF_MASTER
+NTF_OFFLOADED
+NTP_API
+OCFS2_SUPER_MAGIC
+OLD_TIME
+OPENPROM_SUPER_MAGIC
+OVERLAYFS_SUPER_MAGIC
+O_FSYNC
+PROC_SUPER_MAGIC
+PTHREAD_MUTEX_ADAPTIVE_NP
+QNX4_SUPER_MAGIC
+QNX6_SUPER_MAGIC
+RDTGROUP_SUPER_MAGIC
+REG_EEND
+REG_ERPAREN
+REG_ESIZE
+REG_STARTEND
+REISERFS_SUPER_MAGIC
+RTA_NEWDST
+RTA_OIF
+RTA_PAD
+RTA_PREF
+RTA_TTL_PROPAGATE
+RTA_UID
+RTA_UNSPEC
+RTA_VIA
+RTLD_DEEPBIND
+RTLD_DI_CONFIGADDR
+RTLD_DI_LINKMAP
+RTLD_DI_LMID
+RTLD_DI_ORIGIN
+RTLD_DI_PROFILENAME
+RTLD_DI_PROFILEOUT
+RTLD_DI_SERINFO
+RTLD_DI_SERINFOSIZE
+RTLD_DI_TLS_DATA
+RTLD_DI_TLS_MODID
+RTM_DELNETCONF
+RTM_F_FIB_MATCH
+RTM_F_LOOKUP_TABLE
+RTM_GETSTATS
+RTM_NEWCACHEREPORT
+RTM_NEWSTATS
+RUN_LVL
+RWF_APPEND
+RWF_DSYNC
+RWF_HIPRI
+RWF_NOWAIT
+RWF_SYNC
+SECURITYFS_MAGIC
+SELINUX_MAGIC
+SIGEV_THREAD_ID
+SMACK_MAGIC
+SMB_SUPER_MAGIC
+SOL_CAIF
+SOL_IUCV
+SOL_NFC
+SOL_PACKET
+SOL_PNPIPE
+SOL_PPPOL2TP
+SOL_RAW
+SOL_RDS
+SOL_RXRPC
+SOL_XDP
+STATX_ALL
+STATX_ATIME
+STATX_ATTR_APPEND
+STATX_ATTR_AUTOMOUNT
+STATX_ATTR_COMPRESSED
+STATX_ATTR_ENCRYPTED
+STATX_ATTR_IMMUTABLE
+STATX_ATTR_NODUMP
+STATX_BASIC_STATS
+STATX_BLOCKS
+STATX_BTIME
+STATX_CTIME
+STATX_GID
+STATX_INO
+STATX_MNT_ID
+STATX_MODE
+STATX_MTIME
+STATX_NLINK
+STATX_SIZE
+STATX_TYPE
+STATX_UID
+STATX__RESERVED
+STA_CLK
+STA_CLOCKERR
+STA_DEL
+STA_FLL
+STA_FREQHOLD
+STA_INS
+STA_MODE
+STA_NANO
+STA_PLL
+STA_PPSERROR
+STA_PPSFREQ
+STA_PPSJITTER
+STA_PPSSIGNAL
+STA_PPSTIME
+STA_PPSWANDER
+STA_RONLY
+STA_UNSYNC
+ST_RELATIME
+SYSFS_MAGIC
+TCA_CHAIN
+TCA_DUMP_INVISIBLE
+TCA_FCNT
+TCA_HW_OFFLOAD
+TCA_PAD
+TIME_BAD
+TIME_DEL
+TIME_ERROR
+TIME_INS
+TIME_OK
+TIME_OOP
+TIME_WAIT
+TMPFS_MAGIC
+TMP_MAX
+TRACEFS_MAGIC
+UDF_SUPER_MAGIC
+UNAME26
+USBDEVICE_SUPER_MAGIC
+USER_PROCESS
+XENFS_SUPER_MAGIC
+XFS_SUPER_MAGIC
+_SC_2_C_VERSION
+_SC_BASE
+_SC_CHARCLASS_NAME_MAX
+_SC_CHAR_BIT
+_SC_CHAR_MAX
+_SC_CHAR_MIN
+_SC_C_LANG_SUPPORT
+_SC_C_LANG_SUPPORT_R
+_SC_DELAYTIMER_MAX
+_SC_DEVICE_IO
+_SC_DEVICE_SPECIFIC
+_SC_DEVICE_SPECIFIC_R
+_SC_EQUIV_CLASS_MAX
+_SC_EXPR_NEST_MAX
+_SC_FD_MGMT
+_SC_FIFO
+_SC_FILE_ATTRIBUTES
+_SC_FILE_LOCKING
+_SC_FILE_SYSTEM
+_SC_INT_MAX
+_SC_INT_MIN
+_SC_LEVEL1_DCACHE_ASSOC
+_SC_LEVEL1_DCACHE_LINESIZE
+_SC_LEVEL1_DCACHE_SIZE
+_SC_LEVEL1_ICACHE_ASSOC
+_SC_LEVEL1_ICACHE_LINESIZE
+_SC_LEVEL1_ICACHE_SIZE
+_SC_LEVEL2_CACHE_ASSOC
+_SC_LEVEL2_CACHE_LINESIZE
+_SC_LEVEL2_CACHE_SIZE
+_SC_LEVEL3_CACHE_ASSOC
+_SC_LEVEL3_CACHE_LINESIZE
+_SC_LEVEL3_CACHE_SIZE
+_SC_LEVEL4_CACHE_ASSOC
+_SC_LEVEL4_CACHE_LINESIZE
+_SC_LEVEL4_CACHE_SIZE
+_SC_LINE_MAX
+_SC_LONG_BIT
+_SC_MAPPED_FILES
+_SC_MB_LEN_MAX
+_SC_MULTI_PROCESS
+_SC_NETWORKING
+_SC_NL_ARGMAX
+_SC_NL_LANGMAX
+_SC_NL_MSGMAX
+_SC_NL_NMAX
+_SC_NL_SETMAX
+_SC_NL_TEXTMAX
+_SC_PII
+_SC_PII_INTERNET
+_SC_PII_INTERNET_DGRAM
+_SC_PII_INTERNET_STREAM
+_SC_PII_OSI
+_SC_PII_OSI_CLTS
+_SC_PII_OSI_COTS
+_SC_PII_OSI_M
+_SC_PII_SOCKET
+_SC_PII_XTI
+_SC_PIPE
+_SC_POLL
+_SC_REGEX_VERSION
+_SC_SCHAR_MAX
+_SC_SCHAR_MIN
+_SC_SELECT
+_SC_SHRT_MAX
+_SC_SHRT_MIN
+_SC_SIGNALS
+_SC_SIGQUEUE_MAX
+_SC_SINGLE_PROCESS
+_SC_SSIZE_MAX
+_SC_SYSTEM_DATABASE
+_SC_SYSTEM_DATABASE_R
+_SC_T_IOV_MAX
+_SC_UCHAR_MAX
+_SC_UINT_MAX
+_SC_UIO_MAXIOV
+_SC_ULONG_MAX
+_SC_USER_GROUPS
+_SC_USER_GROUPS_R
+_SC_USHRT_MAX
+_SC_WORD_BIT
+__NFT_REG_MAX
+__UT_HOSTSIZE
+__UT_LINESIZE
+__UT_NAMESIZE
+__fsword_t
+__priority_which_t
+__rlimit_resource_t
+__timeval
+adjtimex
+backtrace
+copy_file_range
+dlinfo
+dlmopen
+endutxent
+fgetspent_r
+getgrent_r
+getpt
+getpwent_r
+getpwnam_r
+getspent_r
+getutxent
+getutxid
+getutxline
+glob
+glob64
+glob64_t
+glob_t
+globfree
+globfree64
+mallinfo
+malloc_usable_size
+mallopt
+nl_mmap_hdr
+nl_mmap_req
+nl_pktinfo
+ntp_adjtime
+ntp_gettime
+ntptimeval
+preadv2
+pthread_attr_getaffinity_np
+pthread_attr_setaffinity_np
+pthread_getname_np
+pthread_rwlockattr_getkind_np
+pthread_rwlockattr_getpshared
+pthread_rwlockattr_setkind_np
+pthread_setname_np
+pututxline
+pwritev2
+qsort_r
+setutxent
+setxattr
+sgetspent_r
+statx
+statx_timestamp
+timex
+utmpname
+utmpx
+utmpxname
diff --git a/libc-test/semver/linux-i686.txt b/libc-test/semver/linux-i686.txt
new file mode 100644
index 0000000000000..17fc3b6688095
--- /dev/null
+++ b/libc-test/semver/linux-i686.txt
@@ -0,0 +1,227 @@
+B2500000
+B3000000
+B3500000
+B4000000
+BOTHER
+CIBAUD
+CS
+DS
+EAX
+EBP
+EBX
+ECX
+EDI
+EDX
+EFL
+EIP
+ES
+ESI
+FS
+GS
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+MADV_SOFT_OFFLINE
+MAP_32BIT
+MAP_SYNC
+NFT_MSG_DELOBJ
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_NEWOBJ
+ORIG_EAX
+PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+PTRACE_GETFPREGS
+PTRACE_GETFPXREGS
+PTRACE_GETREGS
+PTRACE_SETFPREGS
+PTRACE_SETFPXREGS
+PTRACE_SETREGS
+PTRACE_SYSEMU
+PTRACE_SYSEMU_SINGLESTEP
+REG_CS
+REG_DS
+REG_EAX
+REG_EBP
+REG_EBX
+REG_ECX
+REG_EDI
+REG_EDX
+REG_EFL
+REG_EIP
+REG_ERR
+REG_ES
+REG_ESI
+REG_ESP
+REG_FS
+REG_GS
+REG_SS
+REG_TRAPNO
+REG_UESP
+SIGSTKFLT
+SIGUNUSED
+SO_BSDCOMPAT
+SO_NO_CHECK
+SO_PRIORITY
+SO_PROTOCOL
+SS
+SYS__llseek
+SYS__newselect
+SYS__sysctl
+SYS_access
+SYS_afs_syscall
+SYS_alarm
+SYS_bdflush
+SYS_break
+SYS_chmod
+SYS_chown
+SYS_chown32
+SYS_creat
+SYS_create_module
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_fadvise64
+SYS_fadvise64_64
+SYS_fchown32
+SYS_fcntl64
+SYS_fork
+SYS_fstat64
+SYS_fstatat64
+SYS_fstatfs64
+SYS_ftime
+SYS_ftruncate64
+SYS_futimesat
+SYS_get_kernel_syms
+SYS_get_thread_area
+SYS_getdents
+SYS_getegid32
+SYS_geteuid32
+SYS_getgid32
+SYS_getgroups32
+SYS_getpgrp
+SYS_getpmsg
+SYS_getresgid32
+SYS_getresuid32
+SYS_getuid32
+SYS_gtty
+SYS_idle
+SYS_inotify_init
+SYS_ioperm
+SYS_iopl
+SYS_ipc
+SYS_lchown
+SYS_lchown32
+SYS_link
+SYS_lock
+SYS_lstat
+SYS_lstat64
+SYS_mkdir
+SYS_mknod
+SYS_mmap2
+SYS_modify_ldt
+SYS_mpx
+SYS_nice
+SYS_oldfstat
+SYS_oldlstat
+SYS_oldolduname
+SYS_oldstat
+SYS_olduname
+SYS_open
+SYS_pause
+SYS_pipe
+SYS_pkey_alloc
+SYS_pkey_free
+SYS_pkey_mprotect
+SYS_poll
+SYS_prof
+SYS_profil
+SYS_putpmsg
+SYS_query_module
+SYS_readdir
+SYS_readlink
+SYS_rename
+SYS_renameat
+SYS_rmdir
+SYS_select
+SYS_sendfile
+SYS_sendfile64
+SYS_set_thread_area
+SYS_setfsgid32
+SYS_setfsuid32
+SYS_setgid32
+SYS_setgroups32
+SYS_setregid32
+SYS_setresgid32
+SYS_setresuid32
+SYS_setreuid32
+SYS_setuid32
+SYS_sgetmask
+SYS_sigaction
+SYS_signal
+SYS_signalfd
+SYS_sigpending
+SYS_sigprocmask
+SYS_sigreturn
+SYS_sigsuspend
+SYS_socketcall
+SYS_ssetmask
+SYS_stat
+SYS_stat64
+SYS_statfs64
+SYS_stime
+SYS_stty
+SYS_symlink
+SYS_sync_file_range
+SYS_sysfs
+SYS_time
+SYS_truncate64
+SYS_ugetrlimit
+SYS_ulimit
+SYS_umount
+SYS_unlink
+SYS_uselib
+SYS_ustat
+SYS_utime
+SYS_utimes
+SYS_vfork
+SYS_vm86
+SYS_vm86old
+SYS_vserver
+SYS_waitpid
+TIOCCBRK
+TIOCGRS485
+TIOCSBRK
+TIOCSRS485
+UESP
+_libc_fpreg
+_libc_fpstate
+flock64
+fsblkcnt64_t
+fsfilcnt64_t
+getcontext
+greg_t
+ip_mreqn
+makecontext
+max_align_t
+mcontext_t
+setcontext
+swapcontext
+sysctl
+termios2
+ucontext_t
+user
+user_fpregs_struct
+user_fpxregs_struct
+user_regs_struct
diff --git a/libc-test/semver/linux-mips.txt b/libc-test/semver/linux-mips.txt
new file mode 100644
index 0000000000000..3fed27958a288
--- /dev/null
+++ b/libc-test/semver/linux-mips.txt
@@ -0,0 +1,116 @@
+B2500000
+B3000000
+B3500000
+B4000000
+CIBAUD
+PTRACE_GETFPREGS
+PTRACE_GETFPXREGS
+PTRACE_GETREGS
+PTRACE_SETFPREGS
+PTRACE_SETFPXREGS
+PTRACE_SETREGS
+SO_PRIORITY
+SO_PROTOCOL
+SYS__sysctl
+SYS_accept
+SYS_access
+SYS_afs_syscall
+SYS_alarm
+SYS_bdflush
+SYS_break
+SYS_cachectl
+SYS_cacheflush
+SYS_chmod
+SYS_chown
+SYS_creat
+SYS_create_module
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_fcntl64
+SYS_fork
+SYS_fstat64
+SYS_fstatfs64
+SYS_ftime
+SYS_ftruncate64
+SYS_futimesat
+SYS_get_kernel_syms
+SYS_getdents
+SYS_getpgrp
+SYS_getpmsg
+SYS_gtty
+SYS_idle
+SYS_inotify_init
+SYS_ioperm
+SYS_iopl
+SYS_ipc
+SYS_lchown
+SYS_link
+SYS_lock
+SYS_lstat
+SYS_lstat64
+SYS_mkdir
+SYS_mknod
+SYS_mmap2
+SYS_modify_ldt
+SYS_mpx
+SYS_nice
+SYS_open
+SYS_pause
+SYS_pipe
+SYS_pkey_alloc
+SYS_pkey_free
+SYS_pkey_mprotect
+SYS_poll
+SYS_prof
+SYS_profil
+SYS_putpmsg
+SYS_query_module
+SYS_readdir
+SYS_readlink
+SYS_recv
+SYS_rename
+SYS_renameat
+SYS_rmdir
+SYS_send
+SYS_sendfile
+SYS_sendfile64
+SYS_set_thread_area
+SYS_sgetmask
+SYS_sigaction
+SYS_signal
+SYS_signalfd
+SYS_sigpending
+SYS_sigprocmask
+SYS_sigreturn
+SYS_sigsuspend
+SYS_socketcall
+SYS_ssetmask
+SYS_stat
+SYS_stat64
+SYS_statfs64
+SYS_stime
+SYS_stty
+SYS_symlink
+SYS_sync_file_range
+SYS_syscall
+SYS_sysfs
+SYS_sysmips
+SYS_time
+SYS_timerfd
+SYS_truncate64
+SYS_ulimit
+SYS_umount
+SYS_unlink
+SYS_uselib
+SYS_ustat
+SYS_utime
+SYS_utimes
+SYS_vm86
+SYS_vserver
+SYS_waitpid
+TIOCCBRK
+TIOCSBRK
+ip_mreqn
+max_align_t
diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt
new file mode 100644
index 0000000000000..1692b9c2d8ad2
--- /dev/null
+++ b/libc-test/semver/linux-musl.txt
@@ -0,0 +1,1 @@
+# TODO: musl.
diff --git a/libc-test/semver/linux-powerpc.txt b/libc-test/semver/linux-powerpc.txt
new file mode 100644
index 0000000000000..a02c7f0e86351
--- /dev/null
+++ b/libc-test/semver/linux-powerpc.txt
@@ -0,0 +1,160 @@
+B2500000
+B3000000
+B3500000
+B4000000
+BOTHER
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+MADV_SOFT_OFFLINE
+MAP_SYNC
+NFT_MSG_DELOBJ
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_NEWOBJ
+PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+PTRACE_GETFPREGS
+PTRACE_GETREGS
+PTRACE_SETFPREGS
+PTRACE_SETREGS
+SIGSTKFLT
+SIGUNUSED
+SO_BSDCOMPAT
+SO_NO_CHECK
+SO_PRIORITY
+SO_PROTOCOL
+SYS__llseek
+SYS__newselect
+SYS__sysctl
+SYS_accept
+SYS_access
+SYS_afs_syscall
+SYS_alarm
+SYS_bdflush
+SYS_break
+SYS_chmod
+SYS_chown
+SYS_creat
+SYS_create_module
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_fadvise64
+SYS_fadvise64_64
+SYS_fcntl64
+SYS_fork
+SYS_fstat64
+SYS_fstatat64
+SYS_fstatfs64
+SYS_ftime
+SYS_ftruncate64
+SYS_futimesat
+SYS_get_kernel_syms
+SYS_getdents
+SYS_getpgrp
+SYS_getpmsg
+SYS_gtty
+SYS_idle
+SYS_inotify_init
+SYS_ioperm
+SYS_iopl
+SYS_ipc
+SYS_kexec_file_load
+SYS_lchown
+SYS_link
+SYS_lock
+SYS_lstat
+SYS_lstat64
+SYS_mkdir
+SYS_mknod
+SYS_mmap2
+SYS_modify_ldt
+SYS_mpx
+SYS_multiplexer
+SYS_nice
+SYS_oldfstat
+SYS_oldlstat
+SYS_oldolduname
+SYS_oldstat
+SYS_olduname
+SYS_open
+SYS_pause
+SYS_pciconfig_iobase
+SYS_pciconfig_read
+SYS_pciconfig_write
+SYS_pipe
+SYS_poll
+SYS_prof
+SYS_profil
+SYS_putpmsg
+SYS_query_module
+SYS_readdir
+SYS_readlink
+SYS_recv
+SYS_rename
+SYS_renameat
+SYS_rmdir
+SYS_rtas
+SYS_select
+SYS_send
+SYS_sendfile
+SYS_sendfile64
+SYS_sgetmask
+SYS_sigaction
+SYS_signal
+SYS_signalfd
+SYS_sigpending
+SYS_sigprocmask
+SYS_sigreturn
+SYS_sigsuspend
+SYS_socketcall
+SYS_spu_create
+SYS_spu_run
+SYS_ssetmask
+SYS_stat
+SYS_stat64
+SYS_statfs64
+SYS_stime
+SYS_stty
+SYS_subpage_prot
+SYS_swapcontext
+SYS_switch_endian
+SYS_symlink
+SYS_sync_file_range2
+SYS_sys_debug_setcontext
+SYS_sysfs
+SYS_time
+SYS_truncate64
+SYS_tuxcall
+SYS_ugetrlimit
+SYS_ulimit
+SYS_umount
+SYS_unlink
+SYS_uselib
+SYS_ustat
+SYS_utime
+SYS_utimes
+SYS_vfork
+SYS_vm86
+SYS_waitpid
+TIOCCBRK
+TIOCGRS485
+TIOCSBRK
+TIOCSRS485
+flock64
+fsblkcnt64_t
+fsfilcnt64_t
+ip_mreqn
+sysctl
diff --git a/libc-test/semver/linux-powerpc64.txt b/libc-test/semver/linux-powerpc64.txt
new file mode 100644
index 0000000000000..9b6194f4e5d3a
--- /dev/null
+++ b/libc-test/semver/linux-powerpc64.txt
@@ -0,0 +1,164 @@
+B2500000
+B3000000
+B3500000
+B4000000
+BOTHER
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+MADV_SOFT_OFFLINE
+MAP_SYNC
+NFT_MSG_DELOBJ
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_NEWOBJ
+PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+SCM_TIMESTAMPNS
+SCM_WIFI_STATUS
+SIGSTKFLT
+SIGUNUSED
+SO_ATTACH_BPF
+SO_ATTACH_FILTER
+SO_BPF_EXTENSIONS
+SO_BSDCOMPAT
+SO_DETACH_BPF
+SO_DETACH_FILTER
+SO_GET_FILTER
+SO_INCOMING_CPU
+SO_LOCK_FILTER
+SO_MAX_PACING_RATE
+SO_NOFCS
+SO_NO_CHECK
+SO_PEERNAME
+SO_PRIORITY
+SO_PROTOCOL
+SO_SECURITY_AUTHENTICATION
+SO_SECURITY_ENCRYPTION_NETWORK
+SO_SECURITY_ENCRYPTION_TRANSPORT
+SO_SELECT_ERR_QUEUE
+SO_TIMESTAMPNS
+SO_WIFI_STATUS
+SYS__llseek
+SYS__newselect
+SYS__sysctl
+SYS_accept
+SYS_access
+SYS_afs_syscall
+SYS_alarm
+SYS_bdflush
+SYS_break
+SYS_chmod
+SYS_chown
+SYS_creat
+SYS_create_module
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_fork
+SYS_fstatfs64
+SYS_ftime
+SYS_futimesat
+SYS_get_kernel_syms
+SYS_getdents
+SYS_getpgrp
+SYS_getpmsg
+SYS_gtty
+SYS_idle
+SYS_inotify_init
+SYS_ioperm
+SYS_iopl
+SYS_ipc
+SYS_kexec_file_load
+SYS_lchown
+SYS_link
+SYS_lock
+SYS_lstat
+SYS_mkdir
+SYS_mknod
+SYS_modify_ldt
+SYS_mpx
+SYS_multiplexer
+SYS_newfstatat
+SYS_nice
+SYS_oldfstat
+SYS_oldlstat
+SYS_oldolduname
+SYS_oldstat
+SYS_olduname
+SYS_open
+SYS_pause
+SYS_pciconfig_iobase
+SYS_pciconfig_read
+SYS_pciconfig_write
+SYS_pipe
+SYS_poll
+SYS_prof
+SYS_profil
+SYS_putpmsg
+SYS_query_module
+SYS_readdir
+SYS_readlink
+SYS_recv
+SYS_rename
+SYS_renameat
+SYS_rmdir
+SYS_rtas
+SYS_select
+SYS_send
+SYS_sendfile
+SYS_sgetmask
+SYS_sigaction
+SYS_signal
+SYS_signalfd
+SYS_sigpending
+SYS_sigprocmask
+SYS_sigreturn
+SYS_sigsuspend
+SYS_socketcall
+SYS_spu_create
+SYS_spu_run
+SYS_ssetmask
+SYS_stat
+SYS_statfs64
+SYS_stime
+SYS_stty
+SYS_subpage_prot
+SYS_swapcontext
+SYS_switch_endian
+SYS_symlink
+SYS_sync_file_range2
+SYS_sys_debug_setcontext
+SYS_sysfs
+SYS_time
+SYS_tuxcall
+SYS_ugetrlimit
+SYS_ulimit
+SYS_umount
+SYS_unlink
+SYS_uselib
+SYS_ustat
+SYS_utime
+SYS_utimes
+SYS_vfork
+SYS_vm86
+SYS_waitpid
+TIOCCBRK
+TIOCGRS485
+TIOCSBRK
+TIOCSRS485
+flock64
+ip_mreqn
+max_align_t
+sysctl
diff --git a/libc-test/semver/linux-powerpc64le.txt b/libc-test/semver/linux-powerpc64le.txt
new file mode 100644
index 0000000000000..9b6194f4e5d3a
--- /dev/null
+++ b/libc-test/semver/linux-powerpc64le.txt
@@ -0,0 +1,164 @@
+B2500000
+B3000000
+B3500000
+B4000000
+BOTHER
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+MADV_SOFT_OFFLINE
+MAP_SYNC
+NFT_MSG_DELOBJ
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_NEWOBJ
+PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+SCM_TIMESTAMPNS
+SCM_WIFI_STATUS
+SIGSTKFLT
+SIGUNUSED
+SO_ATTACH_BPF
+SO_ATTACH_FILTER
+SO_BPF_EXTENSIONS
+SO_BSDCOMPAT
+SO_DETACH_BPF
+SO_DETACH_FILTER
+SO_GET_FILTER
+SO_INCOMING_CPU
+SO_LOCK_FILTER
+SO_MAX_PACING_RATE
+SO_NOFCS
+SO_NO_CHECK
+SO_PEERNAME
+SO_PRIORITY
+SO_PROTOCOL
+SO_SECURITY_AUTHENTICATION
+SO_SECURITY_ENCRYPTION_NETWORK
+SO_SECURITY_ENCRYPTION_TRANSPORT
+SO_SELECT_ERR_QUEUE
+SO_TIMESTAMPNS
+SO_WIFI_STATUS
+SYS__llseek
+SYS__newselect
+SYS__sysctl
+SYS_accept
+SYS_access
+SYS_afs_syscall
+SYS_alarm
+SYS_bdflush
+SYS_break
+SYS_chmod
+SYS_chown
+SYS_creat
+SYS_create_module
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_fork
+SYS_fstatfs64
+SYS_ftime
+SYS_futimesat
+SYS_get_kernel_syms
+SYS_getdents
+SYS_getpgrp
+SYS_getpmsg
+SYS_gtty
+SYS_idle
+SYS_inotify_init
+SYS_ioperm
+SYS_iopl
+SYS_ipc
+SYS_kexec_file_load
+SYS_lchown
+SYS_link
+SYS_lock
+SYS_lstat
+SYS_mkdir
+SYS_mknod
+SYS_modify_ldt
+SYS_mpx
+SYS_multiplexer
+SYS_newfstatat
+SYS_nice
+SYS_oldfstat
+SYS_oldlstat
+SYS_oldolduname
+SYS_oldstat
+SYS_olduname
+SYS_open
+SYS_pause
+SYS_pciconfig_iobase
+SYS_pciconfig_read
+SYS_pciconfig_write
+SYS_pipe
+SYS_poll
+SYS_prof
+SYS_profil
+SYS_putpmsg
+SYS_query_module
+SYS_readdir
+SYS_readlink
+SYS_recv
+SYS_rename
+SYS_renameat
+SYS_rmdir
+SYS_rtas
+SYS_select
+SYS_send
+SYS_sendfile
+SYS_sgetmask
+SYS_sigaction
+SYS_signal
+SYS_signalfd
+SYS_sigpending
+SYS_sigprocmask
+SYS_sigreturn
+SYS_sigsuspend
+SYS_socketcall
+SYS_spu_create
+SYS_spu_run
+SYS_ssetmask
+SYS_stat
+SYS_statfs64
+SYS_stime
+SYS_stty
+SYS_subpage_prot
+SYS_swapcontext
+SYS_switch_endian
+SYS_symlink
+SYS_sync_file_range2
+SYS_sys_debug_setcontext
+SYS_sysfs
+SYS_time
+SYS_tuxcall
+SYS_ugetrlimit
+SYS_ulimit
+SYS_umount
+SYS_unlink
+SYS_uselib
+SYS_ustat
+SYS_utime
+SYS_utimes
+SYS_vfork
+SYS_vm86
+SYS_waitpid
+TIOCCBRK
+TIOCGRS485
+TIOCSBRK
+TIOCSRS485
+flock64
+ip_mreqn
+max_align_t
+sysctl
diff --git a/libc-test/semver/linux-riscv64gc.txt b/libc-test/semver/linux-riscv64gc.txt
new file mode 100644
index 0000000000000..8397f37dbb994
--- /dev/null
+++ b/libc-test/semver/linux-riscv64gc.txt
@@ -0,0 +1,72 @@
+B2500000
+B3000000
+B3500000
+B4000000
+CIBAUD
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+MAP_SYNC
+NFT_MSG_DELOBJ
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_NEWOBJ
+SCM_TIMESTAMPNS
+SCM_WIFI_STATUS
+SIGSTKFLT
+SO_ATTACH_BPF
+SO_ATTACH_FILTER
+SO_BPF_EXTENSIONS
+SO_BSDCOMPAT
+SO_DETACH_BPF
+SO_DETACH_FILTER
+SO_GET_FILTER
+SO_INCOMING_CPU
+SO_LOCK_FILTER
+SO_MAX_PACING_RATE
+SO_NOFCS
+SO_NO_CHECK
+SO_PEERNAME
+SO_PRIORITY
+SO_PROTOCOL
+SO_SECURITY_AUTHENTICATION
+SO_SECURITY_ENCRYPTION_NETWORK
+SO_SECURITY_ENCRYPTION_TRANSPORT
+SO_SELECT_ERR_QUEUE
+SO_TIMESTAMPNS
+SO_WIFI_STATUS
+SYS_accept
+SYS_fadvise64
+SYS_msgctl
+SYS_msgget
+SYS_msgrcv
+SYS_msgsnd
+SYS_newfstatat
+SYS_pkey_alloc
+SYS_pkey_free
+SYS_pkey_mprotect
+SYS_semctl
+SYS_semget
+SYS_semop
+SYS_semtimedop
+SYS_sendfile
+SYS_shmat
+SYS_shmctl
+SYS_shmdt
+SYS_shmget
+SYS_sync_file_range
+TIOCGRS485
+TIOCSRS485
+flock64
+fsblkcnt64_t
+fsfilcnt64_t
+ip_mreqn
diff --git a/libc-test/semver/linux-s390x.txt b/libc-test/semver/linux-s390x.txt
new file mode 100644
index 0000000000000..1b0a74577d002
--- /dev/null
+++ b/libc-test/semver/linux-s390x.txt
@@ -0,0 +1,115 @@
+B2500000
+B3000000
+B3500000
+B4000000
+BOTHER
+CIBAUD
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+MADV_SOFT_OFFLINE
+NFT_MSG_DELOBJ
+NFT_MSG_GETOBJ
+NFT_MSG_GETOBJ_RESET
+NFT_MSG_NEWOBJ
+PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+SIGSTKFLT
+SIGUNUSED
+SO_BSDCOMPAT
+SO_PRIORITY
+SO_PROTOCOL
+SYS__sysctl
+SYS_access
+SYS_afs_syscall
+SYS_alarm
+SYS_bdflush
+SYS_chmod
+SYS_chown
+SYS_creat
+SYS_create_module
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_fadvise64
+SYS_fork
+SYS_fstatfs64
+SYS_futimesat
+SYS_get_kernel_syms
+SYS_getdents
+SYS_getpgrp
+SYS_getpmsg
+SYS_idle
+SYS_inotify_init
+SYS_ipc
+SYS_lchown
+SYS_link
+SYS_lstat
+SYS_mkdir
+SYS_mknod
+SYS_newfstatat
+SYS_nice
+SYS_open
+SYS_pause
+SYS_pipe
+SYS_poll
+SYS_putpmsg
+SYS_query_module
+SYS_readdir
+SYS_readlink
+SYS_rename
+SYS_renameat
+SYS_rmdir
+SYS_s390_pci_mmio_read
+SYS_s390_pci_mmio_write
+SYS_s390_runtime_instr
+SYS_select
+SYS_sendfile
+SYS_sigaction
+SYS_signal
+SYS_signalfd
+SYS_sigpending
+SYS_sigprocmask
+SYS_sigreturn
+SYS_sigsuspend
+SYS_socketcall
+SYS_stat
+SYS_statfs64
+SYS_symlink
+SYS_sync_file_range
+SYS_sysfs
+SYS_timerfd
+SYS_umount
+SYS_unlink
+SYS_uselib
+SYS_ustat
+SYS_utime
+SYS_utimes
+SYS_vfork
+TIOCCBRK
+TIOCSBRK
+XCASE
+__psw_t
+flock64
+fpreg_t
+fpregset_t
+getcontext
+greg_t
+makecontext
+mcontext_t
+setcontext
+swapcontext
+sysctl
+termios2
+ucontext_t
diff --git a/libc-test/semver/linux-sparc64.txt b/libc-test/semver/linux-sparc64.txt
new file mode 100644
index 0000000000000..92785b2405a29
--- /dev/null
+++ b/libc-test/semver/linux-sparc64.txt
@@ -0,0 +1,114 @@
+B153600
+B307200
+B614400
+B76800
+BOTHER
+CIBAUD
+KEYCTL_CAPABILITIES
+KEYCTL_CAPS0_BIG_KEY
+KEYCTL_CAPS0_CAPABILITIES
+KEYCTL_CAPS0_DIFFIE_HELLMAN
+KEYCTL_CAPS0_INVALIDATE
+KEYCTL_CAPS0_MOVE
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS
+KEYCTL_CAPS0_PUBLIC_KEY
+KEYCTL_CAPS0_RESTRICT_KEYRING
+KEYCTL_CAPS1_NS_KEYRING_NAME
+KEYCTL_CAPS1_NS_KEY_TAG
+KEYCTL_MOVE
+MADV_SOFT_OFFLINE
+MAP_SYNC
+PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+SYS__llseek
+SYS__newselect
+SYS__sysctl
+SYS_accept
+SYS_access
+SYS_afs_syscall
+SYS_alarm
+SYS_bdflush
+SYS_chmod
+SYS_chown
+SYS_creat
+SYS_create_module
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_execv
+SYS_fadvise64
+SYS_fadvise64_64
+SYS_fork
+SYS_fstat64
+SYS_fstatat64
+SYS_fstatfs64
+SYS_futimesat
+SYS_get_kernel_syms
+SYS_getdents
+SYS_getdomainname
+SYS_getpagesize
+SYS_getpgrp
+SYS_inotify_init
+SYS_ipc
+SYS_kern_features
+SYS_lchown
+SYS_link
+SYS_lstat
+SYS_lstat64
+SYS_memory_ordering
+SYS_mkdir
+SYS_mknod
+SYS_nice
+SYS_oldlstat
+SYS_open
+SYS_pause
+SYS_pciconfig_read
+SYS_pciconfig_write
+SYS_perfctr
+SYS_pipe
+SYS_poll
+SYS_query_module
+SYS_readdir
+SYS_readlink
+SYS_rename
+SYS_renameat
+SYS_rmdir
+SYS_sched_get_affinity
+SYS_sched_set_affinity
+SYS_select
+SYS_sendfile
+SYS_sendfile64
+SYS_sgetmask
+SYS_sigaction
+SYS_signal
+SYS_signalfd
+SYS_sigpending
+SYS_sigprocmask
+SYS_sigreturn
+SYS_sigsuspend
+SYS_socketcall
+SYS_ssetmask
+SYS_stat
+SYS_stat64
+SYS_statfs64
+SYS_stime
+SYS_symlink
+SYS_sync_file_range
+SYS_sysfs
+SYS_umount
+SYS_unlink
+SYS_uselib
+SYS_ustat
+SYS_utime
+SYS_utimes
+SYS_utrap_install
+SYS_vfork
+SYS_waitpid
+TIOCCBRK
+TIOCSBRK
+flock64
+max_align_t
+sysctl
+termios2
diff --git a/libc-test/semver/linux-x86_64.txt b/libc-test/semver/linux-x86_64.txt
new file mode 100644
index 0000000000000..6865f47d1be46
--- /dev/null
+++ b/libc-test/semver/linux-x86_64.txt
@@ -0,0 +1,91 @@
+B2500000
+B3000000
+B3500000
+B4000000
+CIBAUD
+CS
+DS
+ES
+FS
+GS
+MADV_SOFT_OFFLINE
+MAP_32BIT
+MAP_SYNC
+PTRACE_GETFPREGS
+PTRACE_GETFPXREGS
+PTRACE_GETREGS
+PTRACE_SETFPREGS
+PTRACE_SETFPXREGS
+PTRACE_SETREGS
+REG_EFL
+REG_ERR
+REG_TRAPNO
+SIGSTKFLT
+SIGUNUSED
+SO_BSDCOMPAT
+SO_NO_CHECK
+SO_PRIORITY
+SO_PROTOCOL
+SS
+SYS_access
+SYS_afs_syscall
+SYS_alarm
+SYS_chmod
+SYS_chown
+SYS_creat
+SYS_dup2
+SYS_epoll_create
+SYS_epoll_wait
+SYS_eventfd
+SYS_fadvise64
+SYS_fork
+SYS_futimesat
+SYS_getdents
+SYS_getpgrp
+SYS_getpmsg
+SYS_inotify_init
+SYS_ioperm
+SYS_iopl
+SYS_lchown
+SYS_link
+SYS_lstat
+SYS_mkdir
+SYS_mknod
+SYS_modify_ldt
+SYS_open
+SYS_pause
+SYS_pipe
+SYS_pkey_alloc
+SYS_pkey_free
+SYS_pkey_mprotect
+SYS_poll
+SYS_putpmsg
+SYS_readlink
+SYS_rename
+SYS_renameat
+SYS_rmdir
+SYS_select
+SYS_sendfile
+SYS_signalfd
+SYS_stat
+SYS_symlink
+SYS_sync_file_range
+SYS_sysfs
+SYS_time
+SYS_unlink
+SYS_ustat
+SYS_utime
+SYS_utimes
+SYS_vfork
+TIOCCBRK
+TIOCGRS485
+TIOCSBRK
+TIOCSRS485
+greg_t
+ip_mreqn
+max_align_t
+mcontext_t
+ucontext_t
+user
+user_fpregs_struct
+user_regs_struct
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
new file mode 100644
index 0000000000000..90202ffa045b2
--- /dev/null
+++ b/libc-test/semver/linux.txt
@@ -0,0 +1,3032 @@
+ABDAY_1
+ABDAY_2
+ABDAY_3
+ABDAY_4
+ABDAY_5
+ABDAY_6
+ABDAY_7
+ABMON_1
+ABMON_10
+ABMON_11
+ABMON_12
+ABMON_2
+ABMON_3
+ABMON_4
+ABMON_5
+ABMON_6
+ABMON_7
+ABMON_8
+ABMON_9
+ABS_CNT
+ABS_MAX
+ADDR_COMPAT_LAYOUT
+ADDR_LIMIT_32BIT
+ADDR_LIMIT_3GB
+ADDR_NO_RANDOMIZE
+AF_ALG
+AF_APPLETALK
+AF_ASH
+AF_ATMPVC
+AF_ATMSVC
+AF_AX25
+AF_BLUETOOTH
+AF_BRIDGE
+AF_CAIF
+AF_CAN
+AF_DECnet
+AF_ECONET
+AF_IB
+AF_IEEE802154
+AF_IPX
+AF_IRDA
+AF_ISDN
+AF_IUCV
+AF_KEY
+AF_LLC
+AF_LOCAL
+AF_MPLS
+AF_NETBEUI
+AF_NETLINK
+AF_NETROM
+AF_NFC
+AF_PACKET
+AF_PHONET
+AF_PPPOX
+AF_RDS
+AF_ROSE
+AF_ROUTE
+AF_RXRPC
+AF_SECURITY
+AF_SNA
+AF_TIPC
+AF_VSOCK
+AF_WANPIPE
+AF_X25
+AF_XDP
+AIO_ALLDONE
+AIO_CANCELED
+AIO_NOTCANCELED
+AI_ADDRCONFIG
+AI_ALL
+AI_CANONNAME
+AI_NUMERICHOST
+AI_NUMERICSERV
+AI_PASSIVE
+AI_V4MAPPED
+ALG_OP_DECRYPT
+ALG_OP_ENCRYPT
+ALG_SET_AEAD_ASSOCLEN
+ALG_SET_AEAD_AUTHSIZE
+ALG_SET_IV
+ALG_SET_KEY
+ALG_SET_OP
+ALT_DIGITS
+AM_STR
+ARPD_FLUSH
+ARPD_LOOKUP
+ARPD_UP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_PATH
+AT_ENTRY
+AT_EUID
+AT_EXECFD
+AT_EXECFN
+AT_FDCWD
+AT_FLAGS
+AT_GID
+AT_HWCAP
+AT_HWCAP2
+AT_IGNORE
+AT_NOTELF
+AT_NO_AUTOMOUNT
+AT_NULL
+AT_PAGESZ
+AT_PHDR
+AT_PHENT
+AT_PHNUM
+AT_PLATFORM
+AT_RANDOM
+AT_REMOVEDIR
+AT_SECURE
+AT_SYMLINK_FOLLOW
+AT_SYMLINK_NOFOLLOW
+AT_UID
+B1000000
+B1152000
+B1500000
+B2000000
+B460800
+B500000
+B576000
+B921600
+BS0
+BS1
+BSDLY
+BUFSIZ
+CANFD_BRS
+CANFD_ESI
+CANFD_MAX_DLC
+CANFD_MAX_DLEN
+CANFD_MTU
+CAN_BCM
+CAN_EFF_FLAG
+CAN_EFF_ID_BITS
+CAN_EFF_MASK
+CAN_ERR_FLAG
+CAN_ERR_MASK
+CAN_INV_FILTER
+CAN_ISOTP
+CAN_J1939
+CAN_MAX_DLC
+CAN_MAX_DLEN
+CAN_MCNET
+CAN_MTU
+CAN_NPROTO
+CAN_RAW
+CAN_RAW_FILTER_MAX
+CAN_RTR_FLAG
+CAN_SFF_ID_BITS
+CAN_SFF_MASK
+CAN_TP16
+CAN_TP20
+CBAUD
+CBAUDEX
+CLD_CONTINUED
+CLD_DUMPED
+CLD_EXITED
+CLD_KILLED
+CLD_STOPPED
+CLD_TRAPPED
+CLOCK_BOOTTIME
+CLOCK_BOOTTIME_ALARM
+CLOCK_MONOTONIC_COARSE
+CLOCK_MONOTONIC_RAW
+CLOCK_PROCESS_CPUTIME_ID
+CLOCK_REALTIME_ALARM
+CLOCK_REALTIME_COARSE
+CLOCK_TAI
+CLOCK_THREAD_CPUTIME_ID
+CLONE_CHILD_CLEARTID
+CLONE_CHILD_SETTID
+CLONE_DETACHED
+CLONE_FILES
+CLONE_FS
+CLONE_IO
+CLONE_NEWCGROUP
+CLONE_NEWIPC
+CLONE_NEWNET
+CLONE_NEWNS
+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
+Elf64_Phdr
+Elf64_Section
+Elf64_Shdr
+Elf64_Sxword
+Elf64_Sym
+Elf64_Word
+Elf64_Xword
+FALLOC_FL_COLLAPSE_RANGE
+FALLOC_FL_INSERT_RANGE
+FALLOC_FL_KEEP_SIZE
+FALLOC_FL_PUNCH_HOLE
+FALLOC_FL_UNSHARE_RANGE
+FALLOC_FL_ZERO_RANGE
+FANOTIFY_METADATA_VERSION
+FAN_ACCESS
+FAN_ACCESS_PERM
+FAN_ALLOW
+FAN_CLASS_CONTENT
+FAN_CLASS_NOTIF
+FAN_CLASS_PRE_CONTENT
+FAN_CLOEXEC
+FAN_CLOSE
+FAN_CLOSE_NOWRITE
+FAN_CLOSE_WRITE
+FAN_DENY
+FAN_EVENT_ON_CHILD
+FAN_MARK_ADD
+FAN_MARK_DONT_FOLLOW
+FAN_MARK_FILESYSTEM
+FAN_MARK_FLUSH
+FAN_MARK_IGNORED_MASK
+FAN_MARK_IGNORED_SURV_MODIFY
+FAN_MARK_INODE
+FAN_MARK_MOUNT
+FAN_MARK_ONLYDIR
+FAN_MARK_REMOVE
+FAN_MODIFY
+FAN_NOFD
+FAN_NONBLOCK
+FAN_ONDIR
+FAN_OPEN
+FAN_OPEN_PERM
+FAN_Q_OVERFLOW
+FAN_UNLIMITED_MARKS
+FAN_UNLIMITED_QUEUE
+FF0
+FF1
+FFDLY
+FF_CNT
+FF_MAX
+FILENAME_MAX
+FIONCLEX
+FIONREAD
+FLUSHO
+FOPEN_MAX
+FUTEX_CLOCK_REALTIME
+FUTEX_CMD_MASK
+FUTEX_CMP_REQUEUE
+FUTEX_CMP_REQUEUE_PI
+FUTEX_FD
+FUTEX_LOCK_PI
+FUTEX_PRIVATE_FLAG
+FUTEX_REQUEUE
+FUTEX_TRYLOCK_PI
+FUTEX_UNLOCK_PI
+FUTEX_WAIT
+FUTEX_WAIT_BITSET
+FUTEX_WAIT_REQUEUE_PI
+FUTEX_WAKE
+FUTEX_WAKE_BITSET
+FUTEX_WAKE_OP
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DR
+IPV6_PATHMTU
+IPV6_PKTINFO
+IPV6_PMTUDISC_DO
+IPV6_PMTUDISC_DONT
+IPV6_PMTUDISC_INTERFACE
+IPV6_PMTUDISC_OMIT
+IPV6_PMTUDISC_PROBE
+IPV6_PMTUDISC_WANT
+IPV6_PREFER_SRC_CGA
+IPV6_PREFER_SRC_COA
+IPV6_PREFER_SRC_HOME
+IPV6_PREFER_SRC_NONCGA
+IPV6_PREFER_SRC_PUBLIC
+IPV6_PREFER_SRC_PUBTMP_DEFAULT
+IPV6_PREFER_SRC_TMP
+IPV6_RECVDSTOPTS
+IPV6_RECVERR
+IPV6_RECVFRAGSIZE
+IPV6_RECVHOPLIMIT
+IPV6_RECVHOPOPTS
+IPV6_RECVORIGDSTADDR
+IPV6_RECVPATHMTU
+IPV6_RECVPKTINFO
+IPV6_RECVRTHDR
+IPV6_RECVTCLASS
+IPV6_ROUTER_ALERT
+IPV6_ROUTER_ALERT_ISOLATE
+IPV6_RTHDR
+IPV6_RTHDRDSTOPTS
+IPV6_RTHDR_LOOSE
+IPV6_RTHDR_STRICT
+IPV6_TCLASS
+IPV6_TRANSPARENT
+IPV6_UNICAST_IF
+IPV6_XFRM_POLICY
+IPVERSION
+IP_ADD_SOURCE_MEMBERSHIP
+IP_BIND_ADDRESS_NO_PORT
+IP_BLOCK_SOURCE
+IP_CHECKSUM
+IP_DEFAULT_MULTICAST_LOOP
+IP_DEFAULT_MULTICAST_TTL
+IP_DROP_SOURCE_MEMBERSHIP
+IP_FREEBIND
+IP_HDRINCL
+IP_IPSEC_POLICY
+IP_MINTTL
+IP_MSFILTER
+IP_MTU
+IP_MTU_DISCOVER
+IP_MULTICAST_ALL
+IP_NODEFRAG
+IP_OPTIONS
+IP_ORIGDSTADDR
+IP_PASSSEC
+IP_PKTINFO
+IP_PKTOPTIONS
+IP_PMTUDISC_DO
+IP_PMTUDISC_DONT
+IP_PMTUDISC_INTERFACE
+IP_PMTUDISC_OMIT
+IP_PMTUDISC_PROBE
+IP_PMTUDISC_WANT
+IP_RECVERR
+IP_RECVFRAGSIZE
+IP_RECVOPTS
+IP_RECVORIGDSTADDR
+IP_RECVTOS
+IP_RECVTTL
+IP_RETOPTS
+IP_ROUTER_ALERT
+IP_TOS
+IP_TRANSPARENT
+IP_UNBLOCK_SOURCE
+IP_UNICAST_IF
+IP_XFRM_POLICY
+ITIMER_PROF
+ITIMER_REAL
+ITIMER_VIRTUAL
+IUTF8
+KEYCTL_ASSUME_AUTHORITY
+KEYCTL_CHOWN
+KEYCTL_CLEAR
+KEYCTL_DESCRIBE
+KEYCTL_GET_KEYRING_ID
+KEYCTL_GET_PERSISTENT
+KEYCTL_GET_SECURITY
+KEYCTL_INSTANTIATE
+KEYCTL_INSTANTIATE_IOV
+KEYCTL_INVALIDATE
+KEYCTL_JOIN_SESSION_KEYRING
+KEYCTL_LINK
+KEYCTL_NEGATE
+KEYCTL_READ
+KEYCTL_REJECT
+KEYCTL_REVOKE
+KEYCTL_SEARCH
+KEYCTL_SESSION_TO_PARENT
+KEYCTL_SETPERM
+KEYCTL_SET_REQKEY_KEYRING
+KEYCTL_SET_TIMEOUT
+KEYCTL_UNLINK
+KEYCTL_UPDATE
+KEY_CNT
+KEY_MAX
+KEY_REQKEY_DEFL_DEFAULT
+KEY_REQKEY_DEFL_GROUP_KEYRING
+KEY_REQKEY_DEFL_NO_CHANGE
+KEY_REQKEY_DEFL_PROCESS_KEYRING
+KEY_REQKEY_DEFL_REQUESTOR_KEYRING
+KEY_REQKEY_DEFL_SESSION_KEYRING
+KEY_REQKEY_DEFL_THREAD_KEYRING
+KEY_REQKEY_DEFL_USER_KEYRING
+KEY_REQKEY_DEFL_USER_SESSION_KEYRING
+KEY_SPEC_GROUP_KEYRING
+KEY_SPEC_PROCESS_KEYRING
+KEY_SPEC_REQKEY_AUTH_KEY
+KEY_SPEC_REQUESTOR_KEYRING
+KEY_SPEC_SESSION_KEYRING
+KEY_SPEC_THREAD_KEYRING
+KEY_SPEC_USER_KEYRING
+KEY_SPEC_USER_SESSION_KEYRING
+LC_COLLATE
+LC_COLLATE_MASK
+LC_CTYPE
+LC_CTYPE_MASK
+LC_MESSAGES
+LC_MESSAGES_MASK
+LC_MONETARY
+LC_MONETARY_MASK
+LC_NUMERIC
+LC_NUMERIC_MASK
+LC_TIME
+LC_TIME_MASK
+LED_CNT
+LED_MAX
+LINUX_REBOOT_CMD_CAD_OFF
+LINUX_REBOOT_CMD_CAD_ON
+LINUX_REBOOT_CMD_HALT
+LINUX_REBOOT_CMD_KEXEC
+LINUX_REBOOT_CMD_POWER_OFF
+LINUX_REBOOT_CMD_RESTART
+LINUX_REBOOT_CMD_RESTART2
+LINUX_REBOOT_CMD_SW_SUSPEND
+LINUX_REBOOT_MAGIC1
+LINUX_REBOOT_MAGIC2
+LINUX_REBOOT_MAGIC2A
+LINUX_REBOOT_MAGIC2B
+LINUX_REBOOT_MAGIC2C
+LIO_NOP
+LIO_NOWAIT
+LIO_READ
+LIO_WAIT
+LIO_WRITE
+LOG_AUTHPRIV
+LOG_CRON
+LOG_FTP
+LOG_NFACILITIES
+LOG_PERROR
+L_tmpnam
+MADV_DODUMP
+MADV_DOFORK
+MADV_DONTDUMP
+MADV_DONTFORK
+MADV_DONTNEED
+MADV_FREE
+MADV_HUGEPAGE
+MADV_HWPOISON
+MADV_MERGEABLE
+MADV_NOHUGEPAGE
+MADV_NORMAL
+MADV_RANDOM
+MADV_REMOVE
+MADV_SEQUENTIAL
+MADV_UNMERGEABLE
+MADV_WILLNEED
+MAP_DENYWRITE
+MAP_EXECUTABLE
+MAP_FILE
+MAP_FIXED_NOREPLACE
+MAP_GROWSDOWN
+MAP_HUGETLB
+MAP_HUGE_16GB
+MAP_HUGE_16MB
+MAP_HUGE_1GB
+MAP_HUGE_1MB
+MAP_HUGE_256MB
+MAP_HUGE_2GB
+MAP_HUGE_2MB
+MAP_HUGE_32MB
+MAP_HUGE_512KB
+MAP_HUGE_512MB
+MAP_HUGE_64KB
+MAP_HUGE_8MB
+MAP_HUGE_MASK
+MAP_HUGE_SHIFT
+MAP_LOCKED
+MAP_NONBLOCK
+MAP_NORESERVE
+MAP_POPULATE
+MAP_SHARED_VALIDATE
+MAP_STACK
+MAP_TYPE
+MAXTTL
+MAX_ADDR_LEN
+MAX_IPOPTLEN
+MCAST_BLOCK_SOURCE
+MCAST_EXCLUDE
+MCAST_INCLUDE
+MCAST_JOIN_GROUP
+MCAST_JOIN_SOURCE_GROUP
+MCAST_LEAVE_GROUP
+MCAST_LEAVE_SOURCE_GROUP
+MCAST_MSFILTER
+MCAST_UNBLOCK_SOURCE
+MCL_CURRENT
+MCL_FUTURE
+MFD_ALLOW_SEALING
+MFD_CLOEXEC
+MFD_HUGETLB
+MINSIGSTKSZ
+MMAP_PAGE_ZERO
+MNT_DETACH
+MNT_EXPIRE
+MNT_FORCE
+MODULE_INIT_IGNORE_MODVERSIONS
+MODULE_INIT_IGNORE_VERMAGIC
+MON_1
+MON_10
+MON_11
+MON_12
+MON_2
+MON_3
+MON_4
+MON_5
+MON_6
+MON_7
+MON_8
+MON_9
+MREMAP_FIXED
+MREMAP_MAYMOVE
+MSC_CNT
+MSC_MAX
+MSG_CMSG_CLOEXEC
+MSG_CONFIRM
+MSG_COPY
+MSG_DONTWAIT
+MSG_ERRQUEUE
+MSG_EXCEPT
+MSG_FASTOPEN
+MSG_FIN
+MSG_INFO
+MSG_MORE
+MSG_NOERROR
+MSG_NOSIGNAL
+MSG_RST
+MSG_STAT
+MSG_SYN
+MSG_WAITFORONE
+MS_ACTIVE
+MS_BIND
+MS_DIRSYNC
+MS_I_VERSION
+MS_KERNMOUNT
+MS_MANDLOCK
+MS_MGC_MSK
+MS_MGC_VAL
+MS_MOVE
+MS_NOATIME
+MS_NODEV
+MS_NODIRATIME
+MS_NOEXEC
+MS_NOSUID
+MS_NOUSER
+MS_POSIXACL
+MS_PRIVATE
+MS_RDONLY
+MS_REC
+MS_REMOUNT
+MS_RMT_MASK
+MS_SHARED
+MS_SILENT
+MS_SLAVE
+MS_STRICTATIME
+MS_SYNCHRONOUS
+MS_UNBINDABLE
+NDA_CACHEINFO
+NDA_DST
+NDA_IFINDEX
+NDA_PORT
+NDA_PROBES
+NDA_UNSPEC
+NDA_VLAN
+NDA_VNI
+NETLINK_ADD_MEMBERSHIP
+NETLINK_AUDIT
+NETLINK_BROADCAST_ERROR
+NETLINK_CAP_ACK
+NETLINK_CONNECTOR
+NETLINK_CRYPTO
+NETLINK_DNRTMSG
+NETLINK_DROP_MEMBERSHIP
+NETLINK_ECRYPTFS
+NETLINK_FIB_LOOKUP
+NETLINK_FIREWALL
+NETLINK_GENERIC
+NETLINK_INET_DIAG
+NETLINK_IP6_FW
+NETLINK_ISCSI
+NETLINK_KOBJECT_UEVENT
+NETLINK_LISTEN_ALL_NSID
+NETLINK_LIST_MEMBERSHIPS
+NETLINK_NETFILTER
+NETLINK_NFLOG
+NETLINK_NO_ENOBUFS
+NETLINK_PKTINFO
+NETLINK_RDMA
+NETLINK_ROUTE
+NETLINK_RX_RING
+NETLINK_SCSITRANSPORT
+NETLINK_SELINUX
+NETLINK_SOCK_DIAG
+NETLINK_TX_RING
+NETLINK_UNUSED
+NETLINK_USERSOCK
+NETLINK_XFRM
+NFNETLINK_V0
+NFNLGRP_ACCT_QUOTA
+NFNLGRP_CONNTRACK_DESTROY
+NFNLGRP_CONNTRACK_EXP_DESTROY
+NFNLGRP_CONNTRACK_EXP_NEW
+NFNLGRP_CONNTRACK_EXP_UPDATE
+NFNLGRP_CONNTRACK_NEW
+NFNLGRP_CONNTRACK_UPDATE
+NFNLGRP_NFTABLES
+NFNLGRP_NONE
+NFNL_MSG_BATCH_BEGIN
+NFNL_MSG_BATCH_END
+NFNL_SUBSYS_ACCT
+NFNL_SUBSYS_COUNT
+NFNL_SUBSYS_CTHELPER
+NFNL_SUBSYS_CTNETLINK
+NFNL_SUBSYS_CTNETLINK_EXP
+NFNL_SUBSYS_CTNETLINK_TIMEOUT
+NFNL_SUBSYS_IPSET
+NFNL_SUB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
+NFULA_CFG_QTHRESH
+NFULA_CFG_TIMEOUT
+NFULA_CFG_UNSPEC
+NFULA_CT
+NFULA_CT_INFO
+NFULA_GID
+NFULA_HWADDR
+NFULA_HWHEADER
+NFULA_HWLEN
+NFULA_HWTYPE
+NFULA_IFINDEX_INDEV
+NFULA_IFINDEX_OUTDEV
+NFULA_IFINDEX_PHYSINDEV
+NFULA_IFINDEX_PHYSOUTDEV
+NFULA_MARK
+NFULA_PACKET_HDR
+NFULA_PAYLOAD
+NFULA_PREFIX
+NFULA_SEQ
+NFULA_SEQ_GLOBAL
+NFULA_TIMESTAMP
+NFULA_UID
+NFULA_UNSPEC
+NFULNL_CFG_CMD_BIND
+NFULNL_CFG_CMD_NONE
+NFULNL_CFG_CMD_PF_BIND
+NFULNL_CFG_CMD_PF_UNBIND
+NFULNL_CFG_CMD_UNBIND
+NFULNL_CFG_F_CONNTRACK
+NFULNL_CFG_F_SEQ
+NFULNL_CFG_F_SEQ_GLOBAL
+NFULNL_COPY_META
+NFULNL_COPY_NONE
+NFULNL_COPY_PACKET
+NFULNL_MSG_CONFIG
+NFULNL_MSG_PACKET
+NF_ACCEPT
+NF_DROP
+NF_INET_FORWARD
+NF_INET_LOCAL_IN
+NF_INET_LOCAL_OUT
+NF_INET_NUMHOOKS
+NF_INET_POST_ROUTING
+NF_INET_PRE_ROUTING
+NF_IP6_FORWARD
+NF_IP6_LOCAL_IN
+NF_IP6_LOCAL_OUT
+NF_IP6_NUMHOOKS
+NF_IP6_POST_ROUTING
+NF_IP6_PRE_ROUTING
+NF_IP6_PRI_CONNTRACK
+NF_IP6_PRI_CONNTRACK_DEFRAG
+NF_IP6_PRI_CONNTRACK_HELPER
+NF_IP6_PRI_FILTER
+NF_IP6_PRI_FIRST
+NF_IP6_PRI_LAST
+NF_IP6_PRI_MANGLE
+NF_IP6_PRI_NAT_DST
+NF_IP6_PRI_NAT_SRC
+NF_IP6_PRI_RAW
+NF_IP6_PRI_SECURITY
+NF_IP6_PRI_SEL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D_NONE
+NUD_PERMANENT
+NUD_PROBE
+NUD_REACHABLE
+NUD_STALE
+OFDEL
+OFILL
+OLCUC
+O_DIRECT
+O_DSYNC
+O_LARGEFILE
+O_NDELAY
+O_NOATIME
+O_NOCTTY
+O_PATH
+O_RSYNC
+O_SYNC
+O_TMPFILE
+PACKET_ADD_MEMBERSHIP
+PACKET_DROP_MEMBERSHIP
+PACKET_MR_ALLMULTI
+PACKET_MR_MULTICAST
+PACKET_MR_PROMISC
+PACKET_MR_UNICAST
+PENDIN
+PF_ALG
+PF_APPLETALK
+PF_ASH
+PF_ATMPVC
+PF_ATMSVC
+PF_AX25
+PF_BLUETOOTH
+PF_BRIDGE
+PF_CAIF
+PF_CAN
+PF_DECnet
+PF_ECONET
+PF_IB
+PF_IEEE802154
+PF_IPX
+PF_IRDA
+PF_ISDN
+PF_IUCV
+PF_KEY
+PF_LLC
+PF_LOCAL
+PF_MPLS
+PF_NETBEUI
+PF_NETLINK
+PF_NETROM
+PF_NFC
+PF_PACKET
+PF_PHONET
+PF_PPPOX
+PF_RDS
+PF_ROSE
+PF_ROUTE
+PF_RXRPC
+PF_SECURITY
+PF_SNA
+PF_TIPC
+PF_VSOCK
+PF_WANPIPE
+PF_X25
+PF_XDP
+PIPE_BUF
+PM_STR
+POLLRDBAND
+POLLRDNORM
+POLLWRBAND
+POLLWRNORM
+POSIX_FADV_DONTNEED
+POSIX_FADV_NOREUSE
+POSIX_FADV_NORMAL
+POSIX_FADV_RANDOM
+POSIX_FADV_SEQUENTIAL
+POSIX_FADV_WILLNEED
+POSIX_MADV_DONTNEED
+POSIX_MADV_NORMAL
+POSIX_MADV_RANDOM
+POSIX_MADV_SEQUENTIAL
+POSIX_MADV_WILLNEED
+POSIX_SPAWN_RESETIDS
+POSIX_SPAWN_SETPGROUP
+POSIX_SPAWN_SETSCHEDPARAM
+POSIX_SPAWN_SETSCHEDULER
+POSIX_SPAWN_SETSIGDEF
+POSIX_SPAWN_SETSIGMASK
+PROT_GROWSDOWN
+PROT_GROWSUP
+PR_CAPBSET_DROP
+PR_CAPBSET_READ
+PR_CAP_AMBIENT
+PR_CAP_AMBIENT_CLEAR_ALL
+PR_CAP_AMBIENT_IS_SET
+PR_CAP_AMBIENT_LOWER
+PR_CAP_AMBIENT_RAISE
+PR_ENDIAN_BIG
+PR_ENDIAN_LITTLE
+PR_ENDIAN_PPC_LITTLE
+PR_FPEMU_NOPRINT
+PR_FPEMU_SIGFPE
+PR_FP_EXC_ASYNC
+PR_FP_EXC_DISABLED
+PR_FP_EXC_DIV
+PR_FP_EXC_INV
+PR_FP_EXC_NONRECOV
+PR_FP_EXC_OVF
+PR_FP_EXC_PRECISE
+PR_FP_EXC_RES
+PR_FP_EXC_SW_ENABLE
+PR_FP_EXC_UND
+PR_FP_MODE_FR
+PR_FP_MODE_FRE
+PR_GET_CHILD_SUBREAPER
+PR_GET_DUMPABLE
+PR_GET_ENDIAN
+PR_GET_FPEMU
+PR_GET_FPEXC
+PR_GET_FP_MODE
+PR_GET_KEEPCAPS
+PR_GET_NAME
+PR_GET_NO_NEW_PRIVS
+PR_GET_PDEATHSIG
+PR_GET_SECCOMP
+PR_GET_SECUREBITS
+PR_GET_THP_DISABLE
+PR_GET_TID_ADDRESS
+PR_GET_TIMERSLACK
+PR_GET_TIMING
+PR_GET_TSC
+PR_GET_UNALIGN
+PR_MCE_KILL
+PR_MCE_KILL_CLEAR
+PR_MCE_KILL_DEFAULT
+PR_MCE_KILL_EARLY
+PR_MCE_KILL_GET
+PR_MCE_KILL_LATE
+PR_MCE_KILL_SET
+PR_MPX_DISABLE_MANAGEMENT
+PR_MPX_ENABLE_MANAGEMENT
+PR_SET_CHILD_SUBREAPER
+PR_SET_DUMPABLE
+PR_SET_ENDIAN
+PR_SET_FPEMU
+PR_SET_FPEXC
+PR_SET_FP_MODE
+PR_SET_KEEPCAPS
+PR_SET_MM
+PR_SET_MM_ARG_END
+PR_SET_MM_ARG_START
+PR_SET_MM_AUXV
+PR_SET_MM_BRK
+PR_SET_MM_END_CODE
+PR_SET_MM_END_DATA
+PR_SET_MM_ENV_END
+PR_SET_MM_ENV_START
+PR_SET_MM_EXE_FILE
+PR_SET_MM_MAP
+PR_SET_MM_MAP_SIZE
+PR_SET_MM_START_BRK
+PR_SET_MM_START_CODE
+PR_SET_MM_START_DATA
+PR_SET_MM_START_STACK
+PR_SET_NAME
+PR_SET_NO_NEW_PRIVS
+PR_SET_PDEATHSIG
+PR_SET_PTRACER
+PR_SET_SECCOMP
+PR_SET_SECUREBITS
+PR_SET_THP_DISABLE
+PR_SET_TIMERSLACK
+PR_SET_TIMING
+PR_SET_TSC
+PR_SET_UNALIGN
+PR_TASK_PERF_EVENTS_DISABLE
+PR_TASK_PERF_EVENTS_ENABLE
+PR_TIMING_STATISTICAL
+PR_TIMING_TIMESTAMP
+PR_TSC_ENABLE
+PR_TSC_SIGSEGV
+PR_UNALIGN_NOPRINT
+PR_UNALIGN_SIGBUS
+PTHREAD_CREATE_DETACHED
+PTHREAD_CREATE_JOINABLE
+PTHREAD_MUTEX_DEFAULT
+PTHREAD_MUTEX_ERRORCHECK
+PTHREAD_PROCESS_PRIVATE
+PTHREAD_PROCESS_SHARED
+PTHREAD_STACK_MIN
+PTRACE_ATTACH
+PTRACE_CONT
+PTRACE_DETACH
+PTRACE_EVENT_CLONE
+PTRACE_EVENT_EXEC
+PTRACE_EVENT_EXIT
+PTRACE_EVENT_FORK
+PTRACE_EVENT_SECCOMP
+PTRACE_EVENT_STOP
+PTRACE_EVENT_VFORK
+PTRACE_EVENT_VFORK_DONE
+PTRACE_GETEVENTMSG
+PTRACE_GETREGSET
+PTRACE_GETSIGINFO
+PTRACE_INTERRUPT
+PTRACE_KILL
+PTRACE_LISTEN
+PTRACE_O_EXITKILL
+PTRACE_O_MASK
+PTRACE_O_SUSPEND_SECCOMP
+PTRACE_O_TRACECLONE
+PTRACE_O_TRACEEXEC
+PTRACE_O_TRACEEXIT
+PTRACE_O_TRACEFORK
+PTRACE_O_TRACESECCOMP
+PTRACE_O_TRACESYSGOOD
+PTRACE_O_TRACEVFORK
+PTRACE_O_TRACEVFORKDONE
+PTRACE_PEEKDATA
+PTRACE_PEEKSIGINFO
+PTRACE_PEEKTEXT
+PTRACE_PEEKUSER
+PTRACE_POKEDATA
+PTRACE_POKETEXT
+PTRACE_POKEUSER
+PTRACE_SEIZE
+PTRACE_SETOPTIONS
+PTRACE_SETREGSET
+PTRACE_SETSIGINFO
+PTRACE_SINGLESTEP
+PTRACE_SYSCALL
+PTRACE_TRACEME
+PT_DYNAMIC
+PT_GNU_EH_FRAME
+PT_GNU_RELRO
+PT_GNU_STACK
+PT_INTERP
+PT_LOAD
+PT_LOOS
+PT_NOTE
+PT_NULL
+PT_NUM
+PT_PHDR
+PT_SHLIB
+PT_TLS
+P_ALL
+P_PGID
+P_PID
+P_PIDFD
+QCMD
+QFMT_VFS_OLD
+QFMT_VFS_V0
+QFMT_VFS_V1
+QIF_ALL
+QIF_BLIMITS
+QIF_BTIME
+QIF_ILIMITS
+QIF_INODES
+QIF_ITIME
+QIF_LIMITS
+QIF_SPACE
+QIF_TIMES
+QIF_USAGE
+Q_GETFMT
+Q_GETINFO
+Q_GETQUOTA
+Q_QUOTAOFF
+Q_QUOTAON
+Q_SETINFO
+Q_SETQUOTA
+Q_SYNC
+RADIXCHAR
+RAND_MAX
+RB_AUTOBOOT
+RB_DISABLE_CAD
+RB_ENABLE_CAD
+RB_HALT_SYSTEM
+RB_KEXEC
+RB_POWER_OFF
+RB_SW_SUSPEND
+READ_IMPLIES_EXEC
+REG_BADBR
+REG_BADPAT
+REG_BADRPT
+REG_EBRACE
+REG_EBRACK
+REG_ECOLLATE
+REG_ECTYPE
+REG_EESCAPE
+REG_ENOSYS
+REG_EPAREN
+REG_ERANGE
+REG_ESPACE
+REG_ESUBREG
+REG_EXTENDED
+REG_ICASE
+REG_NEWLINE
+REG_NOMATCH
+REG_NOSUB
+REG_NOTBOL
+REG_NOTEOL
+REL_CNT
+REL_MAX
+RENAME_EXCHANGE
+RENAME_NOREPLACE
+RENAME_WHITEOUT
+REP_CNT
+REP_MAX
+RLIMIT_AS
+RLIMIT_CORE
+RLIMIT_CPU
+RLIMIT_DATA
+RLIMIT_FSIZE
+RLIMIT_LOCKS
+RLIMIT_MEMLOCK
+RLIMIT_MSGQUEUE
+RLIMIT_NICE
+RLIMIT_NLIMITS
+RLIMIT_NOFILE
+RLIMIT_NPROC
+RLIMIT_RSS
+RLIMIT_RTPRIO
+RLIMIT_RTTIME
+RLIMIT_SIGPENDING
+RLIMIT_STACK
+RLIM_INFINITY
+RLIM_SAVED_CUR
+RLIM_SAVED_MAX
+RTA_CACHEINFO
+RTA_DST
+RTA_FLOW
+RTA_GATEWAY
+RTA_IIF
+RTA_MARK
+RTA_METRICS
+RTA_MFC_STATS
+RTA_MP_ALGO
+RTA_MULTIPATH
+RTA_PREFSRC
+RTA_PRIORITY
+RTA_PROTOINFO
+RTA_SESSION
+RTA_SRC
+RTA_TABLE
+RTCF_DIRECTSRC
+RTCF_DOREDIRECT
+RTCF_LOG
+RTCF_MASQ
+RTCF_NAT
+RTCF_VALVE
+RTF_ADDRCLASSMASK
+RTF_ADDRCONF
+RTF_ALLONLINK
+RTF_BROADCAST
+RTF_CACHE
+RTF_DEFAULT
+RTF_DYNAMIC
+RTF_FLOW
+RTF_GATEWAY
+RTF_HOST
+RTF_INTERFACE
+RTF_IRTT
+RTF_LINKRT
+RTF_LOCAL
+RTF_MODIFIED
+RTF_MSS
+RTF_MTU
+RTF_MULTICAST
+RTF_NAT
+RTF_NOFORWARD
+RTF_NONEXTHOP
+RTF_NOPMTUDISC
+RTF_POLICY
+RTF_REINSTATE
+RTF_REJECT
+RTF_STATIC
+RTF_THROW
+RTF_UP
+RTF_WINDOW
+RTF_XRESOLVE
+RTLD_NEXT
+RTLD_NODELETE
+RTLD_NOLOAD
+RTMSG_AR_FAILED
+RTMSG_CONTROL
+RTMSG_DELDEVICE
+RTMSG_DELROUTE
+RTMSG_DELRULE
+RTMSG_NEWDEVICE
+RTMSG_NEWROUTE
+RTMSG_NEWRULE
+RTMSG_OVERRUN
+RTM_DELACTION
+RTM_DELADDR
+RTM_DELADDRLABEL
+RTM_DELLINK
+RTM_DELMDB
+RTM_DELNEIGH
+RTM_DELNSID
+RTM_DELQDISC
+RTM_DELROUTE
+RTM_DELRULE
+RTM_DELTCLASS
+RTM_DELTFILTER
+RTM_F_CLONED
+RTM_F_EQUALIZE
+RTM_F_NOTIFY
+RTM_F_PREFIX
+RTM_GETACTION
+RTM_GETADDR
+RTM_GETADDRLABEL
+RTM_GETANYCAST
+RTM_GETDCB
+RTM_GETLINK
+RTM_GETMDB
+RTM_GETMULTICAST
+RTM_GETNEIGH
+RTM_GETNEIGHTBL
+RTM_GETNETCONF
+RTM_GETNSID
+RTM_GETQDISC
+RTM_GETROUTE
+RTM_GETRULE
+RTM_GETTCLASS
+RTM_GETTFILTER
+RTM_NEWACTION
+RTM_NEWADDR
+RTM_NEWADDRLABEL
+RTM_NEWLINK
+RTM_NEWMDB
+RTM_NEWNDUSEROPT
+RTM_NEWNEIGH
+RTM_NEWNEIGHTBL
+RTM_NEWNETCONF
+RTM_NEWNSID
+RTM_NEWPREFIX
+RTM_NEWQDISC
+RTM_NEWROUTE
+RTM_NEWRULE
+RTM_NEWTCLASS
+RTM_NEWTFILTER
+RTM_SETDCB
+RTM_SETLINK
+RTM_SETNEIGHTBL
+RTN_ANYCAST
+RTN_BLACKHOLE
+RTN_BROADCAST
+RTN_LOCAL
+RTN_MULTICAST
+RTN_NAT
+RTN_PROHIBIT
+RTN_THROW
+RTN_UNICAST
+RTN_UNREACHABLE
+RTN_UNSPEC
+RTN_XRESOLVE
+RTPROT_BOOT
+RTPROT_KERNEL
+RTPROT_REDIRECT
+RTPROT_STATIC
+RTPROT_UNSPEC
+RT_ADDRCLASS
+RT_CLASS_DEFAULT
+RT_CLASS_LOCAL
+RT_CLASS_MAIN
+RT_CLASS_MAX
+RT_CLASS_UNSPEC
+RT_LOCALAD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ST_RDONLY
+ST_SYNCHRONOUS
+ST_WRITE
+SW_CNT
+SW_MAX
+SYNC_FILE_RANGE_WAIT_AFTER
+SYNC_FILE_RANGE_WAIT_BEFORE
+SYNC_FILE_RANGE_WRITE
+SYN_CNT
+SYN_MAX
+SYS_accept4
+SYS_acct
+SYS_add_key
+SYS_adjtimex
+SYS_bind
+SYS_bpf
+SYS_brk
+SYS_capget
+SYS_capset
+SYS_chdir
+SYS_chroot
+SYS_clock_adjtime
+SYS_clock_getres
+SYS_clock_gettime
+SYS_clock_nanosleep
+SYS_clock_settime
+SYS_clone
+SYS_clone3
+SYS_close
+SYS_connect
+SYS_copy_file_range
+SYS_delete_module
+SYS_dup
+SYS_dup3
+SYS_epoll_create1
+SYS_epoll_ctl
+SYS_epoll_pwait
+SYS_eventfd2
+SYS_execve
+SYS_execveat
+SYS_exit
+SYS_exit_group
+SYS_faccessat
+SYS_fallocate
+SYS_fanotify_init
+SYS_fanotify_mark
+SYS_fchdir
+SYS_fchmod
+SYS_fchmodat
+SYS_fchown
+SYS_fchownat
+SYS_fcntl
+SYS_fdatasync
+SYS_fgetxattr
+SYS_finit_module
+SYS_flistxattr
+SYS_flock
+SYS_fremovexattr
+SYS_fsetxattr
+SYS_fstat
+SYS_fstatfs
+SYS_fsync
+SYS_ftruncate
+SYS_futex
+SYS_get_mempolicy
+SYS_get_robust_list
+SYS_getcpu
+SYS_getcwd
+SYS_getdents64
+SYS_getegid
+SYS_geteuid
+SYS_getgid
+SYS_getgroups
+SYS_getitimer
+SYS_getpeername
+SYS_getpgid
+SYS_getpid
+SYS_getppid
+SYS_getpriority
+SYS_getrandom
+SYS_getresgid
+SYS_getresuid
+SYS_getrusage
+SYS_getsid
+SYS_getsockname
+SYS_getsockopt
+SYS_gettid
+SYS_gettimeofday
+SYS_getuid
+SYS_getxattr
+SYS_init_module
+SYS_inotify_add_watch
+SYS_inotify_init1
+SYS_inotify_rm_watch
+SYS_io_cancel
+SYS_io_destroy
+SYS_io_getevents
+SYS_io_setup
+SYS_io_submit
+SYS_ioctl
+SYS_ioprio_get
+SYS_ioprio_set
+SYS_kcmp
+SYS_kexec_load
+SYS_keyctl
+SYS_kill
+SYS_lgetxattr
+SYS_linkat
+SYS_listen
+SYS_listxattr
+SYS_llistxattr
+SYS_lookup_dcookie
+SYS_lremovexattr
+SYS_lseek
+SYS_lsetxattr
+SYS_madvise
+SYS_mbind
+SYS_membarrier
+SYS_memfd_create
+SYS_mincore
+SYS_mkdirat
+SYS_mknodat
+SYS_mlock
+SYS_mlock2
+SYS_mlockall
+SYS_mount
+SYS_move_pages
+SYS_mprotect
+SYS_mq_getsetattr
+SYS_mq_notify
+SYS_mq_open
+SYS_mq_timedreceive
+SYS_mq_timedsend
+SYS_mq_unlink
+SYS_mremap
+SYS_msync
+SYS_munlock
+SYS_munlockall
+SYS_munmap
+SYS_name_to_handle_at
+SYS_nanosleep
+SYS_open_by_handle_at
+SYS_openat
+SYS_perf_event_open
+SYS_personality
+SYS_pidfd_open
+SYS_pipe2
+SYS_pivot_root
+SYS_ppoll
+SYS_prctl
+SYS_preadv
+SYS_preadv2
+SYS_prlimit64
+SYS_process_vm_readv
+SYS_process_vm_writev
+SYS_pselect6
+SYS_ptrace
+SYS_pwritev
+SYS_pwritev2
+SYS_quotactl
+SYS_read
+SYS_readahead
+SYS_readlinkat
+SYS_readv
+SYS_reboot
+SYS_recvfrom
+SYS_recvmmsg
+SYS_recvmsg
+SYS_remap_file_pages
+SYS_removexattr
+SYS_renameat2
+SYS_request_key
+SYS_restart_syscall
+SYS_rt_sigaction
+SYS_rt_sigpending
+SYS_rt_sigprocmask
+SYS_rt_sigqueueinfo
+SYS_rt_sigreturn
+SYS_rt_sigsuspend
+SYS_rt_sigtimedwait
+SYS_rt_tgsigqueueinfo
+SYS_sched_get_priority_max
+SYS_sched_get_priority_min
+SYS_sched_getaffinity
+SYS_sched_getattr
+SYS_sched_getparam
+SYS_sched_getscheduler
+SYS_sched_rr_get_interval
+SYS_sched_setaffinity
+SYS_sched_setattr
+SYS_sched_setparam
+SYS_sched_setscheduler
+SYS_sched_yield
+SYS_seccomp
+SYS_sendmmsg
+SYS_sendmsg
+SYS_sendto
+SYS_set_mempolicy
+SYS_set_robust_list
+SYS_set_tid_address
+SYS_setdomainname
+SYS_setfsgid
+SYS_setfsuid
+SYS_setgid
+SYS_setgroups
+SYS_sethostname
+SYS_setitimer
+SYS_setns
+SYS_setpgid
+SYS_setpriority
+SYS_setregid
+SYS_setresgid
+SYS_setresuid
+SYS_setreuid
+SYS_setrlimit
+SYS_setsid
+SYS_setsockopt
+SYS_settimeofday
+SYS_setuid
+SYS_setxattr
+SYS_shutdown
+SYS_sigaltstack
+SYS_signalfd4
+SYS_socket
+SYS_socketpair
+SYS_splice
+SYS_statfs
+SYS_statx
+SYS_swapoff
+SYS_swapon
+SYS_symlinkat
+SYS_sync
+SYS_syncfs
+SYS_sysinfo
+SYS_syslog
+SYS_tee
+SYS_tgkill
+SYS_timer_create
+SYS_timer_delete
+SYS_timer_getoverrun
+SYS_timer_gettime
+SYS_timer_settime
+SYS_timerfd_create
+SYS_timerfd_gettime
+SYS_timerfd_settime
+SYS_times
+SYS_tkill
+SYS_truncate
+SYS_umask
+SYS_umount2
+SYS_uname
+SYS_unlinkat
+SYS_unshare
+SYS_userfaultfd
+SYS_utimensat
+SYS_vhangup
+SYS_vmsplice
+SYS_wait4
+SYS_waitid
+SYS_write
+SYS_writev
+S_IEXEC
+S_IREAD
+S_IWRITE
+TAB0
+TAB1
+TAB2
+TAB3
+TABDLY
+TCA_KIND
+TCA_OPTIONS
+TCA_RATE
+TCA_STAB
+TCA_STATS
+TCA_STATS2
+TCA_UNSPEC
+TCA_XSTATS
+TCFLSH
+TCGETA
+TCGETS
+TCP_CONGESTION
+TCP_COOKIE_TRANSACTIONS
+TCP_CORK
+TCP_DEFER_ACCEPT
+TCP_FASTOPEN
+TCP_FASTOPEN_CONNECT
+TCP_INFO
+TCP_KEEPCNT
+TCP_KEEPIDLE
+T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_SC_PHYS_PAGES
+_SC_PRIORITIZED_IO
+_SC_PRIORITY_SCHEDULING
+_SC_RAW_SOCKETS
+_SC_READER_WRITER_LOCKS
+_SC_REALTIME_SIGNALS
+_SC_REGEXP
+_SC_RTSIG_MAX
+_SC_SAVED_IDS
+_SC_SEMAPHORES
+_SC_SEM_NSEMS_MAX
+_SC_SEM_VALUE_MAX
+_SC_SHARED_MEMORY_OBJECTS
+_SC_SHELL
+_SC_SPAWN
+_SC_SPIN_LOCKS
+_SC_SPORADIC_SERVER
+_SC_SS_REPL_MAX
+_SC_STREAMS
+_SC_SYNCHRONIZED_IO
+_SC_THREADS
+_SC_THREAD_ATTR_STACKADDR
+_SC_THREAD_ATTR_STACKSIZE
+_SC_THREAD_CPUTIME
+_SC_THREAD_DESTRUCTOR_ITERATIONS
+_SC_THREAD_KEYS_MAX
+_SC_THREAD_PRIORITY_SCHEDULING
+_SC_THREAD_PRIO_INHERIT
+_SC_THREAD_PRIO_PROTECT
+_SC_THREAD_PROCESS_SHARED
+_SC_THREAD_ROBUST_PRIO_INHERIT
+_SC_THREAD_ROBUST_PRIO_PROTECT
+_SC_THREAD_SAFE_FUNCTIONS
+_SC_THREAD_SPORADIC_SERVER
+_SC_THREAD_STACK_MIN
+_SC_THREAD_THREADS_MAX
+_SC_TIMEOUTS
+_SC_TIMERS
+_SC_TIMER_MAX
+_SC_TRACE
+_SC_TRACE_EVENT_FILTER
+_SC_TRACE_EVENT_NAME_MAX
+_SC_TRACE_INHERIT
+_SC_TRACE_LOG
+_SC_TRACE_NAME_MAX
+_SC_TRACE_SYS_MAX
+_SC_TRACE_USER_EVENT_MAX
+_SC_TYPED_MEMORY_OBJECTS
+_SC_V6_ILP32_OFF32
+_SC_V6_ILP32_OFFBIG
+_SC_V6_LP64_OFF64
+_SC_V6_LPBIG_OFFBIG
+_SC_V7_ILP32_OFF32
+_SC_V7_ILP32_OFFBIG
+_SC_V7_LP64_OFF64
+_SC_V7_LPBIG_OFFBIG
+_SC_XBS5_ILP32_OFF32
+_SC_XBS5_ILP32_OFFBIG
+_SC_XBS5_LP64_OFF64
+_SC_XBS5_LPBIG_OFFBIG
+_SC_XOPEN_CRYPT
+_SC_XOPEN_ENH_I18N
+_SC_XOPEN_LEGACY
+_SC_XOPEN_REALTIME
+_SC_XOPEN_REALTIME_THREADS
+_SC_XOPEN_SHM
+_SC_XOPEN_STREAMS
+_SC_XOPEN_UNIX
+_SC_XOPEN_VERSION
+_SC_XOPEN_XCU_VERSION
+_SC_XOPEN_XPG2
+_SC_XOPEN_XPG3
+_SC_XOPEN_XPG4
+__SIZEOF_PTHREAD_CONDATTR_T
+__SIZEOF_PTHREAD_COND_T
+__SIZEOF_PTHREAD_MUTEXATTR_T
+__SIZEOF_PTHREAD_MUTEX_T
+__SIZEOF_PTHREAD_RWLOCKATTR_T
+__SIZEOF_PTHREAD_RWLOCK_T
+__WALL
+__WCLONE
+__WNOTHREAD
+__c_anonymous_sockaddr_can_can_addr
+__c_anonymous_sockaddr_can_j1939
+__c_anonymous_sockaddr_can_tp
+__errno_location
+__exit_status
+__s16
+__s32
+__u16
+__u32
+__u64
+__u8
+abs
+accept4
+acct
+addmntent
+af_alg_iv
+aio_cancel
+aio_error
+aio_fsync
+aio_read
+aio_return
+aio_suspend
+aio_write
+aiocb
+arpd_request
+arphdr
+arpreq
+arpreq_old
+atof
+blkcnt64_t
+brk
+bsearch
+can_err_mask_t
+can_filter
+can_frame
+canfd_frame
+canid_t
+chroot
+clearenv
+clearerr
+clock_getcpuclockid
+clock_getres
+clock_nanosleep
+clock_settime
+clone
+cmsghdr
+cpu_set_t
+creat64
+daemon
+difftime
+dirent64
+dirfd
+dl_iterate_phdr
+dl_phdr_info
+dqblk
+dup3
+duplocale
+endgrent
+endmntent
+endpwent
+endservent
+endspent
+epoll_create
+epoll_create1
+epoll_ctl
+epoll_event
+epoll_pwait
+epoll_wait
+eventfd
+execvpe
+faccessat
+fallocate
+fallocate64
+fanotify_event_metadata
+fanotify_init
+fanotify_mark
+fanotify_response
+fchdir
+fdatasync
+fdopendir
+fexecve
+ff_condition_effect
+ff_constant_effect
+ff_effect
+ff_envelope
+ff_periodic_effect
+ff_ramp_effect
+ff_replay
+ff_rumble_effect
+ff_trigger
+fgetpos64
+fgetxattr
+flistxattr
+fmemopen
+fopen64
+forkpty
+fpos64_t
+fread_unlocked
+freeifaddrs
+freelocale
+fremovexattr
+freopen64
+fseeko64
+fsetpos64
+fsetxattr
+fsid_t
+fstat64
+fstatat64
+fstatfs
+fstatfs64
+fstatvfs64
+ftello64
+ftok
+ftruncate64
+futimes
+genlmsghdr
+getauxval
+getdomainname
+getdtablesize
+getgrent
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+getifaddrs
+getline
+getloadavg
+getmntent
+getnameinfo
+getpriority
+getpwent
+getresgid
+getresuid
+getrlimit
+getrlimit64
+getrusage
+getservbyport
+getservent
+getsid
+getspent
+getspnam
+getspnam_r
+gettid
+getxattr
+hasmntopt
+iconv
+iconv_close
+iconv_open
+iconv_t
+id_t
+idtype_t
+if_freenameindex
+if_nameindex
+ifaddrs
+in6_pktinfo
+in6_rtmsg
+in_pktinfo
+initgroups
+ino64_t
+inotify_add_watch
+inotify_event
+inotify_init
+inotify_init1
+inotify_rm_watch
+input_absinfo
+input_event
+input_id
+input_keymap_entry
+input_mask
+ip_mreq_source
+ipc_perm
+itimerspec
+key_t
+killpg
+labs
+lgetxattr
+lio_listio
+listxattr
+llistxattr
+lockf
+loff_t
+login_tty
+lremovexattr
+lseek64
+lsetxattr
+lstat64
+lutimes
+madvise
+major
+makedev
+memalign
+memmem
+memrchr
+mincore
+minor
+mkdirat
+mkfifoat
+mknodat
+mkostemp
+mkostemps
+mkstemps
+mmap64
+mmsghdr
+mntent
+mount
+mq_attr
+mq_close
+mq_getattr
+mq_open
+mq_receive
+mq_send
+mq_setattr
+mq_timedreceive
+mq_timedsend
+mq_unlink
+mqd_t
+mremap
+msgctl
+msgget
+msghdr
+msginfo
+msglen_t
+msgqnum_t
+msgrcv
+msgsnd
+msqid_ds
+newlocale
+nice
+nl_item
+nl_langinfo
+nl_langinfo_l
+nlattr
+nlmsgerr
+nlmsghdr
+off64_t
+open64
+open_memstream
+open_wmemstream
+openat
+openat64
+openpty
+packet_mreq
+pause
+personality
+pipe2
+popen
+posix_fadvise
+posix_fadvise64
+posix_fallocate
+posix_fallocate64
+posix_madvise
+posix_spawn
+posix_spawn_file_actions_addclose
+posix_spawn_file_actions_adddup2
+posix_spawn_file_actions_addopen
+posix_spawn_file_actions_destroy
+posix_spawn_file_actions_init
+posix_spawn_file_actions_t
+posix_spawnattr_destroy
+posix_spawnattr_getflags
+posix_spawnattr_getpgroup
+posix_spawnattr_getschedparam
+posix_spawnattr_getschedpolicy
+posix_spawnattr_getsigdefault
+posix_spawnattr_getsigmask
+posix_spawnattr_init
+posix_spawnattr_setflags
+posix_spawnattr_setpgroup
+posix_spawnattr_setschedparam
+posix_spawnattr_setschedpolicy
+posix_spawnattr_setsigdefault
+posix_spawnattr_setsigmask
+posix_spawnattr_t
+posix_spawnp
+ppoll
+prctl
+pread64
+preadv
+preadv64
+prlimit
+prlimit64
+process_vm_readv
+process_vm_writev
+pthread_attr_getguardsize
+pthread_attr_getstack
+pthread_cancel
+pthread_condattr_getclock
+pthread_condattr_getpshared
+pthread_condattr_setclock
+pthread_condattr_setpshared
+pthread_getaffinity_np
+pthread_getattr_np
+pthread_getschedparam
+pthread_kill
+pthread_mutex_timedlock
+pthread_mutexattr_getpshared
+pthread_mutexattr_setpshared
+pthread_rwlockattr_setpshared
+pthread_setaffinity_np
+pthread_setschedparam
+pthread_setschedprio
+ptrace
+ptsname_r
+pwrite64
+pwritev
+pwritev64
+qsort
+quotactl
+rand
+readahead
+readdir64
+readdir64_r
+readdir_r
+readlinkat
+reboot
+recvmmsg
+recvmsg
+regcomp
+regerror
+regex_t
+regexec
+regfree
+regmatch_t
+regoff_t
+remap_file_pages
+removexattr
+rlim64_t
+rlimit64
+rtentry
+sbrk
+sched_get_priority_max
+sched_get_priority_min
+sched_getaffinity
+sched_getcpu
+sched_getparam
+sched_getscheduler
+sched_param
+sched_rr_get_interval
+sched_setaffinity
+sched_setparam
+sched_setscheduler
+seekdir
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_timedwait
+sem_unlink
+sembuf
+semctl
+semget
+semop
+sendfile
+sendfile64
+sendmmsg
+sendmsg
+setdomainname
+setfsgid
+setfsuid
+setgrent
+setgroups
+sethostname
+setmntent
+setns
+setpriority
+setpwent
+setregid
+setresgid
+setresuid
+setreuid
+setrlimit
+setrlimit64
+setservent
+setspent
+settimeofday
+shmat
+shmatt_t
+shmctl
+shmdt
+shmget
+shmid_ds
+sigaltstack
+sigevent
+siginfo_t
+signalfd
+signalfd_siginfo
+sigsuspend
+sigtimedwait
+sigwait
+sigwaitinfo
+sock_extended_err
+sockaddr_alg
+sockaddr_can
+sockaddr_ll
+sockaddr_nl
+sockaddr_vm
+splice
+spwd
+srand
+stack_t
+stat64
+statfs
+statfs64
+statvfs64
+strcasecmp
+strcasestr
+strncasecmp
+strndup
+strsignal
+swapoff
+swapon
+sync
+sync_file_range
+syscall
+sysinfo
+tee
+telldir
+timerfd_create
+timerfd_gettime
+timerfd_settime
+tmpfile64
+truncate
+truncate64
+ttyname_r
+ucred
+uinput_abs_setup
+uinput_ff_erase
+uinput_ff_upload
+uinput_setup
+uinput_user_dev
+umount
+umount2
+unshare
+useconds_t
+uselocale
+utimensat
+vfork
+vhangup
+vmsplice
+wait4
+waitid
diff --git a/libc-test/semver/macos.txt b/libc-test/semver/macos.txt
new file mode 100644
index 0000000000000..fb2107cd04183
--- /dev/null
+++ b/libc-test/semver/macos.txt
@@ -0,0 +1,5 @@
+__darwin_mmst_reg
+__darwin_x86_exception_state64
+__darwin_x86_float_state64
+__darwin_x86_thread_state64
+__darwin_xmm_reg
diff --git a/libc-test/semver/netbsd-aarch64.txt b/libc-test/semver/netbsd-aarch64.txt
new file mode 100644
index 0000000000000..d64531a1e97e1
--- /dev/null
+++ b/libc-test/semver/netbsd-aarch64.txt
@@ -0,0 +1,4 @@
+PT_GETFPREGS
+PT_GETREGS
+PT_SETFPREGS
+PT_SETREGS
diff --git a/libc-test/semver/netbsd-powerpc.txt b/libc-test/semver/netbsd-powerpc.txt
new file mode 100644
index 0000000000000..e91dfcf654403
--- /dev/null
+++ b/libc-test/semver/netbsd-powerpc.txt
@@ -0,0 +1,3 @@
+PT_GETREGS
+PT_SETREGS
+PT_STEP
diff --git a/libc-test/semver/netbsd-x86_64.txt b/libc-test/semver/netbsd-x86_64.txt
new file mode 100644
index 0000000000000..1f14a08847b71
--- /dev/null
+++ b/libc-test/semver/netbsd-x86_64.txt
@@ -0,0 +1,5 @@
+PT_GETFPREGS
+PT_GETREGS
+PT_SETFPREGS
+PT_SETREGS
+PT_STEP
diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt
new file mode 100644
index 0000000000000..297946960b7f1
--- /dev/null
+++ b/libc-test/semver/netbsd.txt
@@ -0,0 +1,1254 @@
+ABDAY_1
+ABDAY_2
+ABDAY_3
+ABDAY_4
+ABDAY_5
+ABDAY_6
+ABDAY_7
+ABMON_1
+ABMON_10
+ABMON_11
+ABMON_12
+ABMON_2
+ABMON_3
+ABMON_4
+ABMON_5
+ABMON_6
+ABMON_7
+ABMON_8
+ABMON_9
+ACCOUNTING
+AF_APPLETALK
+AF_ARP
+AF_BLUETOOTH
+AF_CCITT
+AF_CHAOS
+AF_CNT
+AF_COIP
+AF_DATAKIT
+AF_DECnet
+AF_DLI
+AF_E164
+AF_HYLINK
+AF_IEEE80211
+AF_IMPLINK
+AF_IPX
+AF_ISDN
+AF_ISO
+AF_LAT
+AF_LINK
+AF_LOCAL
+AF_MPLS
+AF_NATM
+AF_NS
+AF_OROUTE
+AF_OSI
+AF_PUP
+AF_ROUTE
+AF_SNA
+AIO_ALLDONE
+AIO_CANCELED
+AIO_NOTCANCELED
+ALTWERASE
+ALT_DIGITS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+CTL_MACHDEP
+CTL_MAXID
+CTL_MAXNAME
+CTL_MMAP
+CTL_NET
+CTL_PROC
+CTL_QUERY
+CTL_SECURITY
+CTL_UNSPEC
+CTL_USER
+CTL_VENDOR
+CTL_VFS
+CTL_VM
+DAY_1
+DAY_2
+DAY_3
+DAY_4
+DAY_5
+DAY_6
+DAY_7
+DCCP_CCID
+DCCP_CSLEN
+DCCP_FEATURE_ACKRATIO
+DCCP_FEATURE_ACKVECTOR
+DCCP_FEATURE_CC
+DCCP_FEATURE_CONN_NONCE
+DCCP_FEATURE_ECN
+DCCP_FEATURE_IDENTREG
+DCCP_FEATURE_LOSSWINDOW
+DCCP_FEATURE_MOBILITY
+DCCP_MAXSEG
+DCCP_MAX_OPTIONS
+DCCP_MAX_PKTS
+DCCP_NDP_LIMIT
+DCCP_OPT_ACK_VECTOR0
+DCCP_OPT_ACK_VECTOR1
+DCCP_OPT_BUF_CLOSED
+DCCP_OPT_CHANGE_L
+DCCP_OPT_CHANGE_R
+DCCP_OPT_CONFIRM_L
+DCCP_OPT_CONFIRM_R
+DCCP_OPT_DATACHECKSUM
+DCCP_OPT_DATA_DISCARD
+DCCP_OPT_ELAPSEDTIME
+DCCP_OPT_INIT_COOKIE
+DCCP_OPT_NDP_COUNT
+DCCP_OPT_PADDING
+DCCP_OPT_RECV_BUF_DROPS
+DCCP_OPT_SLOW_RECV
+DCCP_OPT_TIMESTAMP
+DCCP_OPT_TIMESTAMP_ECHO
+DCCP_REASON_BAD_COOKIE
+DCCP_REASON_BAD_SNAME
+DCCP_REASON_CLOSED
+DCCP_REASON_CONN_REF
+DCCP_REASON_FEA_ERR
+DCCP_REASON_FRUITLESS_NEG
+DCCP_REASON_INVALID
+DCCP_REASON_INV_MOVE
+DCCP_REASON_OPTION_ERR
+DCCP_REASON_UNANSW_CH
+DCCP_REASON_UNSPEC
+DCCP_SEQ_NUM_LIMIT
+DCCP_SERVICE
+DCCP_TYPE_ACK
+DCCP_TYPE_CLOSE
+DCCP_TYPE_CLOSEREQ
+DCCP_TYPE_DATA
+DCCP_TYPE_DATAACK
+DCCP_TYPE_MOVE
+DCCP_TYPE_REQUEST
+DCCP_TYPE_RESET
+DCCP_TYPE_RESPONSE
+DEAD_PROCESS
+DOWN_TIME
+DT_UNKNOWN
+D_FMT
+D_T_FMT
+EAI_AGAIN
+EAI_BADFLAGS
+EAI_FAIL
+EAI_FAMILY
+EAI_MEMORY
+EAI_NODATA
+EAI_NONAME
+EAI_OVERFLOW
+EAI_SERVICE
+EAI_SOCKTYPE
+EAUTH
+EBADRPC
+ECHOCTL
+ECHOKE
+ECHOPRT
+EFTYPE
+ELAST
+EMPTY
+ENEEDAUTH
+ENOATTR
+ENODATA
+ENOSR
+ENOSTR
+ENOTSUP
+EOF
+EPROCLIM
+EPROCUNAVAIL
+EPROGMISMATCH
+EPROGUNAVAIL
+ERA
+ERA_D_FMT
+ERA_D_T_FMT
+ERA_T_FMT
+ERPCMISMATCH
+ETIME
+EVFILT_AIO
+EVFILT_PROC
+EVFILT_READ
+EVFILT_SIGNAL
+EVFILT_TIMER
+EVFILT_VNODE
+EVFILT_WRITE
+EV_ADD
+EV_CLEAR
+EV_DELETE
+EV_DISABLE
+EV_DISPATCH
+EV_ENABLE
+EV_EOF
+EV_ERROR
+EV_FLAG1
+EV_ONESHOT
+EV_RECEIPT
+EV_SYSFLAGS
+EXTA
+EXTATTR_NAMESPACE_SYSTEM
+EXTATTR_NAMESPACE_USER
+EXTB
+EXTPROC
+Elf32_Addr
+Elf32_Half
+Elf32_Lword
+Elf32_Off
+Elf32_Phdr
+Elf32_Sword
+Elf32_Word
+Elf64_Addr
+Elf64_Half
+Elf64_Lword
+Elf64_Off
+Elf64_Phdr
+Elf64_Sword
+Elf64_Sxword
+Elf64_Word
+Elf64_Xword
+FIBMAP
+FILENAME_MAX
+FIOASYNC
+FIOGETBMAP
+FIOGETOWN
+FIONCLEX
+FIONREAD
+FIONSPACE
+FIONWRITE
+FIOSETOWN
+FLUSHO
+FOPE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_ECN_NOTECT
+IPV6_JOIN_GROUP
+IPV6_LEAVE_GROUP
+IPV6_PKTINFO
+IPV6_RECVPKTINFO
+IPV6_RECVTCLASS
+IPV6_TCLASS
+IP_HDRINCL
+IP_PKTINFO
+IP_RECVDSTADDR
+IP_RECVIF
+IP_RECVPKTINFO
+IP_SENDSRCADDR
+IP_TOS
+ITIMER_PROF
+ITIMER_REAL
+ITIMER_VIRTUAL
+KERN_ARGMAX
+KERN_ARND
+KERN_AUTONICETIME
+KERN_AUTONICEVAL
+KERN_BOOTTIME
+KERN_BUF
+KERN_CCPU
+KERN_CLOCKRATE
+KERN_CONSDEV
+KERN_CP_ID
+KERN_CP_TIME
+KERN_DEFCORENAME
+KERN_DOMAINNAME
+KERN_DRIVERS
+KERN_DUMP_ON_PANIC
+KERN_EVCNT
+KERN_FILE
+KERN_FILE2
+KERN_FORKFSLEEP
+KERN_FSCALE
+KERN_FSYNC
+KERN_HARDCLOCK_TICKS
+KERN_HOSTID
+KERN_HOSTNAME
+KERN_IOV_MAX
+KERN_JOB_CONTROL
+KERN_LABELOFFSET
+KERN_LABELSECTOR
+KERN_LOGIN_NAME_MAX
+KERN_LOGSIGEXIT
+KERN_LWP
+KERN_MAPPED_FILES
+KERN_MAXFILES
+KERN_MAXID
+KERN_MAXPARTITIONS
+KERN_MAXPHYS
+KERN_MAXPROC
+KERN_MAXPTYS
+KERN_MAXVNODES
+KERN_MBUF
+KERN_MEMLOCK
+KERN_MEMLOCK_RANGE
+KERN_MEMORY_PROTECTION
+KERN_MONOTONIC_CLOCK
+KERN_MSGBUF
+KERN_MSGBUFSIZE
+KERN_NGROUPS
+KERN_NTPTIME
+KERN_OBOOTTIME
+KERN_OLDSHORTCORENAME
+KERN_OLDSYSVIPC_INFO
+KERN_OLDSYSVMSG
+KERN_OLDSYSVSEM
+KERN_OLDSYSVSHM
+KERN_OSRELEASE
+KERN_OSREV
+KERN_OSTYPE
+KERN_PIPE
+KERN_POSIX1
+KERN_POSIX_BARRIERS
+KERN_POSIX_READER_WRITER_LOCKS
+KERN_POSIX_SEMAPHORES
+KERN_POSIX_SPIN_LOCKS
+KERN_POSIX_THREADS
+KERN_POSIX_TIMERS
+KERN_PROC
+KERN_PROC2
+KERN_PROC_ALL
+KERN_PROC_ARGS
+KERN_PROC_ARGV
+KERN_PROC_ENV
+KERN_PROC_GID
+KERN_PROC_NARGV
+KERN_PROC_NENV
+KERN_PROC_PATHNAME
+KERN_PROC_PGRP
+KERN_PROC_PID
+KERN_PROC_RGID
+KERN_PROC_RUID
+KERN_PROC_SESSION
+KERN_PROC_TTY
+KERN_PROC_UID
+KERN_PROF
+KERN_RAWPARTITION
+KERN_ROOT_DEVICE
+KERN_ROOT_PARTITION
+KERN_RTC_OFFSET
+KERN_SAVED_IDS
+KERN_SBMAX
+KERN_SECURELVL
+KERN_SOMAXKVA
+KERN_SYNCHRONIZED_IO
+KERN_SYSVIPC
+KERN_TIMEX
+KERN_TKSTAT
+KERN_URND
+KERN_VERIEXEC
+KERN_VERSION
+KERN_VNODE
+LC_ALL
+LC_ALL_MASK
+LC_COLLATE
+LC_COLLATE_MASK
+LC_CTYPE
+LC_CTYPE_MASK
+LC_MESSAGES
+LC_MESSAGES_MASK
+LC_MONETARY
+LC_MONETARY_MASK
+LC_NUMERIC
+LC_NUMERIC_MASK
+LC_TIME
+LC_TIME_MASK
+LIO_NOP
+LIO_NOWAIT
+LIO_READ
+LIO_WAIT
+LIO_WRITE
+LOCAL_CONNWAIT
+LOCAL_CREDS
+LOCAL_OCREDS
+LOCAL_PEEREID
+LOGIN_PROCESS
+LOG_AUTHPRIV
+LOG_CRON
+LOG_FTP
+LOG_NFACILITIES
+LOG_PERROR
+L_tmpnam
+MADV_DONTNEED
+MADV_FREE
+MADV_NORMAL
+MADV_RANDOM
+MADV_SEQUENTIAL
+MADV_WILLNEED
+MAP_FILE
+MAP_HASSEMAPHORE
+MAP_NORESERVE
+MAP_RENAME
+MAP_WIRED
+MAXFREQ
+MAXPHASE
+MAX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CAL
+PF_MPLS
+PF_NATM
+PF_NS
+PF_OROUTE
+PF_OSI
+PF_PIP
+PF_PUP
+PF_ROUTE
+PF_RTIP
+PF_SNA
+PF_XTP
+PIOD_READ_AUXV
+PIOD_READ_D
+PIOD_READ_I
+PIOD_WRITE_D
+PIOD_WRITE_I
+PIPE_BUF
+PM_STR
+POLLRDBAND
+POLLRDNORM
+POLLWRBAND
+POLLWRNORM
+POSIX_MADV_DONTNEED
+POSIX_MADV_NORMAL
+POSIX_MADV_RANDOM
+POSIX_MADV_SEQUENTIAL
+POSIX_MADV_WILLNEED
+PTHREAD_CREATE_DETACHED
+PTHREAD_CREATE_JOINABLE
+PTHREAD_MUTEX_DEFAULT
+PTHREAD_MUTEX_ERRORCHECK
+PT_ATTACH
+PT_CONTINUE
+PT_DETACH
+PT_DUMPCORE
+PT_FIRSTMACH
+PT_GET_EVENT_MASK
+PT_GET_PROCESS_STATE
+PT_IO
+PT_KILL
+PT_LWPINFO
+PT_READ_D
+PT_READ_I
+PT_SET_EVENT_MASK
+PT_SYSCALL
+PT_SYSCALLEMU
+PT_TRACE_ME
+PT_WRITE_D
+PT_WRITE_I
+P_ALL
+P_PGID
+P_PID
+QCMD
+Q_GETQUOTA
+Q_QUOTAOFF
+Q_QUOTAON
+Q_SETQUOTA
+Q_SYNC
+RADIXCHAR
+RAND_MAX
+REG_ASSERT
+REG_ATOI
+REG_BACKR
+REG_BADBR
+REG_BADPAT
+REG_BADRPT
+REG_BASIC
+REG_DUMP
+REG_EBRACE
+REG_EBRACK
+REG_ECOLLATE
+REG_ECTYPE
+REG_EESCAPE
+REG_EMPTY
+REG_ENOSYS
+REG_EPAREN
+REG_ERANGE
+REG_ESPACE
+REG_ESUBREG
+REG_EXTENDED
+REG_ICASE
+REG_INVARG
+REG_ITOA
+REG_LARGE
+REG_NEWLINE
+REG_NOMATCH
+REG_NOSPEC
+REG_NOSUB
+REG_NOTBOL
+REG_NOTEOL
+REG_PEND
+REG_STARTEND
+REG_TRACE
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_AIO_MAX
+_SC_ASYNCHRONOUS_IO
+_SC_ATEXIT_MAX
+_SC_BARRIERS
+_SC_BC_BASE_MAX
+_SC_BC_DIM_MAX
+_SC_BC_SCALE_MAX
+_SC_BC_STRING_MAX
+_SC_CLOCK_SELECTION
+_SC_COLL_WEIGHTS_MAX
+_SC_CPUTIME
+_SC_DELAYTIMER_MAX
+_SC_EXPR_NEST_MAX
+_SC_FSYNC
+_SC_GETGR_R_SIZE_MAX
+_SC_GETPW_R_SIZE_MAX
+_SC_IOV_MAX
+_SC_JOB_CONTROL
+_SC_LINE_MAX
+_SC_MAPPED_FILES
+_SC_MEMLOCK
+_SC_MEMLOCK_RANGE
+_SC_MEMORY_PROTECTION
+_SC_MESSAGE_PASSING
+_SC_MONOTONIC_CLOCK
+_SC_MQ_OPEN_MAX
+_SC_MQ_PRIO_MAX
+_SC_NPROCESSORS_CONF
+_SC_NPROCESSORS_ONLN
+_SC_PASS_MAX
+_SC_PHYS_PAGES
+_SC_PRIORITY_SCHEDULING
+_SC_READER_WRITER_LOCKS
+_SC_REGEXP
+_SC_SAVED_IDS
+_SC_SCHED_PRI_MAX
+_SC_SCHED_PRI_MIN
+_SC_SCHED_RT_TS
+_SC_SEMAPHORES
+_SC_SEM_NSEMS_MAX
+_SC_SHARED_MEMORY_OBJECTS
+_SC_SHELL
+_SC_SPAWN
+_SC_SPIN_LOCKS
+_SC_SYNCHRONIZED_IO
+_SC_THREADS
+_SC_THREAD_ATTR_STACKADDR
+_SC_THREAD_ATTR_STACKSIZE
+_SC_THREAD_CPUTIME
+_SC_THREAD_DESTRUCTOR_ITERATIONS
+_SC_THREAD_KEYS_MAX
+_SC_THREAD_PRIORITY_SCHEDULING
+_SC_THREAD_PRIO_INHERIT
+_SC_THREAD_PRIO_PROTECT
+_SC_THREAD_PROCESS_SHARED
+_SC_THREAD_SAFE_FUNCTIONS
+_SC_THREAD_STACK_MIN
+_SC_THREAD_THREADS_MAX
+_SC_TIMERS
+_SC_TIMER_MAX
+_SC_V6_ILP32_OFF32
+_SC_V6_ILP32_OFFBIG
+_SC_V6_LP64_OFF64
+_SC_V6_LPBIG_OFFBIG
+_SC_XOPEN_SHM
+_UTX_HOSTSIZE
+_UTX_IDSIZE
+_UTX_LINESIZE
+_UTX_PADSIZE
+_UTX_USERSIZE
+__cpu_simple_lock_nv_t
+__errno
+__exit_status
+_lwp_self
+abs
+accept4
+acct
+aio_cancel
+aio_error
+aio_fsync
+aio_read
+aio_return
+aio_suspend
+aio_write
+aiocb
+arphdr
+atof
+bsearch
+chflags
+chroot
+clearerr
+clock_getres
+clock_nanosleep
+clock_settime
+cmsghdr
+daemon
+difftime
+dirfd
+dl_iterate_phdr
+dl_phdr_info
+dqblk
+dup3
+duplocale
+endgrent
+endpwent
+endservent
+endutent
+endutxent
+extattr_delete_fd
+extattr_delete_file
+extattr_delete_link
+extattr_get_fd
+extattr_get_file
+extattr_get_link
+extattr_namespace_to_string
+extattr_set_fd
+extattr_set_file
+extattr_set_link
+extattr_string_to_namespace
+faccessat
+fchdir
+fchflags
+fdatasync
+fdopendir
+fmemopen
+forkpty
+freeifaddrs
+freelocale
+fsid_t
+futimes
+getdomainname
+getdtablesize
+getgrent
+getgrent_r
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+getifaddrs
+getitimer
+getlastlogx
+getline
+getloadavg
+getnameinfo
+getpeereid
+getpriority
+getprogname
+getpwent
+getpwent_r
+getpwnam_r
+getrlimit
+getrusage
+getservbyport
+getservent
+getsid
+getutent
+getutmp
+getutmpx
+getutxent
+getutxid
+getutxline
+glob
+glob_t
+globfree
+iconv
+iconv_close
+iconv_open
+iconv_t
+id_t
+idtype_t
+if_data
+if_freenameindex
+if_msghdr
+if_nameindex
+ifaddrs
+in6_pktinfo
+in_pktinfo
+initgroups
+ipc_perm
+kevent
+key_t
+killpg
+kqueue
+labs
+lastlog
+lastlogx
+lchflags
+lio_listio
+localeconv_l
+lockf
+login_tty
+lutimes
+lwpid_t
+madvise
+memmem
+memrchr
+mincore
+mkdirat
+mkfifoat
+mknodat
+mkostemp
+mkostemps
+mkstemps
+mmsghdr
+mount
+mq_attr
+mq_close
+mq_getattr
+mq_notify
+mq_open
+mq_receive
+mq_send
+mq_setattr
+mq_timedreceive
+mq_timedsend
+mq_unlink
+mqd_t
+msghdr
+newlocale
+nice
+nl_item
+nl_langinfo
+ntp_adjtime
+ntp_gettime
+ntptimeval
+open_memstream
+open_wmemstream
+openat
+openpty
+pause
+pipe2
+popen
+posix_madvise
+preadv
+pseudo_AF_HDRCMPLT
+pseudo_AF_KEY
+pseudo_AF_PIP
+pseudo_AF_RTIP
+pseudo_AF_XTP
+pthread_attr_get_np
+pthread_attr_getguardsize
+pthread_attr_getstack
+pthread_cancel
+pthread_condattr_setclock
+pthread_getattr_np
+pthread_kill
+pthread_mutex_timedlock
+pthread_setname_np
+ptrace
+ptrace_io_desc
+pututxline
+pwritev
+qsort
+rand
+readdir_r
+readlinkat
+recvmmsg
+recvmsg
+regcomp
+regerror
+regex_t
+regexec
+regfree
+regmatch_t
+regoff_t
+seekdir
+sem
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_timedwait
+sem_unlink
+sendmmsg
+sendmsg
+setdomainname
+setgrent
+setgroups
+sethostname
+setitimer
+setpriority
+setprogname
+setpwent
+setrlimit
+setservent
+settimeofday
+setutent
+setutxent
+shmat
+shmatt_t
+shmctl
+shmdt
+shmget
+shmid_ds
+sigaltstack
+sigevent
+siginfo_t
+sigtimedwait
+sigwait
+sigwaitinfo
+sockaddr_dl
+sockcred
+srand
+stack_t
+strcasecmp
+strcasestr
+strncasecmp
+strndup
+strsignal
+sync
+syscall
+sysctl
+sysctlbyname
+telldir
+timex
+truncate
+ttyname_r
+unmount
+unpcbid
+updlastlogx
+updwtmpx
+useconds_t
+utimensat
+utmp
+utmpx
+utmpxname
+utpname
+vm_size_t
+wait4
diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt
new file mode 100644
index 0000000000000..0f8eeaab571c6
--- /dev/null
+++ b/libc-test/semver/openbsd.txt
@@ -0,0 +1,1073 @@
+ABDAY_1
+ABDAY_2
+ABDAY_3
+ABDAY_4
+ABDAY_5
+ABDAY_6
+ABDAY_7
+ABMON_1
+ABMON_10
+ABMON_11
+ABMON_12
+ABMON_2
+ABMON_3
+ABMON_4
+ABMON_5
+ABMON_6
+ABMON_7
+ABMON_8
+ABMON_9
+AF_APPLETALK
+AF_BLUETOOTH
+AF_CCITT
+AF_CHAOS
+AF_CNT
+AF_COIP
+AF_DATAKIT
+AF_DECnet
+AF_DLI
+AF_E164
+AF_ECMA
+AF_ENCAP
+AF_HYLINK
+AF_IMPLINK
+AF_IPX
+AF_ISDN
+AF_ISO
+AF_KEY
+AF_LAT
+AF_LINK
+AF_LOCAL
+AF_MPLS
+AF_NATM
+AF_NS
+AF_OSI
+AF_PUP
+AF_ROUTE
+AF_SIP
+AF_SNA
+ALTWERASE
+AM_STR
+ARPOP_REPLY
+ARPOP_REQUEST
+ATF_COM
+ATF_PERM
+ATF_PUBL
+ATF_USETRAILERS
+AT_EACCESS
+AT_FDCWD
+AT_REMOVEDIR
+AT_SYMLINK_FOLLOW
+AT_SYMLINK_NOFOLLOW
+B14400
+B28800
+B7200
+B76800
+BIOCFLUSH
+BIOCGBLEN
+BIOCGDLT
+BIOCGETIF
+BIOCGHDRCMPLT
+BIOCGRSIG
+BIOCGSTATS
+BIOCIMMEDIATE
+BIOCPROMISC
+BIOCSBLEN
+BIOCSDLT
+BIOCSETIF
+BIOCSHDRCMPLT
+BIOCSRSIG
+BIOCVERSION
+BUFSIZ
+CCTS_OFLOW
+CHWFLOW
+CIGNORE
+CLD_CONTINUED
+CLD_DUMPED
+CLD_EXITED
+CLD_KILLED
+CLD_STOPPED
+CLD_TRAPPED
+CMSG_DATA
+CMSG_FIRSTHDR
+CMSG_LEN
+CMSG_NXTHDR
+CMSG_SPACE
+CODESET
+CRNCYSTR
+CRTSCTS
+CRTS_IFLOW
+CTLTYPE_INT
+CTLTYPE_NODE
+CTLTYPE_QUAD
+CTLTYPE_STRING
+CTLTYPE_STRUCT
+CTL_DDB
+CTL_DEBUG
+CTL_FS
+CTL_HW
+CTL_KERN
+CTL_MACHDEP
+CTL_MAXID
+CTL_MAXNAME
+CTL_NET
+CTL_UNSPEC
+CTL_VFS
+CTL_VM
+DAY_1
+DAY_2
+DAY_3
+DAY_4
+DAY_5
+DAY_6
+DAY_7
+DT_UNKNOWN
+D_FMT
+D_T_FMT
+EAI_AGAIN
+EAI_BADFLAGS
+EAI_FAIL
+EAI_FAMILY
+EAI_MEMORY
+EAI_NODATA
+EAI_NONAME
+EAI_OVERFLOW
+EAI_SERVICE
+EAI_SOCKTYPE
+EAUTH
+EBADRPC
+ECHOCTL
+ECHOKE
+ECHOPRT
+EFTYPE
+EIPSEC
+ELAST
+EMEDIUMTYPE
+ENEEDAUTH
+ENOATTR
+ENOMEDIUM
+ENOTRECOVERABLE
+ENOTSUP
+EOF
+EOWNERDEAD
+EPROCLIM
+EPROCUNAVAIL
+EPROGMISMATCH
+EPROGUNAVAIL
+ERPCMISMATCH
+EVFILT_AIO
+EVFILT_PROC
+EVFILT_READ
+EVFILT_SIGNAL
+EVFILT_TIMER
+EVFILT_VNODE
+EVFILT_WRITE
+EV_ADD
+EV_CLEAR
+EV_DELETE
+EV_DISABLE
+EV_DISPATCH
+EV_ENABLE
+EV_EOF
+EV_ERROR
+EV_FLAG1
+EV_ONESHOT
+EV_RECEIPT
+EV_SYSFLAGS
+EXTA
+EXTB
+EXTPROC
+Elf32_Addr
+Elf32_Half
+Elf32_Lword
+Elf32_Off
+Elf32_Phdr
+Elf32_Sword
+Elf32_Word
+Elf64_Addr
+Elf64_Half
+Elf64_Lword
+Elf64_Off
+Elf64_Phdr
+Elf64_Sword
+Elf64_Sxword
+Elf64_Word
+Elf64_Xword
+FILENAME_MAX
+FIOASYNC
+FIOGETOWN
+FIONCLEX
+FIONREAD
+FIOSETOWN
+FLUSHO
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
+IPV6_TCLASS
+IP_HDRINCL
+IP_RECVDSTADDR
+IP_RECVIF
+IP_SENDSRCADDR
+IP_TOS
+ISOFSMNT_EXTATT
+ISOFSMNT_GENS
+ISOFSMNT_NOJOLIET
+ISOFSMNT_NORRIP
+ISOFSMNT_SESS
+ITIMER_PROF
+ITIMER_REAL
+ITIMER_VIRTUAL
+KERN_ARGMAX
+KERN_ARND
+KERN_AUDIO
+KERN_BOOTTIME
+KERN_CACHEPCT
+KERN_CCPU
+KERN_CLOCKRATE
+KERN_CONSBUF
+KERN_CONSBUFSIZE
+KERN_CONSDEV
+KERN_CPTIME
+KERN_CPTIME2
+KERN_CPUSTATS
+KERN_DOMAINNAME
+KERN_EVCOUNT
+KERN_FILE
+KERN_FORKSTAT
+KERN_FSCALE
+KERN_FSYNC
+KERN_GLOBAL_PTRACE
+KERN_HOSTID
+KERN_HOSTNAME
+KERN_INTRCNT
+KERN_JOB_CONTROL
+KERN_MALLOCSTATS
+KERN_MAXCLUSTERS
+KERN_MAXFILES
+KERN_MAXID
+KERN_MAXLOCKSPERUID
+KERN_MAXPARTITIONS
+KERN_MAXPROC
+KERN_MAXTHREAD
+KERN_MAXVNODES
+KERN_MBSTAT
+KERN_MSGBUF
+KERN_MSGBUFSIZE
+KERN_NCHSTATS
+KERN_NETLIVELOCKS
+KERN_NFILES
+KERN_NGROUPS
+KERN_NOSUIDCOREDUMP
+KERN_NPROCS
+KERN_NSELCOLL
+KERN_NTHREADS
+KERN_NUMVNODES
+KERN_OSRELEASE
+KERN_OSREV
+KERN_OSTYPE
+KERN_OSVERSION
+KERN_PFSTATUS
+KERN_POOL
+KERN_POOL_DEBUG
+KERN_POSIX1
+KERN_PROC
+KERN_PROC_ALL
+KERN_PROC_ARGS
+KERN_PROC_ARGV
+KERN_PROC_CWD
+KERN_PROC_ENV
+KERN_PROC_KTHREAD
+KERN_PROC_NARGV
+KERN_PROC_NENV
+KERN_PROC_NOBROADCASTKILL
+KERN_PROC_PGRP
+KERN_PROC_PID
+KERN_PROC_RUID
+KERN_PROC_SESSION
+KERN_PROC_SHOW_THREADS
+KERN_PROC_TTY
+KERN_PROC_UID
+KERN_PROC_VMMAP
+KERN_PROF
+KERN_RAWPARTITION
+KERN_SAVED_IDS
+KERN_SECURELVL
+KERN_SEMINFO
+KERN_SHMINFO
+KERN_SOMAXCONN
+KERN_SOMINCONN
+KERN_SPLASSERT
+KERN_STACKGAPRANDOM
+KERN_SYSVIPC_INFO
+KERN_SYSVIPC_MSG_INFO
+KERN_SYSVIPC_SEM_INFO
+KERN_SYSVIPC_SHM_INFO
+KERN_SYSVMSG
+KERN_SYSVSEM
+KERN_SYSVSHM
+KERN_TIMECOUNTER
+KERN_TIMEOUT_STATS
+KERN_TTY
+KERN_TTYCOUNT
+KERN_USERMOUNT
+KERN_VERSION
+KERN_WATCHDOG
+KI_EMULNAMELEN
+KI_MAXCOMLEN
+KI_MAXLOGNAME
+KI_NGROUPS
+KI_WMESGLEN
+LC_ALL
+LC_COLLATE
+LC_CTYPE
+LC_MESSAGES
+LC_MONETARY
+LC_NUMERIC
+LC_TIME
+LOG_AUTHPRIV
+LOG_CRON
+LOG_FTP
+LOG_NFACILITIES
+LOG_PERROR
+L_tmpnam
+MADV_DONTNEED
+MADV_FREE
+MADV_NORMAL
+MADV_RANDOM
+MADV_SEQUENTIAL
+MADV_WILLNEED
+MAP_COPY
+MAP_FILE
+MAP_HASSEMAPHORE
+MAP_NOEXTEND
+MAP_NORESERVE
+MAP_RENAME
+MAP_STACK
+MCL_CURRENT
+MCL_FUTURE
+MDMBUF
+MINSIGSTKSZ
+MNT_FORCE
+MON_1
+MON_10
+MON_11
+MON_12
+MON_2
+MON_3
+MON_4
+MON_5
+MON_6
+MON_7
+MON_8
+MON_9
+MSDOSFSMNT_LONGNAME
+MSDOSFSMNT_NOWIN95
+MSDOSFSMNT_SHORTNAME
+MSG_BCAST
+MSG_CMSG_CLOEXEC
+MSG_DONTWAIT
+MSG_MCAST
+MSG_NOSIGNAL
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OCK
+O_SYNC
+PENDIN
+PF_APPLETALK
+PF_BLUETOOTH
+PF_BPF
+PF_CCITT
+PF_CHAOS
+PF_CNT
+PF_COIP
+PF_DATAKIT
+PF_DECnet
+PF_DLI
+PF_ECMA
+PF_ENCAP
+PF_HYLINK
+PF_IMPLINK
+PF_IPX
+PF_ISDN
+PF_ISO
+PF_KEY
+PF_LAT
+PF_LINK
+PF_LOCAL
+PF_MPLS
+PF_NATM
+PF_NS
+PF_OSI
+PF_PFLOW
+PF_PIP
+PF_PIPEX
+PF_PUP
+PF_ROUTE
+PF_RTIP
+PF_SIP
+PF_SNA
+PF_XTP
+PIOD_READ_AUXV
+PIOD_READ_D
+PIOD_READ_I
+PIOD_WRITE_D
+PIOD_WRITE_I
+PIPE_BUF
+PM_STR
+POLLNORM
+POLLRDBAND
+POLLRDNORM
+POLLWRBAND
+POLLWRNORM
+POSIX_MADV_DONTNEED
+POSIX_MADV_NORMAL
+POSIX_MADV_RANDOM
+POSIX_MADV_SEQUENTIAL
+POSIX_MADV_WILLNEED
+PTHREAD_CREATE_DETACHED
+PTHREAD_CREATE_JOINABLE
+PTHREAD_MUTEX_DEFAULT
+PTHREAD_MUTEX_ERRORCHECK
+PTHREAD_MUTEX_STRICT_NP
+PTHREAD_STACK_MIN
+PTRACE_FORK
+PT_ATTACH
+PT_CONTINUE
+PT_DETACH
+PT_FIRSTMACH
+PT_IO
+PT_KILL
+PT_READ_D
+PT_READ_I
+PT_TRACE_ME
+PT_WRITE_D
+PT_WRITE_I
+QCMD
+Q_GETQUOTA
+Q_QUOTAOFF
+Q_QUOTAON
+Q_SETQUOTA
+Q_SYNC
+RADIXCHAR
+RAND_MAX
+REG_ASSERT
+REG_ATOI
+REG_BACKR
+REG_BADBR
+REG_BADPAT
+REG_BADRPT
+REG_BASIC
+REG_DUMP
+REG_EBRACE
+REG_EBRACK
+REG_ECOLLATE
+REG_ECTYPE
+REG_EESCAPE
+REG_EMPTY
+REG_EPAREN
+REG_ERANGE
+REG_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_GETGR_R_SIZE_MAX
+_SC_GETPW_R_SIZE_MAX
+_SC_IOV_MAX
+_SC_IPV6
+_SC_JOB_CONTROL
+_SC_LINE_MAX
+_SC_MAPPED_FILES
+_SC_MEMLOCK
+_SC_MEMLOCK_RANGE
+_SC_MEMORY_PROTECTION
+_SC_MESSAGE_PASSING
+_SC_MONOTONIC_CLOCK
+_SC_MQ_OPEN_MAX
+_SC_MQ_PRIO_MAX
+_SC_NPROCESSORS_CONF
+_SC_NPROCESSORS_ONLN
+_SC_PHYS_PAGES
+_SC_PRIORITIZED_IO
+_SC_PRIORITY_SCHEDULING
+_SC_RAW_SOCKETS
+_SC_READER_WRITER_LOCKS
+_SC_REALTIME_SIGNALS
+_SC_REGEXP
+_SC_RTSIG_MAX
+_SC_SAVED_IDS
+_SC_SEMAPHORES
+_SC_SEM_NSEMS_MAX
+_SC_SEM_VALUE_MAX
+_SC_SHARED_MEMORY_OBJECTS
+_SC_SHELL
+_SC_SIGQUEUE_MAX
+_SC_SPAWN
+_SC_SPIN_LOCKS
+_SC_SPORADIC_SERVER
+_SC_SS_REPL_MAX
+_SC_SYNCHRONIZED_IO
+_SC_THREADS
+_SC_THREAD_ATTR_STACKADDR
+_SC_THREAD_ATTR_STACKSIZE
+_SC_THREAD_CPUTIME
+_SC_THREAD_DESTRUCTOR_ITERATIONS
+_SC_THREAD_KEYS_MAX
+_SC_THREAD_PRIORITY_SCHEDULING
+_SC_THREAD_PRIO_INHERIT
+_SC_THREAD_PRIO_PROTECT
+_SC_THREAD_PROCESS_SHARED
+_SC_THREAD_ROBUST_PRIO_INHERIT
+_SC_THREAD_ROBUST_PRIO_PROTECT
+_SC_THREAD_SAFE_FUNCTIONS
+_SC_THREAD_SPORADIC_SERVER
+_SC_THREAD_STACK_MIN
+_SC_THREAD_THREADS_MAX
+_SC_TIMEOUTS
+_SC_TIMERS
+_SC_TIMER_MAX
+_SC_TRACE
+_SC_TRACE_EVENT_FILTER
+_SC_TRACE_EVENT_NAME_MAX
+_SC_TRACE_INHERIT
+_SC_TRACE_LOG
+_SC_TRACE_NAME_MAX
+_SC_TRACE_SYS_MAX
+_SC_TRACE_USER_EVENT_MAX
+_SC_TYPED_MEMORY_OBJECTS
+_SC_V6_ILP32_OFF32
+_SC_V6_ILP32_OFFBIG
+_SC_V6_LP64_OFF64
+_SC_V6_LPBIG_OFFBIG
+_SC_V7_ILP32_OFF32
+_SC_V7_ILP32_OFFBIG
+_SC_V7_LP64_OFF64
+_SC_V7_LPBIG_OFFBIG
+_SC_XOPEN_CRYPT
+_SC_XOPEN_ENH_I18N
+_SC_XOPEN_LEGACY
+_SC_XOPEN_REALTIME
+_SC_XOPEN_REALTIME_THREADS
+_SC_XOPEN_SHM
+_SC_XOPEN_STREAMS
+_SC_XOPEN_UNIX
+_SC_XOPEN_UUCP
+_SC_XOPEN_VERSION
+__errno
+abs
+accept4
+acct
+arphdr
+atof
+bsearch
+caddr_t
+chflags
+chflagsat
+chroot
+clearerr
+clock_getres
+clock_settime
+cmsghdr
+daemon
+difftime
+dirfd
+dl_iterate_phdr
+dl_phdr_info
+dup3
+endgrent
+endpwent
+endservent
+execvpe
+export_args
+faccessat
+fchdir
+fchflags
+fdatasync
+fdopendir
+fmemopen
+forkpty
+freeifaddrs
+fsid_t
+fstatfs
+fusefs_args
+futimes
+getdomainname
+getdtablesize
+getentropy
+getgrent
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+getifaddrs
+getitimer
+getline
+getloadavg
+getnameinfo
+getpeereid
+getpriority
+getprogname
+getpwent
+getpwnam_r
+getrlimit
+getrusage
+getservbyport
+getservent
+getsid
+glob
+glob_t
+globfree
+id_t
+if_data
+if_freenameindex
+if_msghdr
+if_nameindex
+ifaddrs
+in6_pktinfo
+initgroups
+ipc_perm
+iso_args
+kevent
+key_t
+killpg
+kqueue
+labs
+lastlog
+lockf
+login_tty
+madvise
+memmem
+memrchr
+mfs_args
+mincore
+mkdirat
+mkfifoat
+mknodat
+mkostemp
+mkostemps
+mkstemps
+mount_info
+msdosfs_args
+msghdr
+nfs_args
+nice
+nl_item
+nl_langinfo
+ntfs_args
+open_memstream
+open_wmemstream
+openat
+openpty
+pause
+pipe2
+pledge
+popen
+posix_madvise
+preadv
+pseudo_AF_HDRCMPLT
+pseudo_AF_PFLOW
+pseudo_AF_PIP
+pseudo_AF_PIPEX
+pseudo_AF_RTIP
+pseudo_AF_XTP
+pthread_attr_getguardsize
+pthread_attr_getstack
+pthread_cancel
+pthread_condattr_setclock
+pthread_kill
+pthread_main_np
+pthread_mutex_timedlock
+pthread_set_name_np
+pthread_stackseg_np
+ptrace
+ptrace_io_desc
+pwritev
+qsort
+rand
+readdir_r
+readlinkat
+recvmsg
+regcomp
+regerror
+regex_t
+regexec
+regfree
+regmatch_t
+regoff_t
+seekdir
+sem
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_timedwait
+sem_unlink
+sendmsg
+setdomainname
+setgrent
+setgroups
+sethostname
+setitimer
+setpriority
+setprogname
+setpwent
+setresgid
+setresuid
+setrlimit
+setservent
+settimeofday
+shmat
+shmctl
+shmdt
+shmget
+shmid_ds
+sigaltstack
+siginfo_t
+sigwait
+sockaddr_dl
+sockpeercred
+srand
+stack_t
+statfs
+strcasecmp
+strcasestr
+strncasecmp
+strndup
+strsignal
+strtonum
+sync
+syscall
+sysctl
+telldir
+tmpfs_args
+truncate
+ttyname_r
+udf_args
+ufs_args
+unmount
+useconds_t
+utimensat
+utmp
+wait4
+xucred
diff --git a/libc-test/semver/redox.txt b/libc-test/semver/redox.txt
new file mode 100644
index 0000000000000..53b64abccc862
--- /dev/null
+++ b/libc-test/semver/redox.txt
@@ -0,0 +1,184 @@
+ARPOP_REPLY
+ARPOP_REQUEST
+ATF_COM
+ATF_PERM
+ATF_PUBL
+ATF_USETRAILERS
+B1000000
+B1152000
+B1500000
+B2000000
+B2500000
+B3000000
+B3500000
+B4000000
+B460800
+B500000
+B576000
+B921600
+DT_UNKNOWN
+EADV
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ORCE
+SO_SNDBUFFORCE
+TCFLSH
+TCGETS
+TCP_KEEPIDLE
+TCSETS
+TIOCGPGRP
+TIOCSPGRP
+UTSLENGTH
+VSWTC
+VT0
+VT1
+VTDLY
+_PC_2_SYMLINKS
+_PC_ALLOC_SIZE_MIN
+_PC_ASYNC_IO
+_PC_FILESIZEBITS
+_PC_PRIO_IO
+_PC_REC_INCR_XFER_SIZE
+_PC_REC_MAX_XFER_SIZE
+_PC_REC_MIN_XFER_SIZE
+_PC_REC_XFER_ALIGN
+_PC_SOCK_MAXBUF
+_PC_SYMLINK_MAX
+_PC_SYNC_IO
+__WALL
+__WCLONE
+__WNOTHREAD
+__errno_location
+bsearch
+chroot
+clearerr
+difftime
+endservent
+epoll_create
+epoll_create1
+epoll_ctl
+epoll_event
+epoll_wait
+fchdir
+fmemopen
+getline
+getrlimit
+getrusage
+getservbyport
+getservent
+killpg
+lockf
+memalign
+nice
+open_memstream
+open_wmemstream
+pipe2
+pthread_condattr_setclock
+qsort
+setrlimit
+setservent
+strcasecmp
+strcasestr
+strncasecmp
+strndup
+strsignal
+ttyname_r
diff --git a/libc-test/semver/unix.txt b/libc-test/semver/unix.txt
new file mode 100644
index 0000000000000..71a600464b912
--- /dev/null
+++ b/libc-test/semver/unix.txt
@@ -0,0 +1,897 @@
+AF_INET
+AF_INET6
+AF_UNIX
+AF_UNSPEC
+B0
+B110
+B115200
+B1200
+B134
+B150
+B1800
+B19200
+B200
+B230400
+B2400
+B300
+B38400
+B4800
+B50
+B57600
+B600
+B75
+B9600
+BRKINT
+CLOCAL
+CLOCK_MONOTONIC
+CLOCK_REALTIME
+CREAD
+CS5
+CS6
+CS7
+CS8
+CSIZE
+CSTOPB
+DIR
+DT_BLK
+DT_CHR
+DT_DIR
+DT_FIFO
+DT_LNK
+DT_REG
+DT_SOCK
+Dl_info
+E2BIG
+EACCES
+EADDRINUSE
+EADDRNOTAVAIL
+EAFNOSUPPORT
+EAGAIN
+EAI_SYSTEM
+EALREADY
+EBAD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+access
+addrinfo
+alarm
+atexit
+atoi
+bind
+blkcnt_t
+blksize_t
+c_char
+c_double
+c_float
+c_int
+c_long
+c_longlong
+c_schar
+c_short
+c_uchar
+c_uint
+c_ulong
+c_ulonglong
+c_ushort
+c_void
+calloc
+cc_t
+cfgetispeed
+cfgetospeed
+cfmakeraw
+cfsetispeed
+cfsetospeed
+cfsetspeed
+chdir
+chmod
+chown
+clock_gettime
+clock_t
+clockid_t
+close
+closedir
+closelog
+connect
+creat
+dev_t
+dirent
+dladdr
+dlclose
+dlerror
+dlopen
+dlsym
+dup
+dup2
+execl
+execle
+execlp
+execv
+execve
+execvp
+exit
+fchmod
+fchmodat
+fchown
+fchownat
+fclose
+fcntl
+fd_set
+fdopen
+feof
+ferror
+fflush
+fgetc
+fgetpos
+fgets
+fileno
+flock
+fopen
+fork
+fpathconf
+fpos_t
+fprintf
+fputc
+fputs
+fread
+free
+freeaddrinfo
+freopen
+fsblkcnt_t
+fscanf
+fseek
+fseeko
+fsetpos
+fsfilcnt_t
+fstat
+fstatat
+fstatvfs
+fsync
+ftell
+ftello
+ftruncate
+futimens
+fwrite
+gai_strerror
+getaddrinfo
+getchar
+getchar_unlocked
+getcwd
+getegid
+getenv
+geteuid
+getgid
+getgroups
+gethostname
+getlogin
+getopt
+getpeername
+getpgid
+getpgrp
+getpid
+getppid
+getprotobyname
+getprotobynumber
+getpwnam
+getpwuid
+getservbyname
+getsockname
+getsockopt
+gettimeofday
+getuid
+gid_t
+gmtime
+gmtime_r
+grantpt
+group
+hostent
+if_indextoname
+if_nametoindex
+in6_addr
+in_addr
+in_addr_t
+in_port_t
+ino_t
+int16_t
+int32_t
+int64_t
+int8_t
+intmax_t
+intptr_t
+ioctl
+iovec
+ip_mreq
+ipv6_mreq
+isalnum
+isalpha
+isatty
+isblank
+iscntrl
+isdigit
+isgraph
+islower
+isprint
+ispunct
+isspace
+isupper
+isxdigit
+itimerval
+kill
+lchown
+lconv
+linger
+link
+linkat
+listen
+locale_t
+localeconv
+localtime
+localtime_r
+lseek
+lstat
+malloc
+memchr
+memcmp
+memcpy
+memmove
+memset
+mkdir
+mkdtemp
+mkfifo
+mknod
+mkstemp
+mktime
+mlock
+mlockall
+mmap
+mode_t
+mprotect
+msync
+munlock
+munlockall
+munmap
+nanosleep
+nfds_t
+nlink_t
+off_t
+open
+opendir
+openlog
+passwd
+pathconf
+pclose
+perror
+pid_t
+pipe
+poll
+pollfd
+posix_memalign
+posix_openpt
+pread
+printf
+protoent
+pselect
+pthread_attr_destroy
+pthread_attr_init
+pthread_attr_setdetachstate
+pthread_attr_setstacksize
+pthread_attr_t
+pthread_cond_broadcast
+pthread_cond_destroy
+pthread_cond_init
+pthread_cond_signal
+pthread_cond_t
+pthread_cond_timedwait
+pthread_cond_wait
+pthread_condattr_destroy
+pthread_condattr_init
+pthread_condattr_t
+pthread_create
+pthread_detach
+pthread_exit
+pthread_getspecific
+pthread_join
+pthread_key_create
+pthread_key_delete
+pthread_key_t
+pthread_mutex_destroy
+pthread_mutex_init
+pthread_mutex_lock
+pthread_mutex_t
+pthread_mutex_trylock
+pthread_mutex_unlock
+pthread_mutexattr_destroy
+pthread_mutexattr_init
+pthread_mutexattr_settype
+pthread_mutexattr_t
+pthread_rwlock_destroy
+pthread_rwlock_init
+pthread_rwlock_rdlock
+pthread_rwlock_t
+pthread_rwlock_tryrdlock
+pthread_rwlock_trywrlock
+pthread_rwlock_unlock
+pthread_rwlock_wrlock
+pthread_rwlockattr_destroy
+pthread_rwlockattr_init
+pthread_rwlockattr_t
+pthread_self
+pthread_setspecific
+pthread_t
+ptrdiff_t
+ptsname
+putchar
+putchar_unlocked
+putenv
+puts
+pwrite
+raise
+read
+readdir
+readlink
+readv
+realloc
+realpath
+recv
+recvfrom
+remove
+rename
+renameat
+res_init
+rewind
+rewinddir
+rlim_t
+rlimit
+rmdir
+rusage
+sa_family_t
+scanf
+sched_yield
+select
+sem_post
+sem_t
+sem_trywait
+sem_wait
+send
+sendto
+servent
+setbuf
+setegid
+setenv
+seteuid
+setgid
+setlocale
+setlogmask
+setpgid
+setsid
+setsockopt
+setuid
+setvbuf
+shm_open
+shm_unlink
+shutdown
+sigaction
+sigaddset
+sigdelset
+sigemptyset
+sigfillset
+sighandler_t
+sigismember
+signal
+sigpending
+sigprocmask
+sigset_t
+sigval
+size_t
+sleep
+snprintf
+sockaddr
+sockaddr_in
+sockaddr_in6
+sockaddr_storage
+sockaddr_un
+socket
+socketpair
+socklen_t
+speed_t
+sprintf
+sscanf
+ssize_t
+stat
+statvfs
+strcat
+strchr
+strcmp
+strcoll
+strcpy
+strcspn
+strdup
+strerror
+strerror_r
+strlen
+strncat
+strncmp
+strncpy
+strnlen
+strpbrk
+strrchr
+strspn
+strstr
+strtod
+strtok
+strtol
+strtoul
+strxfrm
+suseconds_t
+symlink
+symlinkat
+sysconf
+syslog
+system
+tcdrain
+tcflag_t
+tcflow
+tcflush
+tcgetattr
+tcgetpgrp
+tcgetsid
+tcsendbreak
+tcsetattr
+tcsetpgrp
+termios
+time
+time_t
+timegm
+times
+timespec
+timeval
+timezone
+tm
+tmpfile
+tmpnam
+tms
+tolower
+toupper
+ttyname
+uid_t
+uint16_t
+uint32_t
+uint64_t
+uint8_t
+uintmax_t
+uintptr_t
+umask
+uname
+ungetc
+unlink
+unlinkat
+unlockpt
+unsetenv
+usleep
+utimbuf
+utime
+utimes
+utsname
+wait
+waitpid
+wchar_t
+wcslen
+wcstombs
+winsize
+wmemchr
+write
+writev
diff --git a/libc-test/semver/windows-gnu.txt b/libc-test/semver/windows-gnu.txt
new file mode 100644
index 0000000000000..de63f991ab532
--- /dev/null
+++ b/libc-test/semver/windows-gnu.txt
@@ -0,0 +1,7 @@
+STDERR_FILENO
+STDIN_FILENO
+STDOUT_FILENO
+max_align_t
+strcasecmp
+strncasecmp
+wmemchr
diff --git a/libc-test/semver/windows-msvc.txt b/libc-test/semver/windows-msvc.txt
new file mode 100644
index 0000000000000..42dc8bede1385
--- /dev/null
+++ b/libc-test/semver/windows-msvc.txt
@@ -0,0 +1,3 @@
+EOTHER
+stricmp
+strnicmp
diff --git a/libc-test/semver/windows.txt b/libc-test/semver/windows.txt
new file mode 100644
index 0000000000000..6246edce65b45
--- /dev/null
+++ b/libc-test/semver/windows.txt
@@ -0,0 +1,327 @@
+BUFSIZ
+E2BIG
+EACCES
+EADDRINUSE
+EADDRNOTAVAIL
+EAFNOSUPPORT
+EAGAIN
+EALREADY
+EBADF
+EBADMSG
+EBUSY
+ECANCELED
+ECHILD
+ECONNABORTED
+ECONNREFUSED
+ECONNRESET
+EDEADLK
+EDEADLOCK
+EDESTADDRREQ
+EDOM
+EEXIST
+EFAULT
+EFBIG
+EHOSTUNREACH
+EIDRM
+EILSEQ
+EINPROGRESS
+EINTR
+EINVAL
+EIO
+EISCONN
+EISDIR
+ELOOP
+EMFILE
+EMLINK
+EMSGSIZE
+ENAMETOOLONG
+ENETDOWN
+ENETRESET
+ENETUNREACH
+ENFILE
+ENOBUFS
+ENODATA
+ENODEV
+ENOENT
+ENOEXEC
+ENOLCK
+ENOLINK
+ENOMEM
+ENOMSG
+ENOPROTOOPT
+ENOSPC
+ENOSR
+ENOSTR
+ENOSYS
+ENOTCONN
+ENOTDIR
+ENOTEMPTY
+ENOTRECOVERABLE
+ENOTSOCK
+ENOTSUP
+ENOTTY
+ENXIO
+EOF
+EOPNOTSUPP
+EOVERFLOW
+EOWNERDEAD
+EPERM
+EPIPE
+EPROTO
+EPROTONOSUPPORT
+EPROTOTYPE
+ERANGE
+EROFS
+ESPIPE
+ESRCH
+ETIME
+ETIMEDOUT
+ETXTBSY
+EWOULDBLOCK
+EXDEV
+EXIT_FAILURE
+EXIT_SUCCESS
+FILE
+FILENAME_MAX
+FOPEN_MAX
+INT_MAX
+INT_MIN
+LC_ALL
+LC_COLLATE
+LC_CTYPE
+LC_MONETARY
+LC_NUMERIC
+LC_TIME
+L_tmpnam
+NSIG
+O_APPEND
+O_BINARY
+O_CREAT
+O_EXCL
+O_NOINHERIT
+O_RDONLY
+O_RDWR
+O_TEXT
+O_TRUNC
+O_WRONLY
+RAND_MAX
+SEEK_CUR
+SEEK_END
+SEEK_SET
+SIGABRT
+SIGFPE
+SIGILL
+SIGINT
+SIGSEGV
+SIGTERM
+SIG_ERR
+SOCKET
+STRUNCATE
+S_IEXEC
+S_IFCHR
+S_IFDIR
+S_IFMT
+S_IFREG
+S_IREAD
+S_IWRITE
+TMP_MAX
+_IOFBF
+_IOLBF
+_IONBF
+_exit
+abort
+abs
+accept
+access
+aligned_malloc
+atexit
+atof
+atoi
+bind
+c_char
+c_double
+c_float
+c_int
+c_long
+c_longlong
+c_schar
+c_short
+c_uchar
+c_uint
+c_ulong
+c_ulonglong
+c_ushort
+c_void
+calloc
+chdir
+chmod
+clock_t
+close
+commit
+connect
+creat
+dev_t
+dup
+dup2
+execl
+execle
+execlp
+execlpe
+execv
+execve
+execvp
+execvpe
+exit
+fclose
+fdopen
+feof
+ferror
+fflush
+fgetc
+fgetpos
+fgets
+fileno
+fopen
+fpos_t
+fputc
+fputs
+fread
+free
+freopen
+fseek
+fsetpos
+fstat
+ftell
+fwrite
+get_osfhandle
+getchar
+getcwd
+getenv
+getpeername
+getpid
+getsockname
+getsockopt
+gmtime_s
+ino_t
+int16_t
+int32_t
+int64_t
+int8_t
+intmax_t
+intptr_t
+isalnum
+isalpha
+isatty
+isblank
+iscntrl
+isdigit
+isgraph
+islower
+isprint
+ispunct
+isspace
+isupper
+isxdigit
+labs
+listen
+lseek
+lseek64
+malloc
+memchr
+memcmp
+memcpy
+memmove
+memset
+mkdir
+off_t
+open
+open_osfhandle
+pclose
+perror
+pipe
+popen
+ptrdiff_t
+putchar
+puts
+raise
+rand
+read
+realloc
+recvfrom
+remove
+rename
+rewind
+rmdir
+sendto
+setbuf
+setlocale
+setsockopt
+setvbuf
+sighandler_t
+signal
+size_t
+sockaddr
+socket
+srand
+ssize_t
+stat
+strcat
+strchr
+strcmp
+strcoll
+strcpy
+strcspn
+strdup
+strerror
+strlen
+strncat
+strncmp
+strncpy
+strnlen
+strpbrk
+strrchr
+strspn
+strstr
+strtod
+strtok
+strtol
+strtoul
+strxfrm
+system
+time
+time64_t
+time_t
+timespec
+timeval
+timezone
+tm
+tmpfile
+tolower
+toupper
+uint16_t
+uint32_t
+uint64_t
+uint8_t
+uintmax_t
+uintptr_t
+ungetc
+unlink
+utimbuf
+wchar_t
+wchmod
+wcslen
+wcstombs
+wexecl
+wexecle
+wexeclp
+wexeclpe
+wexecv
+wexecve
+wexecvp
+wexecvpe
+wopen
+write
+wrmdir
+wsetlocale
+wstat
+wutime
diff --git a/libc-test/test/semver.rs b/libc-test/test/semver.rs
new file mode 100644
index 0000000000000..bc7d1c9c7954c
--- /dev/null
+++ b/libc-test/test/semver.rs
@@ -0,0 +1,12 @@
+#![allow(unused_imports)]
+#![allow(deprecated)]
+
+extern crate libc;
+
+// Generated in `build.rs`.
+include!(concat!(env!("OUT_DIR"), "/semver.rs"));
+
+fn main() {
+ // The test is about the imports created in `semver.rs`.
+ println!("PASSED 1 tests");
+}
|
Idea for regression test for accidental removal of definitions
I've been thinking about how to add regression tests for issues like #2101, wherein between versions 0.2.86 and 0.2.87 a system call was accidentally removed for a specific target. The structure for libc is quite complex with many `#[cfg]`s throughout the code base (for good reasons), this makes it quite easy to mistakenly remove an item for a target and not catch it in review.
Currently there is libc-test, which tests if a given definition in Rust is the same as in C. But this doesn't catch if a definition is removed between libc version.
So, now my idea. Keep around a list of definitions (functions, constants etc.) that are exported by libc in a text file (separate from the code base) for each OS/architecture combination. For example such a file for Android:
```text
# linux-android.txt
accept
accept4
SOCK_NONBLOCK
SOCK_CLOEXEC
# Etc...
```
To make architecture specific changes we can use a diff-like format: `+` for additional definitions, `-` for unsupported definitions.
```text
# arm-linux-androideabi.txt
-accept4 # Android on Arm doesn't support `accept4(2)` (Not true, just an example).
+accept6 # A system call only supported on Android on Arm (again just an example).
```
A build script could read these files for a given target, i.e. for the `arm-linux-androideabi` it would include both `linux-android.txt` and `arm-linux-androideabi.txt`, and convert it to a Rust test file. Such a test file would look something like the following:
```rust
#![allow(unused_imports)]
// Used files:
// linux-android.txt
// arm-linux-androideabi.txt
use libc::{
accept, // From linux-android.txt.
SOCK_NONBLOCK, // From linux-android.txt.
SOCK_CLOEXEC, // From linux-android.txt.
accept6, // From arm-linux-androideabi.txt.
// Etc...
};
```
If a definition is removed between versions the test file wouldn't build, and thus fail the test/CI.
This is just an idea I had, it might be too much work to maintain such lists of definitions. I can put in the work for the setup/build script, but I realise that that is not were most of the work is in.
|
This sounds like a great idea! We use `rusr-semverver` for this purpose but it doesn't make much sense currently. We, for example, sometimes move a declaration to the parent module but semverver complains about it (it's not a _breaking change_ for us), that's why we ignore its check on bors. But this approach doesn't have such a false positive so it'd be better.
|
2021-03-13T17:24:00Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 2,100
|
rust-lang__libc-2100
|
[
"2076"
] |
ec86e5fb3258a844ece771d2c6f0fbf152086eab
|
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index a005ee632f61a..f1d6ef4b2baf2 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -2809,6 +2809,8 @@ extern "C" {
pub fn regfree(preg: *mut ::regex_t);
pub fn android_set_abort_message(msg: *const ::c_char);
+
+ pub fn gettid() -> ::pid_t;
}
cfg_if! {
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index efd7a8ed8df15..ce71f1c7ef8ab 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -3594,6 +3594,8 @@ extern "C" {
outbytesleft: *mut ::size_t,
) -> ::size_t;
pub fn iconv_close(cd: iconv_t) -> ::c_int;
+
+ pub fn gettid() -> ::pid_t;
}
cfg_if! {
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 71b70632829e6..99763e29aa824 100755
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2737,6 +2737,9 @@ fn test_linux(target: &str) {
// assume it's a int instead.
"getnameinfo" if uclibc => true,
+ // FIXME: This needs musl 1.2.2 or later.
+ "gettid" if musl => true,
+
_ => false,
}
});
|
Add gettid() for Linux
I'm using x86_64-unknown-linux-gnu. I need to use `gettid()` in Rust, and it's not in this crate yet. It's got a simple signature:
https://man7.org/linux/man-pages/man2/gettid.2.html
It is Linux-specific. I could probably add it if it would help, but I'm not positive where to add it. From searching, it seems gnu, musl, uclibc, and Android include it, but I don't think Emscripten does (not sure).
I suppose it needs added in either
https://github.com/rust-lang/libc/blob/master/src/unix/linux_like/mod.rs
or in both
https://github.com/rust-lang/libc/blob/master/src/unix/linux_like/android/mod.rs
https://github.com/rust-lang/libc/blob/master/src/unix/linux_like/linux/mod.rs
And it seems like the tests are automatic so they wouldn't need changed?
|
You can go ahead with `linux_like/mod.rs` and check if CI complains about it.
> And it seems like the tests are automatic so they wouldn't need changed?
Yep, you're right.
|
2021-03-04T14:47:27Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 2,092
|
rust-lang__libc-2092
|
[
"2065"
] |
a6dc5bc088cb4a222e9847dc4232ac744d6e28b9
|
diff --git a/Cargo.toml b/Cargo.toml
index 65749ad55df01..63c045b8f3933 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "libc"
-version = "0.2.86"
+version = "0.2.87"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
|
diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml
index 0b23422f891ad..2c96556337dbd 100644
--- a/libc-test/Cargo.toml
+++ b/libc-test/Cargo.toml
@@ -1,11 +1,15 @@
[package]
name = "libc-test"
-version = "0.1.0"
-authors = ["Alex Crichton <alex@alexcrichton.com>"]
+version = "0.2.87"
+authors = ["The Rust Project Developers"]
+license = "MIT OR Apache-2.0"
build = "build.rs"
+repository = "https://github.com/rust-lang/libc"
+homepage = "https://github.com/rust-lang/libc"
[dependencies.libc]
path = ".."
+version = "0.2.87"
default-features = false
[build-dependencies]
|
Publish `libc-test` on crates.io
Right now, `libc-test` only exists as a subdirectory of this repository. In Android, we've been using crates.io as our primary source of third party packages, and it would be nice for `libc-test` to not be an exception. This would make it easier for us to enable CI of the libc crate within the Android Open Source Project.
|
You should use `ctest2` for that case. `libc-test` isn't for external use and it has many tests for other platforms that are redundant for your case.
> You should use `ctest2` for that case. `libc-test` isn't for external use and it has many tests for other platforms that are redundant for your case.
I'm not sure what you mean by "external use". We're using it to test the libc crate, not something else. It's important that we do this because we link the libc crate against the Android platform's sysroots (bionic) and not against the NDK, so we need to test behavior within the crate and not just the FFI bindings. Testing against bionic benefits the libc crate as well. It allows us catch potential bugs introduced in bionic before they reach the NDK.
Tests for other platforms are not an issue. We ignore them.
I could upload libc-test crate myself, but I figured that one of the existing maintainers would be better suited to own it. Alternatively, I could move Android to pulling directly from github instead of crates.io, but that diverges from how we manage other third party crates, so I'd prefer to not do that.
Hmm, I still don't think "publishing" is the right way here, you _should_ access it via Git. For instance, we use `libc-test` for `ctest2`, like: https://github.com/JohnTitor/ctest2/blob/master/ci/run.sh
I disagree. There are many reasons why someone may want to follow crates.io versions, but may also still want to test them. In other crates I maintain I've had to field similar requests and various reasons I've seen crop up:
- They have a large codebase which vendors its dependencies and we wish to be able to test them on the platforms they care about with our specific, potentially nonstandard, toolchain (Android is doing this)
- They are packaging Rust crates for a Linux distro and wish to have proper testing as a part of their packaging process
- See https://github.com/unicode-rs/unicode-normalization/issues/38 for a case of this form: in that case we had package size issues (the tests rely on a _large_ dataset) so there was a reason to _not_ include tests in the package. The final conclusion there was to exclude the big tests, but make it so that `cargo test` would still run smaller tests.
Ultimately, they could use `git`, but then they need to be able to reliably match `git` commits with crates.io versions, and that's not _always_ possible (I myself have forgotten to `git tag` a release, or otherwise messed up)
Basically, this is important for use cases where the environment is somewhat bespoke, and they still want to use versioned crates.io deps (doing git-replacement for everything is just not feasible). In such environments it's important to test the crate being used, since that environment is not one that people would CI for ("AOSP build system environment" and "Packaging environment for $randomdistro" are not typically something folks would accept PRs to test for :smile: )
|
2021-03-02T06:17:10Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 1,991
|
rust-lang__libc-1991
|
[
"1987"
] |
70962e3943d22d94141954db18eb7295b5edec5d
|
diff --git a/src/unix/linux_like/android/b64/aarch64/mod.rs b/src/unix/linux_like/android/b64/aarch64/mod.rs
index b7a21e1539238..5acb328be9aec 100644
--- a/src/unix/linux_like/android/b64/aarch64/mod.rs
+++ b/src/unix/linux_like/android/b64/aarch64/mod.rs
@@ -57,6 +57,49 @@ pub const O_LARGEFILE: ::c_int = 0o400000;
pub const SIGSTKSZ: ::size_t = 16384;
pub const MINSIGSTKSZ: ::size_t = 5120;
+// From NDK's asm/hwcap.h
+pub const HWCAP_FP: ::c_ulong = 1 << 0;
+pub const HWCAP_ASIMD: ::c_ulong = 1 << 1;
+pub const HWCAP_EVTSTRM: ::c_ulong = 1 << 2;
+pub const HWCAP_AES: ::c_ulong = 1 << 3;
+pub const HWCAP_PMULL: ::c_ulong = 1 << 4;
+pub const HWCAP_SHA1: ::c_ulong = 1 << 5;
+pub const HWCAP_SHA2: ::c_ulong = 1 << 6;
+pub const HWCAP_CRC32: ::c_ulong = 1 << 7;
+pub const HWCAP_ATOMICS: ::c_ulong = 1 << 8;
+pub const HWCAP_FPHP: ::c_ulong = 1 << 9;
+pub const HWCAP_ASIMDHP: ::c_ulong = 1 << 10;
+pub const HWCAP_CPUID: ::c_ulong = 1 << 11;
+pub const HWCAP_ASIMDRDM: ::c_ulong = 1 << 12;
+pub const HWCAP_JSCVT: ::c_ulong = 1 << 13;
+pub const HWCAP_FCMA: ::c_ulong = 1 << 14;
+pub const HWCAP_LRCPC: ::c_ulong = 1 << 15;
+pub const HWCAP_DCPOP: ::c_ulong = 1 << 16;
+pub const HWCAP_SHA3: ::c_ulong = 1 << 17;
+pub const HWCAP_SM3: ::c_ulong = 1 << 18;
+pub const HWCAP_SM4: ::c_ulong = 1 << 19;
+pub const HWCAP_ASIMDDP: ::c_ulong = 1 << 20;
+pub const HWCAP_SHA512: ::c_ulong = 1 << 21;
+pub const HWCAP_SVE: ::c_ulong = 1 << 22;
+pub const HWCAP_ASIMDFHM: ::c_ulong = 1 << 23;
+pub const HWCAP_DIT: ::c_ulong = 1 << 24;
+pub const HWCAP_USCAT: ::c_ulong = 1 << 25;
+pub const HWCAP_ILRCPC: ::c_ulong = 1 << 26;
+pub const HWCAP_FLAGM: ::c_ulong = 1 << 27;
+pub const HWCAP_SSBS: ::c_ulong = 1 << 28;
+pub const HWCAP_SB: ::c_ulong = 1 << 29;
+pub const HWCAP_PACA: ::c_ulong = 1 << 30;
+pub const HWCAP_PACG: ::c_ulong = 1 << 31;
+pub const HWCAP2_DCPODP: ::c_ulong = 1 << 0;
+pub const HWCAP2_SVE2: ::c_ulong = 1 << 1;
+pub const HWCAP2_SVEAES: ::c_ulong = 1 << 2;
+pub const HWCAP2_SVEPMULL: ::c_ulong = 1 << 3;
+pub const HWCAP2_SVEBITPERM: ::c_ulong = 1 << 4;
+pub const HWCAP2_SVESHA3: ::c_ulong = 1 << 5;
+pub const HWCAP2_SVESM4: ::c_ulong = 1 << 6;
+pub const HWCAP2_FLAGM2: ::c_ulong = 1 << 7;
+pub const HWCAP2_FRINT: ::c_ulong = 1 << 8;
+
pub const SYS_io_setup: ::c_long = 0;
pub const SYS_io_destroy: ::c_long = 1;
pub const SYS_io_submit: ::c_long = 2;
diff --git a/src/unix/linux_like/android/b64/mod.rs b/src/unix/linux_like/android/b64/mod.rs
index 0f9443f107357..5698994be74e4 100644
--- a/src/unix/linux_like/android/b64/mod.rs
+++ b/src/unix/linux_like/android/b64/mod.rs
@@ -256,6 +256,31 @@ 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;
+// From NDK's linux/auxvec.h
+pub const AT_NULL: ::c_ulong = 0;
+pub const AT_IGNORE: ::c_ulong = 1;
+pub const AT_EXECFD: ::c_ulong = 2;
+pub const AT_PHDR: ::c_ulong = 3;
+pub const AT_PHENT: ::c_ulong = 4;
+pub const AT_PHNUM: ::c_ulong = 5;
+pub const AT_PAGESZ: ::c_ulong = 6;
+pub const AT_BASE: ::c_ulong = 7;
+pub const AT_FLAGS: ::c_ulong = 8;
+pub const AT_ENTRY: ::c_ulong = 9;
+pub const AT_NOTELF: ::c_ulong = 10;
+pub const AT_UID: ::c_ulong = 11;
+pub const AT_EUID: ::c_ulong = 12;
+pub const AT_GID: ::c_ulong = 13;
+pub const AT_EGID: ::c_ulong = 14;
+pub const AT_PLATFORM: ::c_ulong = 15;
+pub const AT_HWCAP: ::c_ulong = 16;
+pub const AT_CLKTCK: ::c_ulong = 17;
+pub const AT_SECURE: ::c_ulong = 23;
+pub const AT_BASE_PLATFORM: ::c_ulong = 24;
+pub const AT_RANDOM: ::c_ulong = 25;
+pub const AT_HWCAP2: ::c_ulong = 26;
+pub const AT_EXECFN: ::c_ulong = 31;
+
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
value: 0,
__reserved: [0; 36],
@@ -280,6 +305,10 @@ pub const UT_LINESIZE: usize = 32;
pub const UT_NAMESIZE: usize = 32;
pub const UT_HOSTSIZE: usize = 256;
+extern "C" {
+ pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
+}
+
cfg_if! {
if #[cfg(target_arch = "x86_64")] {
mod x86_64;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 433d0a86e4b3e..d5dc0ef1ea84d 100755
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -1422,6 +1422,7 @@ fn test_android(target: &str) {
"stdio.h",
"stdlib.h",
"string.h",
+ "sys/auxv.h",
"sys/epoll.h",
"sys/eventfd.h",
"sys/file.h",
@@ -1472,6 +1473,7 @@ fn test_android(target: &str) {
// Include linux headers at the end:
headers! { cfg:
"asm/mman.h",
+ "linux/auxvec.h",
"linux/dccp.h",
"linux/errqueue.h",
"linux/falloc.h",
|
Add getauxval for Android
`getauxval` is useful for detecting CPU specific features such as availability of the ARMv8 AES instructions.
Currently in this crate, `getauxval` is available on Linux but not on Android. This function was added to Android in API Level 18 (https://developer.android.com/ndk/guides/cpu-features). So it might be a problem for someone building to an older API level. However on `aarch64` and `x86_64` the earliest API Level is 21 and thus for these architectures `getauxval` is always available.
Happy to contribute a patch, just wanted to check if enabling `getauxval` only for `aarch64-linux-android` and `x86_64-linux-android` was ok or if you had suggestions on how to handle the possibility of it not being included when built for an old Android.
|
Hey, thanks for the issue!
> Happy to contribute a patch, just wanted to check if enabling `getauxval` only for `aarch64-linux-android` and `x86_64-linux-android` was ok or if you had suggestions on how to handle the possibility of it not being included when built for an old Android.
It's totally okay to add it for these two targets.
|
2020-12-07T19:04:27Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 1,954
|
rust-lang__libc-1954
|
[
"1933"
] |
f18c583f19e22d6e497b5b33b45925862e318d51
|
diff --git a/ci/docker/aarch64-linux-android/Dockerfile b/ci/docker/aarch64-linux-android/Dockerfile
index 56685c5478231..0aa99eeea10ae 100644
--- a/ci/docker/aarch64-linux-android/Dockerfile
+++ b/ci/docker/aarch64-linux-android/Dockerfile
@@ -30,6 +30,7 @@ RUN chmod 755 /android/sdk/cmdline-tools/tools/* /android/sdk/emulator/qemu/linu
ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android28-clang \
CARGO_TARGET_AARCH64_LINUX_ANDROID_RUNNER=/tmp/runtest \
+ CC_aarch64_linux_android=aarch64-linux-android28-clang \
HOME=/tmp
ADD runtest-android.rs /tmp/runtest.rs
diff --git a/ci/docker/arm-linux-androideabi/Dockerfile b/ci/docker/arm-linux-androideabi/Dockerfile
index cee5882d91acb..e5cc79d87fd1b 100644
--- a/ci/docker/arm-linux-androideabi/Dockerfile
+++ b/ci/docker/arm-linux-androideabi/Dockerfile
@@ -30,6 +30,7 @@ RUN chmod 755 /android/sdk/cmdline-tools/tools/* /android/sdk/emulator/qemu/linu
ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \
CARGO_TARGET_ARM_LINUX_ANDROIDEABI_RUNNER=/tmp/runtest \
+ CC_arm_linux_androideabi=arm-linux-androideabi-gcc \
HOME=/tmp
ADD runtest-android.rs /tmp/runtest.rs
diff --git a/ci/docker/i686-linux-android/Dockerfile b/ci/docker/i686-linux-android/Dockerfile
index 050be4153436c..62a379b3cf8bc 100644
--- a/ci/docker/i686-linux-android/Dockerfile
+++ b/ci/docker/i686-linux-android/Dockerfile
@@ -30,6 +30,7 @@ RUN chmod 755 /android/sdk/cmdline-tools/tools/* /android/sdk/emulator/qemu/linu
ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android-gcc \
CARGO_TARGET_I686_LINUX_ANDROID_RUNNER=/tmp/runtest \
+ CC_i686_linux_android=i686-linux-android-gcc \
HOME=/tmp
ADD runtest-android.rs /tmp/runtest.rs
|
diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml
index ae5bfe39330a7..75ae60466dd1a 100644
--- a/libc-test/Cargo.toml
+++ b/libc-test/Cargo.toml
@@ -9,7 +9,7 @@ path = ".."
default-features = false
[build-dependencies]
-cc = "=1.0.52"
+cc = "1.0.61"
# FIXME: Use fork ctest until the maintainer gets back.
ctest2 = "0.3"
|
Unpin `cc` crate version on `libc-test`
Previously, our Android jobs fail due to mismatching of API level somehow. After some debugging, it seems like alexcrichton/cc-rs#495 is the cause. I pinned the `cc` crate version to `1.0.52` then the test passes as expected. For context: https://github.com/rust-lang/libc/issues/1765#issuecomment-710490097
But generally, it'd be great if we could use the latest version of the dependency. To unpin it, we should investigate more and introduce an actual fix to the `cc` crate.
|
2020-10-23T17:06:28Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 1,934
|
rust-lang__libc-1934
|
[
"1457"
] |
0062f2b95e6c4a1b5a094f56dfa91df04d1669dc
|
diff --git a/.github/workflows/bors.yml b/.github/workflows/bors.yml
index ffbef975afca8..2201899e479a9 100644
--- a/.github/workflows/bors.yml
+++ b/.github/workflows/bors.yml
@@ -132,6 +132,9 @@ jobs:
x86_64-linux-android,
x86_64-unknown-linux-gnux32,
x86_64-unknown-linux-musl,
+ # FIXME: It seems some items in `src/unix/mod.rs`
+ # aren't defined on redox actually.
+ # x86_64-unknown-redox,
]
steps:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
diff --git a/ci/build.sh b/ci/build.sh
index 9decfb75cfb5d..ba186f3af5586 100644
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -137,9 +137,6 @@ RUST_GT_1_24_LINUX_TARGETS="\
i586-unknown-linux-musl \
"
-# FIXME: temporarirly disable the redox target
-# https://github.com/rust-lang/libc/issues/1457
-# x86_64-unknown-redox
RUST_NIGHTLY_LINUX_TARGETS="\
aarch64-fuchsia \
armv5te-unknown-linux-gnueabi \
@@ -151,6 +148,7 @@ x86_64-fortanix-unknown-sgx \
x86_64-fuchsia \
x86_64-pc-windows-gnu \
x86_64-unknown-linux-gnux32 \
+x86_64-unknown-redox \
"
RUST_OSX_TARGETS="\
diff --git a/ci/docker/x86_64-unknown-redox/Dockerfile b/ci/docker/x86_64-unknown-redox/Dockerfile
new file mode 100644
index 0000000000000..91b0cbabdc0b6
--- /dev/null
+++ b/ci/docker/x86_64-unknown-redox/Dockerfile
@@ -0,0 +1,9 @@
+FROM redoxos/redoxer
+
+RUN mv /root/.redoxer /.redoxer
+
+ENV PATH=$PATH:/.redoxer/toolchain/bin:/rust/bin \
+ AR_x86_64_unknown_redox="x86_64-unknown-redox-ar" \
+ CC_x86_64_unknown_redox="x86_64-unknown-redox-gcc" \
+ CARGO_TARGET_X86_64_UNKNOWN_REDOX_LINKER="x86_64-unknown-redox-gcc" \
+ CARGO_TARGET_X86_64_UNKNOWN_REDOX_RUNNER="redoxer exec --folder ."
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index b9120809b8ae3..a696a1b58b560 100755
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -8,7 +8,7 @@ use std::env;
fn do_cc() {
let target = env::var("TARGET").unwrap();
if cfg!(unix) {
- let exclude = ["wasi"];
+ let exclude = ["redox", "wasi"];
if !exclude.iter().any(|x| target.contains(x)) {
let mut cmsg = cc::Build::new();
@@ -537,54 +537,37 @@ fn test_redox(target: &str) {
"dirent.h",
"dlfcn.h",
"errno.h",
- "execinfo.h",
"fcntl.h",
- "glob.h",
"grp.h",
- "ifaddrs.h",
- "langinfo.h",
"limits.h",
"locale.h",
- "net/if.h",
- "net/if_arp.h",
- "net/route.h",
"netdb.h",
"netinet/in.h",
"netinet/ip.h",
"netinet/tcp.h",
- "netinet/udp.h",
"poll.h",
- "pthread.h",
"pwd.h",
- "resolv.h",
- "sched.h",
"semaphore.h",
"string.h",
"strings.h",
"sys/file.h",
"sys/ioctl.h",
"sys/mman.h",
- "sys/mount.h",
"sys/ptrace.h",
- "sys/quota.h",
"sys/resource.h",
"sys/socket.h",
"sys/stat.h",
"sys/statvfs.h",
- "sys/sysctl.h",
"sys/time.h",
- "sys/times.h",
"sys/types.h",
"sys/uio.h",
"sys/un.h",
"sys/utsname.h",
"sys/wait.h",
- "syslog.h",
"termios.h",
"time.h",
"unistd.h",
"utime.h",
- "utmpx.h",
"wchar.h",
}
|
Temporarily disable redox target (tracking issue)
cc @jackpot51 I'm disabling the build tests for the redox target as part of the migration to Azure. It should be re-enabled in the redox PRs that migrate to the unix target.
|
2020-10-17T01:44:59Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 1,833
|
rust-lang__libc-1833
|
[
"454"
] |
b74981578e863ff834728c4b219254c9a951df54
|
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index ae33e1f62fa6d..e2c315c1a22b7 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -3857,26 +3857,6 @@ pub const SHM_STAT: ::c_int = 13;
pub const SHM_INFO: ::c_int = 14;
pub const SHM_ANON: *mut ::c_char = 1 as *mut ::c_char;
-// The *_MAXID constants never should've been used outside of the
-// FreeBSD base system. And with the exception of CTL_P1003_1B_MAXID,
-// they were all removed in svn r262489. They remain here for backwards
-// compatibility only, and are scheduled to be removed in libc 1.0.0.
-#[doc(hidden)]
-#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
-pub const CTL_MAXID: ::c_int = 10;
-#[doc(hidden)]
-#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
-pub const KERN_MAXID: ::c_int = 38;
-#[doc(hidden)]
-#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
-pub const HW_MAXID: ::c_int = 13;
-#[doc(hidden)]
-#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
-pub const USER_MAXID: ::c_int = 21;
-#[doc(hidden)]
-#[deprecated(since = "0.2.74", note = "Removed in FreeBSD 13")]
-pub const CTL_P1003_1B_MAXID: ::c_int = 26;
-
pub const MSG_NOTIFICATION: ::c_int = 0x00002000;
pub const MSG_NBIO: ::c_int = 0x00004000;
pub const MSG_COMPAT: ::c_int = 0x00008000;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 66eeebc61b6cb..c4b17150baeb4 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2328,12 +2328,6 @@ fn test_freebsd(target: &str) {
// still be accepted and ignored at runtime.
"MAP_RENAME" | "MAP_NORESERVE" => true,
- // FIXME: These are deprecated - remove in a couple of releases.
- // These constants were removed in FreeBSD 11 (svn r262489),
- // and they've never had any legitimate use outside of the
- // base system anyway.
- "CTL_MAXID" | "KERN_MAXID" | "HW_MAXID" | "USER_MAXID" => true,
-
// FIXME: This is deprecated - remove in a couple of releases.
// This was removed in FreeBSD 14 (git 1b4701fe1e8) and never
// should've been used anywhere anyway.
|
Remove obsolete constants in version 1.0.0
This issue tracks constants that should be removed from libc for release 1.0.0.
The following are absent in FreeBSD 11, never had stable values across versions, and should never have been used by third party software. They should be removed from FreeBSD.
```
CTL_MAXID
KERN_MAXID
HW_MAXID
USER_MAXID
```
The following is still present in FreeBSD 11, but like the previous four it should never have been used by third party software, and its value isn't guaranteed to be stable across versions. It should be removed from FreeBSD
`CTL_P1003_1B_MAXID`
|
Add to the list `AIO_LISTIO_MAX`. That symbol should never be used because the quantity it represents can potentially vary at runtime. Programs should use sysconf(3) instead.
I've deprecated these on master, and they are also `doc(hidden)`. I'd say that we'd remove them in one of the next releases.
I agree.
Feel free to open a PR removing these.
|
2020-07-24T15:31:25Z
|
1.0
|
b74981578e863ff834728c4b219254c9a951df54
|
rust-lang/libc
| 1,830
|
rust-lang__libc-1830
|
[
"1744"
] |
dce0ec0adb8f8ef711ea6b54e90429972f6077a0
|
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index 8b3ce3e2ea6a6..6ddb3257e2026 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -92,7 +92,7 @@ s! {
pub st_spare: [u32; 2],
}
- pub struct addrinfo {
+ pub struct addrinfo {
pub ai_flags: ::c_int,
pub ai_family: ::c_int,
pub ai_socktype: ::c_int,
@@ -286,7 +286,7 @@ s! {
pub struct __exit_status {
pub e_termination: u16,
pub e_exit: u16,
- }
+ }
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs
index f5055b259ae3b..0d427ae3894f1 100644
--- a/src/unix/linux_like/linux/musl/mod.rs
+++ b/src/unix/linux_like/linux/musl/mod.rs
@@ -144,6 +144,11 @@ s! {
pub imr_address: ::in_addr,
pub imr_ifindex: ::c_int,
}
+
+ pub struct __exit_status {
+ pub e_termination: ::c_short,
+ pub e_exit: ::c_short,
+ }
}
s_no_extra_traits! {
@@ -163,6 +168,36 @@ s_no_extra_traits! {
pub mem_unit: ::c_uint,
pub __reserved: [::c_char; 256],
}
+
+ // FIXME: musl added paddings and adjusted
+ // layout in 1.2.0 but our CI is still 1.1.24.
+ // So, I'm leaving some fields as comments for now.
+ // ref. https://github.com/bminor/musl/commit/
+ // 1e7f0fcd7ff2096904fd93a2ee6d12a2392be392
+ pub struct utmpx {
+ pub ut_type: ::c_short,
+ //__ut_pad1: ::c_short,
+ pub ut_pid: ::pid_t,
+ pub ut_line: [::c_char; 32],
+ pub ut_id: [::c_char; 4],
+ pub ut_user: [::c_char; 32],
+ pub ut_host: [::c_char; 256],
+ pub ut_exit: __exit_status,
+
+ //#[cfg(target_endian = "little")]
+ pub ut_session: ::c_long,
+ //#[cfg(target_endian = "little")]
+ //__ut_pad2: ::c_long,
+
+ //#[cfg(not(target_endian = "little"))]
+ //__ut_pad2: ::c_int,
+ //#[cfg(not(target_endian = "little"))]
+ //pub ut_session: ::c_int,
+
+ pub ut_tv: ::timeval,
+ pub ut_addr_v6: [::c_uint; 4],
+ __unused: [::c_char; 20],
+ }
}
cfg_if! {
@@ -231,6 +266,68 @@ cfg_if! {
self.__reserved.hash(state);
}
}
+
+ impl PartialEq for utmpx {
+ fn eq(&self, other: &utmpx) -> bool {
+ self.ut_type == other.ut_type
+ //&& self.__ut_pad1 == other.__ut_pad1
+ && self.ut_pid == other.ut_pid
+ && self.ut_line == other.ut_line
+ && self.ut_id == other.ut_id
+ && self.ut_user == other.ut_user
+ && self
+ .ut_host
+ .iter()
+ .zip(other.ut_host.iter())
+ .all(|(a,b)| a == b)
+ && self.ut_exit == other.ut_exit
+ && self.ut_session == other.ut_session
+ //&& self.__ut_pad2 == other.__ut_pad2
+ && self.ut_tv == other.ut_tv
+ && self.ut_addr_v6 == other.ut_addr_v6
+ && self.__unused == other.__unused
+ }
+ }
+
+ impl Eq for utmpx {}
+
+ impl ::fmt::Debug for utmpx {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("utmpx")
+ .field("ut_type", &self.ut_type)
+ //.field("__ut_pad1", &self.__ut_pad1)
+ .field("ut_pid", &self.ut_pid)
+ .field("ut_line", &self.ut_line)
+ .field("ut_id", &self.ut_id)
+ .field("ut_user", &self.ut_user)
+ //FIXME: .field("ut_host", &self.ut_host)
+ .field("ut_exit", &self.ut_exit)
+ .field("ut_session", &self.ut_session)
+ //.field("__ut_pad2", &self.__ut_pad2)
+ .field("ut_tv", &self.ut_tv)
+ .field("ut_addr_v6", &self.ut_addr_v6)
+ .field("__unused", &self.__unused)
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for utmpx {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.ut_type.hash(state);
+ //self.__ut_pad1.hash(state);
+ self.ut_pid.hash(state);
+ self.ut_line.hash(state);
+ self.ut_id.hash(state);
+ self.ut_user.hash(state);
+ self.ut_host.hash(state);
+ self.ut_exit.hash(state);
+ self.ut_session.hash(state);
+ //self.__ut_pad2.hash(state);
+ self.ut_tv.hash(state);
+ self.ut_addr_v6.hash(state);
+ self.__unused.hash(state);
+ }
+ }
}
}
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 648b0844a21d8..5cee9afb2d15d 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2551,6 +2551,11 @@ fn test_linux(target: &str) {
"statx" => true,
"statx_timestamp" => true,
+ // On Linux, the type of `ut_exit` field of struct `utmpx`
+ // can be an anonymous struct, so an extra struct,
+ // which is absent in musl, has to be defined.
+ "__exit_status" if musl => true,
+
_ => false,
}
});
@@ -2672,7 +2677,9 @@ fn test_linux(target: &str) {
// sigval is actually a union, but we pretend it's a struct
(struct_ == "sigevent" && field == "sigev_value") ||
// this one is an anonymous union
- (struct_ == "ff_effect" && field == "u")
+ (struct_ == "ff_effect" && field == "u") ||
+ // `__exit_status` type is a patch which is absent in musl
+ (struct_ == "utmpx" && field == "ut_exit" && musl)
});
cfg.volatile_item(|i| {
|
request adding utmpx symvol on musl
Cabulertion.
Please add missing utmpx symvols on x86_64-unknown-linux-musl if skarnet libutmps present in system.
|
2020-07-21T00:27:58Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 1,734
|
rust-lang__libc-1734
|
[
"1733"
] |
12c28abe7bb2a30792d28e819ca4bb4257ed8f0c
|
diff --git a/ci/README.md b/ci/README.md
index 31235538071f8..7d4b4601c259e 100644
--- a/ci/README.md
+++ b/ci/README.md
@@ -4,6 +4,9 @@ result the CI is pretty complicated and also pretty large! Hopefully this can
serve as a guide through the sea of scripts in this directory and elsewhere in
this project.
+Note that this documentation is quite outdated. See CI config and scripts
+in the `ci` directory how we run CI now.
+
# Files
First up, let's talk about the files in this directory:
@@ -15,30 +18,10 @@ First up, let's talk about the files in this directory:
* `dox.sh` - build the documentation of the crate and publish it to gh-pages.
-* `landing-page-*.html` - used by `dox.sh` to generate a landing page for all
- architectures' documentation.
-
-* `run-qemu.sh` - see discussion about QEMU below
-
-* `mips`, `rumprun` - instructions to build the docker image for each respective
- CI target
-
# CI Systems
-Currently this repository leverages a combination of Travis CI and AppVeyor for
-running tests. The triples tested are:
-
-* AppVeyor
- * `{i686,x86_64}-pc-windows-{msvc,gnu}`
-* Travis
- * `{i686,x86_64,mips,aarch64}-unknown-linux-gnu`
- * `{x86_64,aarch64}-unknown-linux-musl`
- * `arm-unknown-linux-gnueabihf`
- * `arm-linux-androideabi`
- * `{i686,x86_64}-apple-{darwin,ios}`
- * `x86_64-rumprun-netbsd`
- * `x86_64-unknown-freebsd`
- * `x86_64-unknown-openbsd`
+Currently this repository leverages a combination of Azure Pipelines and Cirrus CI
+for running tests. You can find tested triples in [Pipelines config] or [Cirrus config].
The Windows triples are all pretty standard, they just set up their environment
then run tests, no need for downloading any extra target libs (we just download
@@ -62,7 +45,9 @@ The remaining architectures look like:
* The BSD builds, currently OpenBSD and FreeBSD, use QEMU to boot up a system
and compile/run tests. More information on that below.
-[android-docker]: https://github.com/rust-lang/rust-buildbot/blob/master/slaves/android/Dockerfile
+[Pipelines config]: https://github.com/rust-lang/libc/blob/master/ci/azure.yml
+[Cirrus config]: https://github.com/rust-lang/libc/blob/master/.cirrus.yml
+[android-docker]: https://github.com/rust-lang/libc/blob/master/ci/docker/x86_64-linux-android/Dockerfile
## QEMU
@@ -88,9 +73,7 @@ working for these platforms, but the gist of it looks like:
We may be able to get it working but it might be difficult at that point to
ensure that the libc definitions align with what you'd get on the BSD itself.
As a result, we try to do compiles within the BSD distro.
-* On Travis we can't run a VM-in-a-VM, so we resort to userspace emulation
- (QEMU).
-* Unfortunately on Travis we also can't use KVM, so the emulation is super slow.
+* We resort to userspace emulation (QEMU).
With all that in mind, the way BSD is tested looks like:
@@ -109,7 +92,7 @@ There's some pretty specific instructions for setting up each image (detailed
below), but the main gist of this is that we must avoid a vanilla `cargo run`
inside of the `libc-test` directory (which is what it's intended for) because
that would compile `syntex_syntax`, a large library, with userspace emulation.
-This invariably times out on Travis, so we can't do that.
+This invariably times out on CI, so we can't do that.
Once all those hoops are jumped through, however, we can be happy that we're
testing almost everything!
@@ -194,7 +177,6 @@ Helpful links
* https://blog.nekoconeko.nl/blog/2015/06/04/creating-an-openstack-freebsd-image.html
* https://www.freebsd.org/doc/handbook/serialconsole-setup.html
-
### QEMU setup - OpenBSD
1. Download CD installer
@@ -233,4 +215,3 @@ Helpful links:
Hopefully that's at least somewhat of an introduction to everything going on
here, and feel free to ping @alexcrichton with questions!
-
diff --git a/ci/run-qemu.sh b/ci/run-qemu.sh
deleted file mode 100644
index 6fba6298768f4..0000000000000
--- a/ci/run-qemu.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env sh
-
-# Initial script which is run inside of all qemu images. The first argument to
-# this script (as arranged by the qemu image itself) is the path to where the
-# libc crate is mounted.
-#
-# For qemu images we currently need to install Rust manually as this wasn't done
-# by the initial run-travis.sh script
-#
-# FIXME: feels like run-travis.sh should be responsible for downloading the
-# compiler.
-
-set -ex
-
-ROOT="${1}"
-cp -r "${ROOT}/libc" /tmp/libc
-cd /tmp/libc
-
-TARGET="$(cat "${ROOT}/TARGET")"
-export CARGO_TARGET_DIR=/tmp
-
-case $TARGET in
- *-openbsd)
- pkg_add cargo gcc%4.9 rust
- export CC=egcc
- ;;
-
- *)
- echo "Unknown target: ${TARGET}"
- exit 1
- ;;
-esac
-
-exec sh ci/run.sh "${TARGET}"
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 4e5d1e0489217..49b43ca404e0f 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2137,7 +2137,7 @@ fn test_vxworks(target: &str) {
"pathLib.h",
"mqueue.h",
}
- /* Fix me */
+ // FIXME
cfg.skip_const(move |name| match name {
// sighandler_t weirdness
"SIG_DFL" | "SIG_ERR" | "SIG_IGN"
@@ -2145,7 +2145,7 @@ fn test_vxworks(target: &str) {
| "RTLD_DEFAULT" => true,
_ => false,
});
- /* Fix me */
+ // FIXME
cfg.skip_type(move |ty| match ty {
"stat64" | "sighandler_t" | "off64_t" => true,
_ => false,
@@ -2170,13 +2170,13 @@ fn test_vxworks(target: &str) {
t => t.to_string(),
});
- /* Fix me */
+ // FIXME
cfg.skip_fn(move |name| match name {
- /* sigval */
+ // sigval
"sigqueue" | "_sigqueue"
- /* sighandler_t*/
+ // sighandler_t
| "signal"
- /* not used in static linking by default */
+ // not used in static linking by default
| "dlerror" => true,
_ => false,
});
|
Documentation in `ci` is outdated
[The documentation in `ci`](https://github.com/rust-lang/libc/blob/12c28abe7bb2a30792d28e819ca4bb4257ed8f0c/ci/README.md) states that Travis and Appveyor are used, but actually it seems you've migrated to Azure & Cirrus. Looks like it's time to update it a bit!
|
2020-04-13T18:26:19Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 1,727
|
rust-lang__libc-1727
|
[
"1700"
] |
a1c40924ae8aed3156121fe21be4fe698b368711
|
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index 9c3038bf7bc1c..e257e65f7ecef 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -399,6 +399,47 @@ cfg_if! {
}
}
+// include/uapi/asm-generic/hugetlb_encode.h
+pub const HUGETLB_FLAG_ENCODE_SHIFT: ::c_int = 26;
+pub const HUGETLB_FLAG_ENCODE_MASK: ::c_int = 0x3f;
+
+pub const HUGETLB_FLAG_ENCODE_64KB: ::c_int = 16 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_512KB: ::c_int = 19 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_1MB: ::c_int = 20 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_2MB: ::c_int = 21 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_8MB: ::c_int = 23 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_16MB: ::c_int = 24 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_32MB: ::c_int = 25 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_256MB: ::c_int = 28 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_512MB: ::c_int = 29 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_1GB: ::c_int = 30 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_2GB: ::c_int = 31 << HUGETLB_FLAG_ENCODE_SHIFT;
+pub const HUGETLB_FLAG_ENCODE_16GB: ::c_int = 34 << HUGETLB_FLAG_ENCODE_SHIFT;
+
+// include/uapi/linux/mman.h
+/*
+ * Huge page size encoding when MAP_HUGETLB is specified, and a huge page
+ * size other than the default is desired. See hugetlb_encode.h.
+ * All known huge page size encodings are provided here. It is the
+ * responsibility of the application to know which sizes are supported on
+ * the running system. See mmap(2) man page for details.
+ */
+pub const MAP_HUGE_SHIFT: ::c_int = HUGETLB_FLAG_ENCODE_SHIFT;
+pub const MAP_HUGE_MASK: ::c_int = HUGETLB_FLAG_ENCODE_MASK;
+
+pub const MAP_HUGE_64KB: ::c_int = HUGETLB_FLAG_ENCODE_64KB;
+pub const MAP_HUGE_512KB: ::c_int = HUGETLB_FLAG_ENCODE_512KB;
+pub const MAP_HUGE_1MB: ::c_int = HUGETLB_FLAG_ENCODE_1MB;
+pub const MAP_HUGE_2MB: ::c_int = HUGETLB_FLAG_ENCODE_2MB;
+pub const MAP_HUGE_8MB: ::c_int = HUGETLB_FLAG_ENCODE_8MB;
+pub const MAP_HUGE_16MB: ::c_int = HUGETLB_FLAG_ENCODE_16MB;
+pub const MAP_HUGE_32MB: ::c_int = HUGETLB_FLAG_ENCODE_32MB;
+pub const MAP_HUGE_256MB: ::c_int = HUGETLB_FLAG_ENCODE_256MB;
+pub const MAP_HUGE_512MB: ::c_int = HUGETLB_FLAG_ENCODE_512MB;
+pub const MAP_HUGE_1GB: ::c_int = HUGETLB_FLAG_ENCODE_1GB;
+pub const MAP_HUGE_2GB: ::c_int = HUGETLB_FLAG_ENCODE_2GB;
+pub const MAP_HUGE_16GB: ::c_int = HUGETLB_FLAG_ENCODE_16GB;
+
pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
diff --git a/src/unix/linux_like/linux/musl/b32/hexagon.rs b/src/unix/linux_like/linux/musl/b32/hexagon.rs
index 23406955727bc..4a89679b9a0df 100644
--- a/src/unix/linux_like/linux/musl/b32/hexagon.rs
+++ b/src/unix/linux_like/linux/musl/b32/hexagon.rs
@@ -258,8 +258,6 @@ pub const MAP_ANON: ::c_int = 32;
pub const MAP_DENYWRITE: ::c_int = 2048;
pub const MAP_EXECUTABLE: ::c_int = 4096;
pub const MAP_GROWSDOWN: ::c_int = 256;
-pub const MAP_HUGE_MASK: ::c_int = 63;
-pub const MAP_HUGE_SHIFT: ::c_int = 26;
pub const MAP_HUGETLB: ::c_int = 262144;
pub const MAP_LOCKED: ::c_int = 8192;
pub const MAP_NONBLOCK: ::c_int = 65536;
diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs
index df539ad4741dd..0c2b7440bded9 100644
--- a/src/unix/linux_like/linux/musl/mod.rs
+++ b/src/unix/linux_like/linux/musl/mod.rs
@@ -199,6 +199,30 @@ cfg_if! {
}
}
+// include/sys/mman.h
+/*
+ * Huge page size encoding when MAP_HUGETLB is specified, and a huge page
+ * size other than the default is desired. See hugetlb_encode.h.
+ * All known huge page size encodings are provided here. It is the
+ * responsibility of the application to know which sizes are supported on
+ * the running system. See mmap(2) man page for details.
+ */
+pub const MAP_HUGE_SHIFT: ::c_int = 26;
+pub const MAP_HUGE_MASK: ::c_int = 0x3f;
+
+pub const MAP_HUGE_64KB: ::c_int = 16 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_512KB: ::c_int = 19 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_1MB: ::c_int = 20 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_2MB: ::c_int = 21 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_8MB: ::c_int = 23 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_16MB: ::c_int = 24 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_32MB: ::c_int = 25 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_256MB: ::c_int = 28 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_512MB: ::c_int = 29 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_1GB: ::c_int = 30 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_2GB: ::c_int = 31 << MAP_HUGE_SHIFT;
+pub const MAP_HUGE_16GB: ::c_int = 34 << MAP_HUGE_SHIFT;
+
pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
pub const SFD_CLOEXEC: ::c_int = 0x080000;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index a1b7ad7f7270c..a8e0c015eeef4 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2240,6 +2240,7 @@ fn test_linux(target: &str) {
"linux/keyctl.h",
"linux/magic.h",
"linux/memfd.h",
+ "linux/mman.h",
"linux/module.h",
"linux/net_tstamp.h",
"linux/netfilter/nfnetlink.h",
|
Huge page size support in for mmap - MAP_HUGE_2MB, MAP_HUGE_1GB
<!--
**Help us help you.**
If you are requesting a new API, include:
* the target triple
* link to the documentation of the API showing the type signatures, how to use
it, etc.
In general, just please consider that the people who can help you are all very
busy, they will be helping you in their free time, there are a lot of people in
need of help so they need to prioritize to which issues they devote their free
time, etc. So try to give most of the information upfront, be concise, show
small self-contained examples (nobody has time to create a new cargo project,
set up dependencies,...), etc. Help us help you.
-->
Related to https://github.com/nix-rust/nix/issues/1194
Since linux 3.8 there are additional flags to mmap that allow specifying what size of huge page should be used. (MAP_HUGE_2MB, MAP_HUGE_1GB on x86_64, the headers appears to have some generic support for variety of other sizes for other architectures)
http://man7.org/linux/man-pages/man2/mmap.2.html
target triple eight be x86_64-unknown-linux-gnu ?
Can those be added to libc ?
(I'd be willing to help, but I wouldn't mind some guidance on how to best tackle this and whether this is appropriate.)
|
https://github.com/torvalds/linux/blob/master/include/uapi/linux/mman.h this is where those are defined.
They are no arch specific override (unlike `MAP_HUGTELB`), hence this can probably go at `linux_like/linux/mod.rs`
|
2020-04-09T10:09:00Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 1,697
|
rust-lang__libc-1697
|
[
"1591"
] |
12c28abe7bb2a30792d28e819ca4bb4257ed8f0c
|
diff --git a/ci/azure.yml b/ci/azure.yml
index 6dd0fcecba3c0..52d1e479469f3 100644
--- a/ci/azure.yml
+++ b/ci/azure.yml
@@ -76,10 +76,8 @@ jobs:
# TARGET: wasm32-wasi
sparc64-unknown-linux-gnu:
TARGET: sparc64-unknown-linux-gnu
- # Disabled because currently broken, see:
- # https://github.com/rust-lang/libc/issues/1591
- # wasm32-unknown-emscripten:
- # TARGET: wasm32-unknown-emscripten
+ wasm32-unknown-emscripten:
+ TARGET: wasm32-unknown-emscripten
x86_64-linux-android:
TARGET: x86_64-linux-android
x86_64-unknown-linux-gnux32:
diff --git a/ci/emscripten-entry.sh b/ci/emscripten-entry.sh
index e91b40196e5af..41e7935ff7cfc 100755
--- a/ci/emscripten-entry.sh
+++ b/ci/emscripten-entry.sh
@@ -6,6 +6,6 @@ set -ex
source /emsdk-portable/emsdk_env.sh &> /dev/null
# emsdk-portable provides a node binary, but we need version 8 to run wasm
-export PATH="/node-v12.3.1-linux-x64/bin:$PATH"
+export PATH="/node-v12.16.2-linux-x64/bin:$PATH"
exec "$@"
diff --git a/ci/emscripten.sh b/ci/emscripten.sh
index 2e87130e05075..16be5a17528be 100644
--- a/ci/emscripten.sh
+++ b/ci/emscripten.sh
@@ -23,8 +23,8 @@ git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable
cd /emsdk-portable
# FIXME: switch to an upstream install once
# https://github.com/rust-lang/rust/pull/63649 lands
-hide_output ./emsdk install 1.38.42
-./emsdk activate 1.38.42
+hide_output ./emsdk install 1.39.12
+./emsdk activate 1.39.12
# Compile and cache libc
# shellcheck disable=SC1091
@@ -39,5 +39,5 @@ chmod a+rxw -R /emsdk-portable
# node 8 is required to run wasm
cd /
-curl --retry 5 -L https://nodejs.org/dist/v12.3.1/node-v12.3.1-linux-x64.tar.xz | \
+curl --retry 5 -L https://nodejs.org/dist/v12.16.2/node-v12.16.2-linux-x64.tar.xz | \
tar -xJ
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index 3f08a98efc76e..8a419116249ac 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -208,6 +208,16 @@ s! {
pub cookie: u32,
pub len: u32
}
+
+ pub struct sock_extended_err {
+ pub ee_errno: u32,
+ pub ee_origin: u8,
+ pub ee_type: u8,
+ pub ee_code: u8,
+ pub ee_pad: u8,
+ pub ee_info: u32,
+ pub ee_data: u32,
+ }
}
s_no_extra_traits! {
@@ -1572,6 +1582,7 @@ pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
pub const SO_ORIGINAL_DST: ::c_int = 80;
pub const IP_ORIGDSTADDR: ::c_int = 20;
pub const IP_RECVORIGDSTADDR: ::c_int = IP_ORIGDSTADDR;
+pub const IPV6_FLOWINFO: ::c_int = 11;
pub const IPV6_ORIGDSTADDR: ::c_int = 74;
pub const IPV6_RECVORIGDSTADDR: ::c_int = IPV6_ORIGDSTADDR;
pub const IPV6_FLOWLABEL_MGR: ::c_int = 32;
@@ -2081,6 +2092,51 @@ pub const FUTEX_CLOCK_REALTIME: ::c_int = 256;
pub const FUTEX_CMD_MASK: ::c_int =
!(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME);
+// linux/errqueue.h
+pub const SO_EE_ORIGIN_NONE: u8 = 0;
+pub const SO_EE_ORIGIN_LOCAL: u8 = 1;
+pub const SO_EE_ORIGIN_ICMP: u8 = 2;
+pub const SO_EE_ORIGIN_ICMP6: u8 = 3;
+pub const SO_EE_ORIGIN_TXSTATUS: u8 = 4;
+pub const SO_EE_ORIGIN_TIMESTAMPING: u8 = SO_EE_ORIGIN_TXSTATUS;
+
+// errno.h
+pub const EPERM: ::c_int = 1;
+pub const ENOENT: ::c_int = 2;
+pub const ESRCH: ::c_int = 3;
+pub const EINTR: ::c_int = 4;
+pub const EIO: ::c_int = 5;
+pub const ENXIO: ::c_int = 6;
+pub const E2BIG: ::c_int = 7;
+pub const ENOEXEC: ::c_int = 8;
+pub const EBADF: ::c_int = 9;
+pub const ECHILD: ::c_int = 10;
+pub const EAGAIN: ::c_int = 11;
+pub const ENOMEM: ::c_int = 12;
+pub const EACCES: ::c_int = 13;
+pub const EFAULT: ::c_int = 14;
+pub const ENOTBLK: ::c_int = 15;
+pub const EBUSY: ::c_int = 16;
+pub const EEXIST: ::c_int = 17;
+pub const EXDEV: ::c_int = 18;
+pub const ENODEV: ::c_int = 19;
+pub const ENOTDIR: ::c_int = 20;
+pub const EISDIR: ::c_int = 21;
+pub const EINVAL: ::c_int = 22;
+pub const ENFILE: ::c_int = 23;
+pub const EMFILE: ::c_int = 24;
+pub const ENOTTY: ::c_int = 25;
+pub const ETXTBSY: ::c_int = 26;
+pub const EFBIG: ::c_int = 27;
+pub const ENOSPC: ::c_int = 28;
+pub const ESPIPE: ::c_int = 29;
+pub const EROFS: ::c_int = 30;
+pub const EMLINK: ::c_int = 31;
+pub const EPIPE: ::c_int = 32;
+pub const EDOM: ::c_int = 33;
+pub const ERANGE: ::c_int = 34;
+pub const EWOULDBLOCK: ::c_int = EAGAIN;
+
f! {
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
cmsg: *const cmsghdr) -> *mut cmsghdr {
@@ -2140,6 +2196,10 @@ f! {
pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)
}
+
+ pub fn SO_EE_OFFENDER(ee: *const ::sock_extended_err) -> *mut ::sockaddr {
+ ee.offset(1) as *mut ::sockaddr
+ }
}
extern "C" {
diff --git a/src/unix/linux_like/emscripten/align.rs b/src/unix/linux_like/emscripten/align.rs
index 141570f88ffb9..b9ea3f39efdf5 100644
--- a/src/unix/linux_like/emscripten/align.rs
+++ b/src/unix/linux_like/emscripten/align.rs
@@ -38,9 +38,9 @@ macro_rules! expand_align {
}
#[allow(missing_debug_implementations)]
- #[repr(align(8))]
+ #[repr(align(16))]
pub struct max_align_t {
- priv_: [f64; 2]
+ priv_: [f64; 4]
}
}
diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs
index a7a81ae2016ff..ead0ea11d2cb5 100644
--- a/src/unix/linux_like/emscripten/mod.rs
+++ b/src/unix/linux_like/emscripten/mod.rs
@@ -1174,20 +1174,142 @@ pub const O_TRUNC: ::c_int = 512;
pub const O_NOATIME: ::c_int = 0o1000000;
pub const O_CLOEXEC: ::c_int = 0x80000;
-pub const EBFONT: ::c_int = 59;
-pub const ENOSTR: ::c_int = 60;
-pub const ENODATA: ::c_int = 61;
-pub const ETIME: ::c_int = 62;
-pub const ENOSR: ::c_int = 63;
-pub const ENONET: ::c_int = 64;
-pub const ENOPKG: ::c_int = 65;
-pub const EREMOTE: ::c_int = 66;
-pub const ENOLINK: ::c_int = 67;
-pub const EADV: ::c_int = 68;
-pub const ESRMNT: ::c_int = 69;
-pub const ECOMM: ::c_int = 70;
-pub const EPROTO: ::c_int = 71;
-pub const EDOTDOT: ::c_int = 73;
+// Defined as wasi value.
+pub const EPERM: ::c_int = 63;
+pub const ENOENT: ::c_int = 44;
+pub const ESRCH: ::c_int = 71;
+pub const EINTR: ::c_int = 27;
+pub const EIO: ::c_int = 29;
+pub const ENXIO: ::c_int = 60;
+pub const E2BIG: ::c_int = 1;
+pub const ENOEXEC: ::c_int = 45;
+pub const EBADF: ::c_int = 8;
+pub const ECHILD: ::c_int = 12;
+pub const EAGAIN: ::c_int = 6;
+pub const ENOMEM: ::c_int = 48;
+pub const EACCES: ::c_int = 2;
+pub const EFAULT: ::c_int = 21;
+pub const ENOTBLK: ::c_int = 105;
+pub const EBUSY: ::c_int = 10;
+pub const EEXIST: ::c_int = 20;
+pub const EXDEV: ::c_int = 75;
+pub const ENODEV: ::c_int = 43;
+pub const ENOTDIR: ::c_int = 54;
+pub const EISDIR: ::c_int = 31;
+pub const EINVAL: ::c_int = 28;
+pub const ENFILE: ::c_int = 41;
+pub const EMFILE: ::c_int = 33;
+pub const ENOTTY: ::c_int = 59;
+pub const ETXTBSY: ::c_int = 74;
+pub const EFBIG: ::c_int = 22;
+pub const ENOSPC: ::c_int = 51;
+pub const ESPIPE: ::c_int = 70;
+pub const EROFS: ::c_int = 69;
+pub const EMLINK: ::c_int = 34;
+pub const EPIPE: ::c_int = 64;
+pub const EDOM: ::c_int = 18;
+pub const ERANGE: ::c_int = 68;
+pub const EWOULDBLOCK: ::c_int = EAGAIN;
+pub const ENOLINK: ::c_int = 47;
+pub const EPROTO: ::c_int = 65;
+pub const EDEADLK: ::c_int = 16;
+pub const EDEADLOCK: ::c_int = EDEADLK;
+pub const ENAMETOOLONG: ::c_int = 37;
+pub const ENOLCK: ::c_int = 46;
+pub const ENOSYS: ::c_int = 52;
+pub const ENOTEMPTY: ::c_int = 55;
+pub const ELOOP: ::c_int = 32;
+pub const ENOMSG: ::c_int = 49;
+pub const EIDRM: ::c_int = 24;
+pub const EMULTIHOP: ::c_int = 36;
+pub const EBADMSG: ::c_int = 9;
+pub const EOVERFLOW: ::c_int = 61;
+pub const EILSEQ: ::c_int = 25;
+pub const ENOTSOCK: ::c_int = 57;
+pub const EDESTADDRREQ: ::c_int = 17;
+pub const EMSGSIZE: ::c_int = 35;
+pub const EPROTOTYPE: ::c_int = 67;
+pub const ENOPROTOOPT: ::c_int = 50;
+pub const EPROTONOSUPPORT: ::c_int = 66;
+pub const EAFNOSUPPORT: ::c_int = 5;
+pub const EADDRINUSE: ::c_int = 3;
+pub const EADDRNOTAVAIL: ::c_int = 4;
+pub const ENETDOWN: ::c_int = 38;
+pub const ENETUNREACH: ::c_int = 40;
+pub const ENETRESET: ::c_int = 39;
+pub const ECONNABORTED: ::c_int = 13;
+pub const ECONNRESET: ::c_int = 15;
+pub const ENOBUFS: ::c_int = 42;
+pub const EISCONN: ::c_int = 30;
+pub const ENOTCONN: ::c_int = 53;
+pub const ETIMEDOUT: ::c_int = 73;
+pub const ECONNREFUSED: ::c_int = 14;
+pub const EHOSTUNREACH: ::c_int = 23;
+pub const EALREADY: ::c_int = 7;
+pub const EINPROGRESS: ::c_int = 26;
+pub const ESTALE: ::c_int = 72;
+pub const EDQUOT: ::c_int = 19;
+pub const ECANCELED: ::c_int = 11;
+pub const EOWNERDEAD: ::c_int = 62;
+pub const ENOTRECOVERABLE: ::c_int = 56;
+
+pub const ENOSTR: ::c_int = 100;
+pub const EBFONT: ::c_int = 101;
+pub const EBADSLT: ::c_int = 102;
+pub const EBADRQC: ::c_int = 103;
+pub const ENOANO: ::c_int = 104;
+pub const ECHRNG: ::c_int = 106;
+pub const EL3HLT: ::c_int = 107;
+pub const EL3RST: ::c_int = 108;
+pub const ELNRNG: ::c_int = 109;
+pub const EUNATCH: ::c_int = 110;
+pub const ENOCSI: ::c_int = 111;
+pub const EL2HLT: ::c_int = 112;
+pub const EBADE: ::c_int = 113;
+pub const EBADR: ::c_int = 114;
+pub const EXFULL: ::c_int = 115;
+pub const ENODATA: ::c_int = 116;
+pub const ETIME: ::c_int = 117;
+pub const ENOSR: ::c_int = 118;
+pub const ENONET: ::c_int = 119;
+pub const ENOPKG: ::c_int = 120;
+pub const EREMOTE: ::c_int = 121;
+pub const EADV: ::c_int = 122;
+pub const ESRMNT: ::c_int = 123;
+pub const ECOMM: ::c_int = 124;
+pub const EDOTDOT: ::c_int = 125;
+pub const ENOTUNIQ: ::c_int = 126;
+pub const EBADFD: ::c_int = 127;
+pub const EREMCHG: ::c_int = 128;
+pub const ELIBACC: ::c_int = 129;
+pub const ELIBBAD: ::c_int = 130;
+pub const ELIBSCN: ::c_int = 131;
+pub const ELIBMAX: ::c_int = 132;
+pub const ELIBEXEC: ::c_int = 133;
+pub const ERESTART: ::c_int = 134;
+pub const ESTRPIPE: ::c_int = 135;
+pub const EUSERS: ::c_int = 136;
+pub const ESOCKTNOSUPPORT: ::c_int = 137;
+pub const EOPNOTSUPP: ::c_int = 138;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
+pub const EPFNOSUPPORT: ::c_int = 139;
+pub const ESHUTDOWN: ::c_int = 140;
+pub const ETOOMANYREFS: ::c_int = 141;
+pub const EHOSTDOWN: ::c_int = 142;
+pub const EUCLEAN: ::c_int = 143;
+pub const ENOTNAM: ::c_int = 144;
+pub const ENAVAIL: ::c_int = 145;
+pub const EISNAM: ::c_int = 146;
+pub const EREMOTEIO: ::c_int = 147;
+pub const ENOMEDIUM: ::c_int = 148;
+pub const EMEDIUMTYPE: ::c_int = 149;
+pub const ENOKEY: ::c_int = 150;
+pub const EKEYEXPIRED: ::c_int = 151;
+pub const EKEYREVOKED: ::c_int = 152;
+pub const EKEYREJECTED: ::c_int = 153;
+pub const ERFKILL: ::c_int = 154;
+pub const EHWPOISON: ::c_int = 155;
+pub const EL2NSYNC: ::c_int = 156;
pub const SA_NODEFER: ::c_int = 0x40000000;
pub const SA_RESETHAND: ::c_int = 0x80000000;
@@ -1227,7 +1349,6 @@ pub const TCP_QUEUE_SEQ: ::c_int = 21;
pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
pub const TCP_FASTOPEN: ::c_int = 23;
pub const TCP_TIMESTAMP: ::c_int = 24;
-pub const TCP_FASTOPEN_CONNECT: ::c_int = 30;
#[doc(hidden)]
#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
@@ -1438,92 +1559,6 @@ pub const SOCK_SEQPACKET: ::c_int = 5;
pub const SOL_SOCKET: ::c_int = 1;
-pub const EDEADLK: ::c_int = 35;
-pub const ENAMETOOLONG: ::c_int = 36;
-pub const ENOLCK: ::c_int = 37;
-pub const ENOSYS: ::c_int = 38;
-pub const ENOTEMPTY: ::c_int = 39;
-pub const ELOOP: ::c_int = 40;
-pub const ENOMSG: ::c_int = 42;
-pub const EIDRM: ::c_int = 43;
-pub const ECHRNG: ::c_int = 44;
-pub const EL2NSYNC: ::c_int = 45;
-pub const EL3HLT: ::c_int = 46;
-pub const EL3RST: ::c_int = 47;
-pub const ELNRNG: ::c_int = 48;
-pub const EUNATCH: ::c_int = 49;
-pub const ENOCSI: ::c_int = 50;
-pub const EL2HLT: ::c_int = 51;
-pub const EBADE: ::c_int = 52;
-pub const EBADR: ::c_int = 53;
-pub const EXFULL: ::c_int = 54;
-pub const ENOANO: ::c_int = 55;
-pub const EBADRQC: ::c_int = 56;
-pub const EBADSLT: ::c_int = 57;
-pub const EDEADLOCK: ::c_int = EDEADLK;
-pub const EMULTIHOP: ::c_int = 72;
-pub const EBADMSG: ::c_int = 74;
-pub const EOVERFLOW: ::c_int = 75;
-pub const ENOTUNIQ: ::c_int = 76;
-pub const EBADFD: ::c_int = 77;
-pub const EREMCHG: ::c_int = 78;
-pub const ELIBACC: ::c_int = 79;
-pub const ELIBBAD: ::c_int = 80;
-pub const ELIBSCN: ::c_int = 81;
-pub const ELIBMAX: ::c_int = 82;
-pub const ELIBEXEC: ::c_int = 83;
-pub const EILSEQ: ::c_int = 84;
-pub const ERESTART: ::c_int = 85;
-pub const ESTRPIPE: ::c_int = 86;
-pub const EUSERS: ::c_int = 87;
-pub const ENOTSOCK: ::c_int = 88;
-pub const EDESTADDRREQ: ::c_int = 89;
-pub const EMSGSIZE: ::c_int = 90;
-pub const EPROTOTYPE: ::c_int = 91;
-pub const ENOPROTOOPT: ::c_int = 92;
-pub const EPROTONOSUPPORT: ::c_int = 93;
-pub const ESOCKTNOSUPPORT: ::c_int = 94;
-pub const EOPNOTSUPP: ::c_int = 95;
-pub const ENOTSUP: ::c_int = EOPNOTSUPP;
-pub const EPFNOSUPPORT: ::c_int = 96;
-pub const EAFNOSUPPORT: ::c_int = 97;
-pub const EADDRINUSE: ::c_int = 98;
-pub const EADDRNOTAVAIL: ::c_int = 99;
-pub const ENETDOWN: ::c_int = 100;
-pub const ENETUNREACH: ::c_int = 101;
-pub const ENETRESET: ::c_int = 102;
-pub const ECONNABORTED: ::c_int = 103;
-pub const ECONNRESET: ::c_int = 104;
-pub const ENOBUFS: ::c_int = 105;
-pub const EISCONN: ::c_int = 106;
-pub const ENOTCONN: ::c_int = 107;
-pub const ESHUTDOWN: ::c_int = 108;
-pub const ETOOMANYREFS: ::c_int = 109;
-pub const ETIMEDOUT: ::c_int = 110;
-pub const ECONNREFUSED: ::c_int = 111;
-pub const EHOSTDOWN: ::c_int = 112;
-pub const EHOSTUNREACH: ::c_int = 113;
-pub const EALREADY: ::c_int = 114;
-pub const EINPROGRESS: ::c_int = 115;
-pub const ESTALE: ::c_int = 116;
-pub const EUCLEAN: ::c_int = 117;
-pub const ENOTNAM: ::c_int = 118;
-pub const ENAVAIL: ::c_int = 119;
-pub const EISNAM: ::c_int = 120;
-pub const EREMOTEIO: ::c_int = 121;
-pub const EDQUOT: ::c_int = 122;
-pub const ENOMEDIUM: ::c_int = 123;
-pub const EMEDIUMTYPE: ::c_int = 124;
-pub const ECANCELED: ::c_int = 125;
-pub const ENOKEY: ::c_int = 126;
-pub const EKEYEXPIRED: ::c_int = 127;
-pub const EKEYREVOKED: ::c_int = 128;
-pub const EKEYREJECTED: ::c_int = 129;
-pub const EOWNERDEAD: ::c_int = 130;
-pub const ENOTRECOVERABLE: ::c_int = 131;
-pub const ERFKILL: ::c_int = 132;
-pub const EHWPOISON: ::c_int = 133;
-
pub const SO_REUSEADDR: ::c_int = 2;
pub const SO_TYPE: ::c_int = 3;
pub const SO_ERROR: ::c_int = 4;
@@ -1697,7 +1732,7 @@ f! {
pub fn major(dev: ::dev_t) -> ::c_uint {
// see
- // https://github.com/kripken/emscripten/blob/
+ // https://github.com/emscripten-core/emscripten/blob/
// master/system/include/libc/sys/sysmacros.h
let mut major = 0;
major |= (dev & 0x00000fff) >> 8;
@@ -1707,7 +1742,7 @@ f! {
pub fn minor(dev: ::dev_t) -> ::c_uint {
// see
- // https://github.com/kripken/emscripten/blob/
+ // https://github.com/emscripten-core/emscripten/blob/
// master/system/include/libc/sys/sysmacros.h
let mut minor = 0;
minor |= (dev & 0x000000ff) >> 0;
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index 220b38ebd5bda..1879eec550ff4 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -494,6 +494,16 @@ s! {
pub rm_so: regoff_t,
pub rm_eo: regoff_t,
}
+
+ pub struct sock_extended_err {
+ pub ee_errno: u32,
+ pub ee_origin: u8,
+ pub ee_type: u8,
+ pub ee_code: u8,
+ pub ee_pad: u8,
+ pub ee_info: u32,
+ pub ee_data: u32,
+ }
}
s_no_extra_traits! {
@@ -1583,6 +1593,7 @@ pub const ENOATTR: ::c_int = ::ENODATA;
pub const SO_ORIGINAL_DST: ::c_int = 80;
pub const IP_ORIGDSTADDR: ::c_int = 20;
pub const IP_RECVORIGDSTADDR: ::c_int = IP_ORIGDSTADDR;
+pub const IPV6_FLOWINFO: ::c_int = 11;
pub const IPV6_ORIGDSTADDR: ::c_int = 74;
pub const IPV6_RECVORIGDSTADDR: ::c_int = IPV6_ORIGDSTADDR;
pub const IPV6_FLOWLABEL_MGR: ::c_int = 32;
@@ -2540,6 +2551,51 @@ pub const REG_ERANGE: ::c_int = 11;
pub const REG_ESPACE: ::c_int = 12;
pub const REG_BADRPT: ::c_int = 13;
+// linux/errqueue.h
+pub const SO_EE_ORIGIN_NONE: u8 = 0;
+pub const SO_EE_ORIGIN_LOCAL: u8 = 1;
+pub const SO_EE_ORIGIN_ICMP: u8 = 2;
+pub const SO_EE_ORIGIN_ICMP6: u8 = 3;
+pub const SO_EE_ORIGIN_TXSTATUS: u8 = 4;
+pub const SO_EE_ORIGIN_TIMESTAMPING: u8 = SO_EE_ORIGIN_TXSTATUS;
+
+// errno.h
+pub const EPERM: ::c_int = 1;
+pub const ENOENT: ::c_int = 2;
+pub const ESRCH: ::c_int = 3;
+pub const EINTR: ::c_int = 4;
+pub const EIO: ::c_int = 5;
+pub const ENXIO: ::c_int = 6;
+pub const E2BIG: ::c_int = 7;
+pub const ENOEXEC: ::c_int = 8;
+pub const EBADF: ::c_int = 9;
+pub const ECHILD: ::c_int = 10;
+pub const EAGAIN: ::c_int = 11;
+pub const ENOMEM: ::c_int = 12;
+pub const EACCES: ::c_int = 13;
+pub const EFAULT: ::c_int = 14;
+pub const ENOTBLK: ::c_int = 15;
+pub const EBUSY: ::c_int = 16;
+pub const EEXIST: ::c_int = 17;
+pub const EXDEV: ::c_int = 18;
+pub const ENODEV: ::c_int = 19;
+pub const ENOTDIR: ::c_int = 20;
+pub const EISDIR: ::c_int = 21;
+pub const EINVAL: ::c_int = 22;
+pub const ENFILE: ::c_int = 23;
+pub const EMFILE: ::c_int = 24;
+pub const ENOTTY: ::c_int = 25;
+pub const ETXTBSY: ::c_int = 26;
+pub const EFBIG: ::c_int = 27;
+pub const ENOSPC: ::c_int = 28;
+pub const ESPIPE: ::c_int = 29;
+pub const EROFS: ::c_int = 30;
+pub const EMLINK: ::c_int = 31;
+pub const EPIPE: ::c_int = 32;
+pub const EDOM: ::c_int = 33;
+pub const ERANGE: ::c_int = 34;
+pub const EWOULDBLOCK: ::c_int = EAGAIN;
+
f! {
pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)
@@ -2640,6 +2696,10 @@ f! {
pub fn RT_LOCALADDR(flags: u32) -> bool {
(flags & RTF_ADDRCLASSMASK) == (RTF_LOCAL | RTF_INTERFACE)
}
+
+ pub fn SO_EE_OFFENDER(ee: *const ::sock_extended_err) -> *mut ::sockaddr {
+ ee.offset(1) as *mut ::sockaddr
+ }
}
extern "C" {
diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs
index a867ed4b08072..fa93386f81595 100644
--- a/src/unix/linux_like/mod.rs
+++ b/src/unix/linux_like/mod.rs
@@ -199,16 +199,6 @@ s! {
pub msg_hdr: ::msghdr,
pub msg_len: ::c_uint,
}
-
- pub struct sock_extended_err {
- pub ee_errno: u32,
- pub ee_origin: u8,
- pub ee_type: u8,
- pub ee_code: u8,
- pub ee_pad: u8,
- pub ee_info: u32,
- pub ee_data: u32
- }
}
s_no_extra_traits! {
@@ -609,42 +599,6 @@ pub const MS_ACTIVE: ::c_ulong = 0x40000000;
pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000;
pub const MS_MGC_MSK: ::c_ulong = 0xffff0000;
-pub const EPERM: ::c_int = 1;
-pub const ENOENT: ::c_int = 2;
-pub const ESRCH: ::c_int = 3;
-pub const EINTR: ::c_int = 4;
-pub const EIO: ::c_int = 5;
-pub const ENXIO: ::c_int = 6;
-pub const E2BIG: ::c_int = 7;
-pub const ENOEXEC: ::c_int = 8;
-pub const EBADF: ::c_int = 9;
-pub const ECHILD: ::c_int = 10;
-pub const EAGAIN: ::c_int = 11;
-pub const ENOMEM: ::c_int = 12;
-pub const EACCES: ::c_int = 13;
-pub const EFAULT: ::c_int = 14;
-pub const ENOTBLK: ::c_int = 15;
-pub const EBUSY: ::c_int = 16;
-pub const EEXIST: ::c_int = 17;
-pub const EXDEV: ::c_int = 18;
-pub const ENODEV: ::c_int = 19;
-pub const ENOTDIR: ::c_int = 20;
-pub const EISDIR: ::c_int = 21;
-pub const EINVAL: ::c_int = 22;
-pub const ENFILE: ::c_int = 23;
-pub const EMFILE: ::c_int = 24;
-pub const ENOTTY: ::c_int = 25;
-pub const ETXTBSY: ::c_int = 26;
-pub const EFBIG: ::c_int = 27;
-pub const ENOSPC: ::c_int = 28;
-pub const ESPIPE: ::c_int = 29;
-pub const EROFS: ::c_int = 30;
-pub const EMLINK: ::c_int = 31;
-pub const EPIPE: ::c_int = 32;
-pub const EDOM: ::c_int = 33;
-pub const ERANGE: ::c_int = 34;
-pub const EWOULDBLOCK: ::c_int = EAGAIN;
-
pub const SCM_RIGHTS: ::c_int = 0x01;
pub const SCM_CREDENTIALS: ::c_int = 0x02;
@@ -836,7 +790,6 @@ pub const IPV6_2292PKTOPTIONS: ::c_int = 6;
pub const IPV6_CHECKSUM: ::c_int = 7;
pub const IPV6_2292HOPLIMIT: ::c_int = 8;
pub const IPV6_NEXTHOP: ::c_int = 9;
-pub const IPV6_FLOWINFO: ::c_int = 11;
pub const IPV6_UNICAST_HOPS: ::c_int = 16;
pub const IPV6_MULTICAST_IF: ::c_int = 17;
pub const IPV6_MULTICAST_HOPS: ::c_int = 18;
@@ -1202,13 +1155,6 @@ pub const ARPHRD_IEEE802154: u16 = 804;
pub const ARPHRD_VOID: u16 = 0xFFFF;
pub const ARPHRD_NONE: u16 = 0xFFFE;
-pub const SO_EE_ORIGIN_NONE: u8 = 0;
-pub const SO_EE_ORIGIN_LOCAL: u8 = 1;
-pub const SO_EE_ORIGIN_ICMP: u8 = 2;
-pub const SO_EE_ORIGIN_ICMP6: u8 = 3;
-pub const SO_EE_ORIGIN_TXSTATUS: u8 = 4;
-pub const SO_EE_ORIGIN_TIMESTAMPING: u8 = SO_EE_ORIGIN_TXSTATUS;
-
const_fn! {
{const} fn CMSG_ALIGN(len: usize) -> usize {
len + ::mem::size_of::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)
@@ -1314,10 +1260,6 @@ f! {
pub fn IPTOS_ECN(x: u8) -> u8 {
x & ::IPTOS_ECN_MASK
}
-
- pub fn SO_EE_OFFENDER(ee: *const ::sock_extended_err) -> *mut ::sockaddr {
- ee.offset(1) as *mut ::sockaddr
- }
}
extern "C" {
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 4e5d1e0489217..0d96f9dd1720d 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2008,6 +2008,14 @@ fn test_emscripten(target: &str) {
// FIXME: is this necessary?
"sigval" => true,
+ // FIXME: It was removed in
+ // emscripten-core/emscripten@953e414
+ "pthread_mutexattr_t" => true,
+
+ // FIXME: Investigate why the test fails.
+ // Skip for now to unblock CI.
+ "pthread_condattr_t" => true,
+
_ => false,
}
});
@@ -2017,6 +2025,9 @@ fn test_emscripten(target: &str) {
// FIXME: https://github.com/rust-lang/libc/issues/1272
"execv" | "execve" | "execvp" | "execvpe" | "fexecve" => true,
+ // FIXME: Investigate why CI is missing it.
+ "clearenv" => true,
+
_ => false,
}
});
@@ -2030,6 +2041,10 @@ fn test_emscripten(target: &str) {
// FIXME: emscripten uses different constants to constructs these
n if n.contains("__SIZEOF_PTHREAD") => true,
+ // FIXME: `SYS_gettid` was removed in
+ // emscripten-core/emscripten@6d6474e
+ "SYS_gettid" => true,
+
_ => false,
}
});
|
Emscripten targets broken on CI
This tracks re-enabling CI for emscripten targets. This should happen when #1478 is merged.
|
2020-03-15T23:40:09Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 1,678
|
rust-lang__libc-1678
|
[
"1674"
] |
7455403a235202bc355b939b6172214ada79ac48
|
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index eb33d791c965d..e6d1ad77c1e3c 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -741,6 +741,37 @@ pub const NF_NETDEV_NUMHOOKS: ::c_int = 1;
pub const NFPROTO_INET: ::c_int = 1;
pub const NFPROTO_NETDEV: ::c_int = 5;
+// linux/keyctl.h
+pub const KEYCTL_DH_COMPUTE: u32 = 23;
+pub const KEYCTL_PKEY_QUERY: u32 = 24;
+pub const KEYCTL_PKEY_ENCRYPT: u32 = 25;
+pub const KEYCTL_PKEY_DECRYPT: u32 = 26;
+pub const KEYCTL_PKEY_SIGN: u32 = 27;
+pub const KEYCTL_PKEY_VERIFY: u32 = 28;
+pub const KEYCTL_RESTRICT_KEYRING: u32 = 29;
+
+pub const KEYCTL_SUPPORTS_ENCRYPT: u32 = 0x01;
+pub const KEYCTL_SUPPORTS_DECRYPT: u32 = 0x02;
+pub const KEYCTL_SUPPORTS_SIGN: u32 = 0x04;
+pub const KEYCTL_SUPPORTS_VERIFY: u32 = 0x08;
+cfg_if! {
+ if #[cfg(not(any(target_arch="mips", target_arch="mips64")))] {
+ pub const KEYCTL_MOVE: u32 = 30;
+ pub const KEYCTL_CAPABILITIES: u32 = 31;
+
+ pub const KEYCTL_CAPS0_CAPABILITIES: u32 = 0x01;
+ pub const KEYCTL_CAPS0_PERSISTENT_KEYRINGS: u32 = 0x02;
+ pub const KEYCTL_CAPS0_DIFFIE_HELLMAN: u32 = 0x04;
+ pub const KEYCTL_CAPS0_PUBLIC_KEY: u32 = 0x08;
+ pub const KEYCTL_CAPS0_BIG_KEY: u32 = 0x10;
+ pub const KEYCTL_CAPS0_INVALIDATE: u32 = 0x20;
+ pub const KEYCTL_CAPS0_RESTRICT_KEYRING: u32 = 0x40;
+ pub const KEYCTL_CAPS0_MOVE: u32 = 0x80;
+ pub const KEYCTL_CAPS1_NS_KEYRING_NAME: u32 = 0x01;
+ pub const KEYCTL_CAPS1_NS_KEY_TAG: u32 = 0x02;
+ }
+}
+
// linux/netfilter/nf_tables.h
pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256;
pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256;
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index fb2ad1aed79c4..9414b471cd497 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -2333,6 +2333,50 @@ pub const IN_ONLYDIR: u32 = 0x0100_0000;
pub const IN_DONT_FOLLOW: u32 = 0x0200_0000;
// pub const IN_EXCL_UNLINK: u32 = 0x0400_0000;
+// linux/keyctl.h
+pub const KEY_SPEC_THREAD_KEYRING: i32 = -1;
+pub const KEY_SPEC_PROCESS_KEYRING: i32 = -2;
+pub const KEY_SPEC_SESSION_KEYRING: i32 = -3;
+pub const KEY_SPEC_USER_KEYRING: i32 = -4;
+pub const KEY_SPEC_USER_SESSION_KEYRING: i32 = -5;
+pub const KEY_SPEC_GROUP_KEYRING: i32 = -6;
+pub const KEY_SPEC_REQKEY_AUTH_KEY: i32 = -7;
+pub const KEY_SPEC_REQUESTOR_KEYRING: i32 = -8;
+
+pub const KEY_REQKEY_DEFL_NO_CHANGE: i32 = -1;
+pub const KEY_REQKEY_DEFL_DEFAULT: i32 = 0;
+pub const KEY_REQKEY_DEFL_THREAD_KEYRING: i32 = 1;
+pub const KEY_REQKEY_DEFL_PROCESS_KEYRING: i32 = 2;
+pub const KEY_REQKEY_DEFL_SESSION_KEYRING: i32 = 3;
+pub const KEY_REQKEY_DEFL_USER_KEYRING: i32 = 4;
+pub const KEY_REQKEY_DEFL_USER_SESSION_KEYRING: i32 = 5;
+pub const KEY_REQKEY_DEFL_GROUP_KEYRING: i32 = 6;
+pub const KEY_REQKEY_DEFL_REQUESTOR_KEYRING: i32 = 7;
+
+pub const KEYCTL_GET_KEYRING_ID: u32 = 0;
+pub const KEYCTL_JOIN_SESSION_KEYRING: u32 = 1;
+pub const KEYCTL_UPDATE: u32 = 2;
+pub const KEYCTL_REVOKE: u32 = 3;
+pub const KEYCTL_CHOWN: u32 = 4;
+pub const KEYCTL_SETPERM: u32 = 5;
+pub const KEYCTL_DESCRIBE: u32 = 6;
+pub const KEYCTL_CLEAR: u32 = 7;
+pub const KEYCTL_LINK: u32 = 8;
+pub const KEYCTL_UNLINK: u32 = 9;
+pub const KEYCTL_SEARCH: u32 = 10;
+pub const KEYCTL_READ: u32 = 11;
+pub const KEYCTL_INSTANTIATE: u32 = 12;
+pub const KEYCTL_NEGATE: u32 = 13;
+pub const KEYCTL_SET_REQKEY_KEYRING: u32 = 14;
+pub const KEYCTL_SET_TIMEOUT: u32 = 15;
+pub const KEYCTL_ASSUME_AUTHORITY: u32 = 16;
+pub const KEYCTL_GET_SECURITY: u32 = 17;
+pub const KEYCTL_SESSION_TO_PARENT: u32 = 18;
+pub const KEYCTL_REJECT: u32 = 19;
+pub const KEYCTL_INSTANTIATE_IOV: u32 = 20;
+pub const KEYCTL_INVALIDATE: u32 = 21;
+pub const KEYCTL_GET_PERSISTENT: u32 = 22;
+
// pub const IN_MASK_CREATE: u32 = 0x1000_0000;
// pub const IN_MASK_ADD: u32 = 0x2000_0000;
pub const IN_ISDIR: u32 = 0x4000_0000;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 790bfa014e6aa..2a0f487166d65 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2237,6 +2237,7 @@ fn test_linux(target: &str) {
"linux/if_ether.h",
"linux/if_tun.h",
"linux/input.h",
+ "linux/keyctl.h",
"linux/magic.h",
"linux/memfd.h",
"linux/module.h",
|
keyctl syscall constants missing
As a follow up to #1663, I've done more research into the matter and see that there is a `keyctl` raw syscall as outlined [here](http://man7.org/linux/man-pages/man2/keyctl.2.html) and the syscall number is even already supported by the libc crate. It does seem like many of the constant values are missing from the libc crate however. I would like to add the constants referenced in `/usr/include/linux/keyctl.h`. Would a PR to add these be of interest?
|
2020-03-05T14:26:25Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 1,651
|
rust-lang__libc-1651
|
[
"1650"
] |
8af0d7f6c8c394239366ba7d69214c1953a8bf66
|
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index d87d241ecdeca..e88e4a61b6f53 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -1666,6 +1666,9 @@ pub const NF_IP6_PRI_SELINUX_LAST: ::c_int = 225;
pub const NF_IP6_PRI_CONNTRACK_HELPER: ::c_int = 300;
pub const NF_IP6_PRI_LAST: ::c_int = ::INT_MAX;
+// linux/netfilter_ipv6/ip6_tables.h
+pub const IP6T_SO_ORIGINAL_DST: ::c_int = 80;
+
// linux/netfilter/nf_tables.h
pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256;
pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256;
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index 9f1343a414d6f..fb2ad1aed79c4 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -1966,6 +1966,9 @@ pub const NF_IP6_PRI_SELINUX_LAST: ::c_int = 225;
pub const NF_IP6_PRI_CONNTRACK_HELPER: ::c_int = 300;
pub const NF_IP6_PRI_LAST: ::c_int = ::INT_MAX;
+// linux/netfilter_ipv6/ip6_tables.h
+pub const IP6T_SO_ORIGINAL_DST: ::c_int = 80;
+
pub const SIOCADDRT: ::c_ulong = 0x0000890B;
pub const SIOCDELRT: ::c_ulong = 0x0000890C;
pub const SIOCGIFNAME: ::c_ulong = 0x00008910;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index d16f0945599ff..790bfa014e6aa 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -1357,6 +1357,7 @@ fn test_android(target: &str) {
"linux/netfilter/nf_tables.h",
"linux/netfilter_ipv4.h",
"linux/netfilter_ipv6.h",
+ "linux/netfilter_ipv6/ip6_tables.h",
"linux/netlink.h",
"linux/quota.h",
"linux/reboot.h",
@@ -2246,6 +2247,7 @@ fn test_linux(target: &str) {
"linux/netfilter/nf_tables.h",
"linux/netfilter_ipv4.h",
"linux/netfilter_ipv6.h",
+ "linux/netfilter_ipv6/ip6_tables.h",
"linux/netlink.h",
"linux/quota.h",
"linux/random.h",
|
Add IP6T_SO_ORIGINAL_DST for Linux
## Target
- `i686-unknown-linux-gnu`
- `x86_64-unknown-linux-gnu`
## References
```c
// For IPv4, we can use SO_ORIGINAL_DST on SOL_IP level
ret = getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, destaddr, &socklen);
// For IPv6, we should use IP6T_SO_ORIGINAL_DST on SOL_IPV6 level
ret = getsockopt(fd, SOL_IPV6, IP6T_SO_ORIGINAL_DST, destaddr, &socklen);
```
Defined in `#include <linux/netfilter_ipv6/ip6_tables.h>`
```c
#define IP6T_SO_ORIGINAL_DST 80
```
|
But actually, `IP6T_SO_ORIGINAL_DST` has exactly the same value as `SO_ORIGINAL_DST`.
https://patchwork.ozlabs.org/patch/195443/
We can use `SO_ORIGINAL_DST` for now, temporary.
|
2020-02-01T03:19:37Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 1,586
|
rust-lang__libc-1586
|
[
"1585"
] |
13d4a5da2eafd82d3ebb2acb729d8b8c9148fb1f
|
diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs
index 5ce68e2c17fa6..970cb233a191a 100644
--- a/src/unix/bsd/netbsdlike/mod.rs
+++ b/src/unix/bsd/netbsdlike/mod.rs
@@ -10,6 +10,7 @@ pub type nl_item = c_long;
pub type clockid_t = ::c_int;
pub type id_t = u32;
pub type sem_t = *mut sem;
+pub type key_t = c_long;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
@@ -63,6 +64,16 @@ s! {
pub l_type: ::c_short,
pub l_whence: ::c_short,
}
+
+ pub struct ipc_perm {
+ pub cuid: ::uid_t,
+ pub cgid: ::gid_t,
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ pub mode: ::mode_t,
+ pub seq: ::c_ushort,
+ pub key: ::key_t,
+ }
}
pub const D_T_FMT: ::nl_item = 0;
@@ -199,9 +210,20 @@ pub const MAP_SHARED: ::c_int = 0x0001;
pub const MAP_PRIVATE: ::c_int = 0x0002;
pub const MAP_FIXED: ::c_int = 0x0010;
pub const MAP_ANON: ::c_int = 0x1000;
+pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
+pub const IPC_CREAT: ::c_int = 0o001000;
+pub const IPC_EXCL: ::c_int = 0o002000;
+pub const IPC_NOWAIT: ::c_int = 0o004000;
+
+pub const IPC_PRIVATE: ::key_t = 0;
+
+pub const IPC_RMID: ::c_int = 0;
+pub const IPC_SET: ::c_int = 1;
+pub const IPC_STAT: ::c_int = 2;
+
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
@@ -715,6 +737,19 @@ extern "C" {
pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
+
+ pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
+ pub fn shmat(
+ shmid: ::c_int,
+ shmaddr: *const ::c_void,
+ shmflg: ::c_int,
+ ) -> *mut ::c_void;
+ pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
+ pub fn shmctl(
+ shmid: ::c_int,
+ cmd: ::c_int,
+ buf: *mut ::shmid_ds,
+ ) -> ::c_int;
}
cfg_if! {
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index efd0405912b64..a5a2fc61d507d 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -9,6 +9,7 @@ pub type mqd_t = ::c_int;
type __pthread_spin_t = __cpu_simple_lock_nv_t;
pub type vm_size_t = ::uintptr_t;
pub type lwpid_t = ::c_uint;
+pub type shmatt_t = ::c_uint;
impl siginfo_t {
pub unsafe fn si_value(&self) -> ::sigval {
@@ -281,6 +282,18 @@ s! {
pub msg_hdr: ::msghdr,
pub msg_len: ::c_uint,
}
+
+ pub struct shmid_ds {
+ pub shm_perm: ::ipc_perm,
+ pub shm_segsz: ::size_t,
+ pub shm_lpid: ::pid_t,
+ pub shm_cpid: ::pid_t,
+ pub shm_nattch: ::shmatt_t,
+ pub shm_atime: ::time_t,
+ pub shm_dtime: ::time_t,
+ pub shm_ctime: ::time_t,
+ _shm_internal: *mut ::c_void,
+ }
}
s_no_extra_traits! {
diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs
index f70fddf59ceb5..0f9dd04f23fb9 100644
--- a/src/unix/bsd/netbsdlike/openbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs
@@ -306,6 +306,21 @@ s! {
pub ar_pln: u8,
pub ar_op: u16,
}
+
+ pub struct shmid_ds {
+ pub shm_perm: ::ipc_perm,
+ pub shm_segsz: ::c_int,
+ pub shm_lpid: ::pid_t,
+ pub shm_cpid: ::pid_t,
+ pub shm_nattch: ::c_short,
+ pub shm_atime: ::time_t,
+ __shm_atimensec: c_long,
+ pub shm_dtime: ::time_t,
+ __shm_dtimensec: c_long,
+ pub shm_ctime: ::time_t,
+ __shm_ctimensec: c_long,
+ pub shm_internal: *mut ::c_void,
+ }
}
impl siginfo_t {
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index b2512b85d6a9d..4ca79d72c1dc9 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -322,6 +322,7 @@ fn test_openbsd(target: &str) {
"ufs/ufs/quota.h",
"pthread_np.h",
"sys/syscall.h",
+ "sys/shm.h",
}
cfg.skip_struct(move |ty| {
@@ -818,6 +819,7 @@ fn test_netbsd(target: &str) {
"netinet/dccp.h",
"sys/event.h",
"sys/quota.h",
+ "sys/shm.h",
}
cfg.type_name(move |ty, is_struct, is_union| {
|
SysV IPC APIs missing on OpenBSD
See this issue: https://github.com/gnzlbg/slice_deque/issues/77#issue-518380526
|
cf landryb/libc@8c688c22bc25757f945f2acefc2d5038cb72229f for a quick wip. @semarie ?
@landryb thanks for the wip. I will use it as base for the PR.
I will have few fixes (but I will take care of that):
- `sys/shm.h` header is need in `libc-test/build.rs` for proper testsuite run
- `shm_segsz` is `int` and not a `size_t` on OpenBSD (hey, not posix compliant. I hope others crates doesn't rely on that)
- `struct shmid_ds` is incomplete
- few constants mismatches
|
2019-11-07T07:34:15Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 1,378
|
rust-lang__libc-1378
|
[
"1178"
] |
b6ab2f056c35caee56b47c5780d72da3c6d31697
|
diff --git a/src/unix/notbsd/linux/other/b32/arm.rs b/src/unix/notbsd/linux/other/b32/arm.rs
index 8396fcd501dc9..d058fc451e377 100644
--- a/src/unix/notbsd/linux/other/b32/arm.rs
+++ b/src/unix/notbsd/linux/other/b32/arm.rs
@@ -607,3 +607,4 @@ pub const SYS_pwritev2: ::c_long = 393;
pub const SYS_pkey_mprotect: ::c_long = 394;
pub const SYS_pkey_alloc: ::c_long = 395;
pub const SYS_pkey_free: ::c_long = 396;
+pub const SYS_statx: ::c_long = 397;
diff --git a/src/unix/notbsd/linux/other/b32/powerpc.rs b/src/unix/notbsd/linux/other/b32/powerpc.rs
index d609d6792398f..d6a1919cd5680 100644
--- a/src/unix/notbsd/linux/other/b32/powerpc.rs
+++ b/src/unix/notbsd/linux/other/b32/powerpc.rs
@@ -612,3 +612,4 @@ pub const SYS_copy_file_range: ::c_long = 379;
pub const SYS_preadv2: ::c_long = 380;
pub const SYS_pwritev2: ::c_long = 381;
pub const SYS_kexec_file_load: ::c_long = 382;
+pub const SYS_statx: ::c_long = 383;
diff --git a/src/unix/notbsd/linux/other/b32/x86.rs b/src/unix/notbsd/linux/other/b32/x86.rs
index 6ccbfbbdb1586..ff5abcfe6d5a8 100644
--- a/src/unix/notbsd/linux/other/b32/x86.rs
+++ b/src/unix/notbsd/linux/other/b32/x86.rs
@@ -840,6 +840,7 @@ pub const SYS_pwritev2: ::c_long = 379;
pub const SYS_pkey_mprotect: ::c_long = 380;
pub const SYS_pkey_alloc: ::c_long = 381;
pub const SYS_pkey_free: ::c_long = 382;
+pub const SYS_statx: ::c_long = 383;
// offsets in user_regs_structs, from sys/reg.h
pub const EBX: ::c_int = 0;
diff --git a/src/unix/notbsd/linux/other/b64/not_x32.rs b/src/unix/notbsd/linux/other/b64/not_x32.rs
index e3e449807f894..97e21f279df2a 100644
--- a/src/unix/notbsd/linux/other/b64/not_x32.rs
+++ b/src/unix/notbsd/linux/other/b64/not_x32.rs
@@ -408,6 +408,7 @@ pub const SYS_pwritev2: ::c_long = 328;
pub const SYS_pkey_mprotect: ::c_long = 329;
pub const SYS_pkey_alloc: ::c_long = 330;
pub const SYS_pkey_free: ::c_long = 331;
+pub const SYS_statx: ::c_long = 332;
#[link(name = "util")]
extern {
diff --git a/src/unix/notbsd/linux/other/b64/powerpc64.rs b/src/unix/notbsd/linux/other/b64/powerpc64.rs
index 89f5ca15f75d8..645cd908edf38 100644
--- a/src/unix/notbsd/linux/other/b64/powerpc64.rs
+++ b/src/unix/notbsd/linux/other/b64/powerpc64.rs
@@ -921,6 +921,7 @@ pub const SYS_copy_file_range: ::c_long = 379;
pub const SYS_preadv2: ::c_long = 380;
pub const SYS_pwritev2: ::c_long = 381;
pub const SYS_kexec_file_load: ::c_long = 382;
+pub const SYS_statx: ::c_long = 383;
#[link(name = "util")]
extern {
diff --git a/src/unix/notbsd/linux/other/b64/sparc64.rs b/src/unix/notbsd/linux/other/b64/sparc64.rs
index 7c1362711e7f4..f54504aea0f69 100644
--- a/src/unix/notbsd/linux/other/b64/sparc64.rs
+++ b/src/unix/notbsd/linux/other/b64/sparc64.rs
@@ -855,6 +855,7 @@ pub const SYS_mlock2: ::c_long = 356;
pub const SYS_copy_file_range: ::c_long = 357;
pub const SYS_preadv2: ::c_long = 358;
pub const SYS_pwritev2: ::c_long = 359;
+pub const SYS_statx: ::c_long = 360;
#[link(name = "util")]
extern {
diff --git a/src/unix/notbsd/linux/other/b64/x32.rs b/src/unix/notbsd/linux/other/b64/x32.rs
index d88dbafed83cf..37468818afb85 100644
--- a/src/unix/notbsd/linux/other/b64/x32.rs
+++ b/src/unix/notbsd/linux/other/b64/x32.rs
@@ -336,6 +336,7 @@ pub const SYS_copy_file_range: ::c_long = __X32_SYSCALL_BIT + 326;
pub const SYS_pkey_mprotect: ::c_long = __X32_SYSCALL_BIT + 329;
pub const SYS_pkey_alloc: ::c_long = __X32_SYSCALL_BIT + 330;
pub const SYS_pkey_free: ::c_long = __X32_SYSCALL_BIT + 331;
+pub const SYS_statx: ::c_long = __X32_SYSCALL_BIT + 332;
pub const SYS_rt_sigaction: ::c_long = __X32_SYSCALL_BIT + 512;
pub const SYS_rt_sigreturn: ::c_long = __X32_SYSCALL_BIT + 513;
pub const SYS_ioctl: ::c_long = __X32_SYSCALL_BIT + 514;
diff --git a/src/unix/notbsd/linux/other/mod.rs b/src/unix/notbsd/linux/other/mod.rs
index 26c9ad4c544a3..ad563fa86107b 100644
--- a/src/unix/notbsd/linux/other/mod.rs
+++ b/src/unix/notbsd/linux/other/mod.rs
@@ -3,6 +3,36 @@ pub type __priority_which_t = ::c_uint;
pub type __rlimit_resource_t = ::c_uint;
s! {
+ pub struct statx {
+ pub stx_mask: u32,
+ pub stx_blksize: u32,
+ pub stx_attributes: u64,
+ pub stx_nlink: u32,
+ pub stx_uid: u32,
+ pub stx_gid: u32,
+ pub stx_mode: u16,
+ pub __statx_pad1: [u16; 1],
+ pub stx_ino: u64,
+ pub stx_size: u64,
+ pub stx_blocks: u64,
+ pub stx_attributes_mask: u64,
+ pub stx_atime: ::statx_timestamp,
+ pub stx_btime: ::statx_timestamp,
+ pub stx_ctime: ::statx_timestamp,
+ pub stx_mtime: ::statx_timestamp,
+ pub stx_rdev_major: u32,
+ pub stx_rdev_minor: u32,
+ pub stx_dev_major: u32,
+ pub stx_dev_minor: u32,
+ pub __statx_pad2: [u64; 14],
+ }
+
+ pub struct statx_timestamp {
+ pub tv_sec: i64,
+ pub tv_nsec: u32,
+ pub __statx_timestamp_pad1: [i32; 1],
+ }
+
pub struct aiocb {
pub aio_fildes: ::c_int,
pub aio_lio_opcode: ::c_int,
@@ -931,6 +961,32 @@ pub const AF_MAX: ::c_int = 45;
#[doc(hidden)]
pub const PF_MAX: ::c_int = AF_MAX;
+pub const AT_STATX_SYNC_TYPE: ::c_int = 0x6000;
+pub const AT_STATX_SYNC_AS_STAT: ::c_int = 0x0000;
+pub const AT_STATX_FORCE_SYNC: ::c_int = 0x2000;
+pub const AT_STATX_DONT_SYNC: ::c_int = 0x4000;
+pub const STATX_TYPE: ::c_uint = 0x0001;
+pub const STATX_MODE: ::c_uint = 0x0002;
+pub const STATX_NLINK: ::c_uint = 0x0004;
+pub const STATX_UID: ::c_uint = 0x0008;
+pub const STATX_GID: ::c_uint = 0x0010;
+pub const STATX_ATIME: ::c_uint = 0x0020;
+pub const STATX_MTIME: ::c_uint = 0x0040;
+pub const STATX_CTIME: ::c_uint = 0x0080;
+pub const STATX_INO: ::c_uint = 0x0100;
+pub const STATX_SIZE: ::c_uint = 0x0200;
+pub const STATX_BLOCKS: ::c_uint = 0x0400;
+pub const STATX_BASIC_STATS: ::c_uint = 0x07ff;
+pub const STATX_BTIME: ::c_uint = 0x0800;
+pub const STATX_ALL: ::c_uint = 0x0fff;
+pub const STATX__RESERVED: ::c_int = 0x80000000;
+pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004;
+pub const STATX_ATTR_IMMUTABLE: ::c_int = 0x0010;
+pub const STATX_ATTR_APPEND: ::c_int = 0x0020;
+pub const STATX_ATTR_NODUMP: ::c_int = 0x0040;
+pub const STATX_ATTR_ENCRYPTED: ::c_int = 0x0800;
+pub const STATX_ATTR_AUTOMOUNT: ::c_int = 0x1000;
+
cfg_if! {
if #[cfg(any(target_arch = "arm", target_arch = "x86",
target_arch = "x86_64"))] {
@@ -981,6 +1037,8 @@ extern {
pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int;
pub fn gettimeofday(tp: *mut ::timeval,
tz: *mut ::timezone) -> ::c_int;
+ pub fn statx(dirfd: ::c_int, pathname: *const c_char, flags: ::c_int,
+ mask: ::c_uint, statxbuf: *mut statx) -> ::c_int;
}
#[link(name = "util")]
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index b199d1cfbc370..5087906486002 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -1860,6 +1860,7 @@ fn test_linux(target: &str) {
let x32 = target.contains("x32");
let mips = target.contains("mips");
let mips32_musl = mips && !target.contains("64") && musl;
+ let sparc64 = target.contains("sparc64");
let mut cfg = ctest::TestGenerator::new();
cfg.define("_GNU_SOURCE", None);
@@ -2193,6 +2194,10 @@ fn test_linux(target: &str) {
// https://github.com/gnzlbg/ctest/issues/68
"lio_listio" if musl => true,
+ // FIXME: the glibc version used by the Sparc64 build jobs
+ // which use Debian 10.0 is too old.
+ "statx" if sparc64 => true,
+
_ => false,
}
});
|
Add statx linux system call so we can implement fs::Metadata::created on Linux
Right now, `std::fs::Metadata::created` returns an `Err` on Linux. But the creation time is available with the `statx` system call.
https://unix.stackexchange.com/a/407305/289105
|
Should be fine to send a PR to add this API!
We haven't added other syscalls in the past (e.g. `memfd_create`: https://github.com/rust-lang/libc/pull/902#issuecomment-361280295). There is nothing blocking using this syscall in `std::fs` btw, you can just use `syscall` to call it yourselfe, like, e.g., I did with `memfd_create` here: https://github.com/gnzlbg/slice_deque/blob/master/src/mirrored/linux.rs#L18
---
EDIT: e.g. in the docs of `statx` it says:
> There is no glibc wrapper for statx(); see NOTES.
such that the only easy way to call it is using `syscall` anyways. If there isn't a `const` for doing this call, we should probably expose that constant here though.
@gnzlbg There is a `statx()` wrapper in glibc but the man page is not up-to-date (fixed upstream but not yet released).
I’m not sure what’s the best way to access the creation information under Linux (if I want to implement a workaround in the meantime), since you mentioned using the syscall directly (note btw that there’s no `SYS_statx` in the `libc` crate).
|
2019-05-29T10:56:45Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 1,354
|
rust-lang__libc-1354
|
[
"1338"
] |
bf85aa6dfc5b782eb372b987fbbe2bc50e27c61b
|
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index 9483e90b62458..53463abbc8e23 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -3045,6 +3045,8 @@ extern {
pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::c_void) -> ::c_int;
pub fn getutxent() -> *mut utmpx;
pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs
index 7a82a45e13f6b..5e0853bf51360 100644
--- a/src/unix/bsd/freebsdlike/mod.rs
+++ b/src/unix/bsd/freebsdlike/mod.rs
@@ -1095,7 +1095,8 @@ extern {
-> ::c_int;
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
-
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::timezone) -> ::c_int;
pub fn accept4(s: ::c_int, addr: *mut ::sockaddr,
addrlen: *mut ::socklen_t, flags: ::c_int) -> ::c_int;
pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index ad53c19b3b6ad..d4ccd6775a5bd 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -1492,6 +1492,9 @@ extern {
#[link_name = "__lutimes50"]
pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
+ #[link_name = "__gettimeofday50"]
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::c_void) -> ::c_int;
pub fn getnameinfo(sa: *const ::sockaddr,
salen: ::socklen_t,
host: *mut ::c_char,
diff --git a/src/unix/bsd/netbsdlike/openbsdlike/mod.rs b/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
index 223064b76eea4..bd20164b20a11 100644
--- a/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
@@ -895,6 +895,8 @@ f! {
}
extern {
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::timezone) -> ::c_int;
pub fn chflags(path: *const ::c_char, flags: ::c_uint) -> ::c_int;
pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int;
pub fn chflagsat(fd: ::c_int, path: *const ::c_char, flags: ::c_uint,
diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs
index 26519a4770d8e..8eb8bffc3da5f 100644
--- a/src/unix/haiku/mod.rs
+++ b/src/unix/haiku/mod.rs
@@ -1264,7 +1264,8 @@ extern {
errno: ::c_int) -> ::c_int>,
pglob: *mut ::glob_t) -> ::c_int;
pub fn globfree(pglob: *mut ::glob_t);
-
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::c_void) -> ::c_int;
pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
-> ::c_int;
diff --git a/src/unix/hermit/mod.rs b/src/unix/hermit/mod.rs
index 288cc46a50693..583056bac4bda 100644
--- a/src/unix/hermit/mod.rs
+++ b/src/unix/hermit/mod.rs
@@ -981,6 +981,8 @@ extern {
pub fn clock_gettime(clock_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::c_void) -> ::c_int;
pub fn getpwuid_r(uid: ::uid_t, pwd: *mut passwd, buf: *mut ::c_char,
buflen: ::size_t, result: *mut *mut passwd) -> ::c_int;
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index 1565b6338c121..b85a27108926f 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -849,17 +849,6 @@ extern {
pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int;
- #[cfg_attr(target_os = "netbsd", link_name = "__gettimeofday50")]
- #[deprecated(
- since="0.2.54",
- note=
- "The signature of this function is incorrect. \
- If you are using it, please report that in the following issue \
- so that we can evaluate the impact of fixing it: \
- https://github.com/rust-lang/libc/issues/1338"
- )]
- pub fn gettimeofday(tp: *mut ::timeval,
- tz: *mut ::c_void) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__times13")]
pub fn times(buf: *mut ::tms) -> ::clock_t;
diff --git a/src/unix/newlib/mod.rs b/src/unix/newlib/mod.rs
index c9a25a35d41e5..ea52ff560ad93 100644
--- a/src/unix/newlib/mod.rs
+++ b/src/unix/newlib/mod.rs
@@ -623,6 +623,8 @@ extern {
pub fn fexecve(fd: ::c_int, argv: *const *const ::c_char,
envp: *const *const ::c_char)
-> ::c_int;
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::c_void) -> ::c_int;
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")]
pub fn getgrgid_r(gid: ::gid_t,
grp: *mut ::group,
diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs
index a430b1a00d5ef..46dd6092402a1 100644
--- a/src/unix/notbsd/android/mod.rs
+++ b/src/unix/notbsd/android/mod.rs
@@ -1924,6 +1924,8 @@ extern {
}
extern {
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::timezone) -> ::c_int;
pub fn madvise(addr: *const ::c_void, len: ::size_t, advice: ::c_int)
-> ::c_int;
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
diff --git a/src/unix/notbsd/emscripten/mod.rs b/src/unix/notbsd/emscripten/mod.rs
index 0f8c76e3ab6d0..8521d5dc4cb84 100644
--- a/src/unix/notbsd/emscripten/mod.rs
+++ b/src/unix/notbsd/emscripten/mod.rs
@@ -1689,6 +1689,9 @@ extern {
pub fn rand() -> ::c_int;
pub fn srand(seed: ::c_uint);
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::c_void) -> ::c_int;
+
pub fn setpwent();
pub fn endpwent();
pub fn getpwent() -> *mut passwd;
diff --git a/src/unix/notbsd/linux/musl/mod.rs b/src/unix/notbsd/linux/musl/mod.rs
index 4f4a3d868af0b..154a47ad8e5cc 100644
--- a/src/unix/notbsd/linux/musl/mod.rs
+++ b/src/unix/notbsd/linux/musl/mod.rs
@@ -322,6 +322,8 @@ pub const SO_PEEK_OFF: ::c_int = 42;
pub const SO_BUSY_POLL: ::c_int = 46;
extern {
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::c_void) -> ::c_int;
pub fn ptrace(request: ::c_int, ...) -> ::c_long;
pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
diff --git a/src/unix/notbsd/linux/other/mod.rs b/src/unix/notbsd/linux/other/mod.rs
index 1a97d1c8d6df2..169c1a8b869a7 100644
--- a/src/unix/notbsd/linux/other/mod.rs
+++ b/src/unix/notbsd/linux/other/mod.rs
@@ -916,6 +916,8 @@ extern {
pub fn endutxent();
pub fn getpt() -> ::c_int;
pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int;
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::timezone) -> ::c_int;
}
#[link(name = "util")]
diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs
index d0905e11ffd79..6b8adba4e74ea 100644
--- a/src/unix/notbsd/mod.rs
+++ b/src/unix/notbsd/mod.rs
@@ -1265,7 +1265,6 @@ extern {
pshared: ::c_int,
value: ::c_uint)
-> ::c_int;
-
pub fn fdatasync(fd: ::c_int) -> ::c_int;
pub fn mincore(addr: *mut ::c_void, len: ::size_t,
vec: *mut ::c_uchar) -> ::c_int;
diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs
index 4bb1ab4ba4579..9f22ca2022345 100644
--- a/src/unix/redox/mod.rs
+++ b/src/unix/redox/mod.rs
@@ -584,5 +584,7 @@ extern {
iovcnt: ::c_int) -> ::ssize_t;
// time.h
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::timezone) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
}
diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs
index 1092d152dea75..887cfc347bc54 100644
--- a/src/unix/solarish/mod.rs
+++ b/src/unix/solarish/mod.rs
@@ -1800,6 +1800,8 @@ extern {
pub fn rand() -> ::c_int;
pub fn srand(seed: ::c_uint);
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::c_void) -> ::c_int;
pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
pub fn freeifaddrs(ifa: *mut ::ifaddrs);
diff --git a/src/unix/uclibc/mod.rs b/src/unix/uclibc/mod.rs
index e3baba0614ebb..4cb430b15f9c3 100644
--- a/src/unix/uclibc/mod.rs
+++ b/src/unix/uclibc/mod.rs
@@ -1500,6 +1500,8 @@ extern {
pub fn srand(seed: ::c_uint);
pub fn fdatasync(fd: ::c_int) -> ::c_int;
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::timezone) -> ::c_int;
pub fn mincore(addr: *mut ::c_void, len: ::size_t,
vec: *mut ::c_uchar) -> ::c_int;
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 6541fd5bd5801..03d0b55b392b7 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -315,9 +315,6 @@ fn test_openbsd(target: &str) {
match name {
"execv" | "execve" | "execvp" | "execvpe" => true,
- // typed 2nd arg
- "gettimeofday" => true,
-
// Removed in OpenBSD 6.5
// https://marc.info/?l=openbsd-cvs&m=154723400730318
"mincore" => true,
@@ -1113,9 +1110,8 @@ fn test_dragonflybsd(target: &str) {
"getrlimit" | "getrlimit64" | // non-int in 1st arg
"setrlimit" | "setrlimit64" | // non-int in 1st arg
- "prlimit" | "prlimit64" | // non-int in 2nd arg
- // typed 2nd arg on linux
- "gettimeofday" => true,
+ "prlimit" | "prlimit64" // non-int in 2nd arg
+ => true,
_ => false,
}
@@ -1461,10 +1457,6 @@ fn test_android(target: &str) {
"execvpe" |
"fexecve" => true,
- // typed 2nd arg on android
- // FIXME: still necessary?
- "gettimeofday" => true,
-
// not declared in newer android toolchains
// FIXME: still necessary?
"getdtablesize" => true,
@@ -1815,9 +1807,6 @@ fn test_freebsd(target: &str) {
"execvpe" |
"fexecve" => true,
- // FIXME: for some reason, our signature is wrong
- "gettimeofday" => true,
-
// The `uname` function in freebsd is now an inline wrapper that
// delegates to another, but the symbol still exists, so don't check
// the symbol.
@@ -2701,10 +2690,6 @@ fn test_linux(target: &str) {
// FIXME: is this necessary?
"sendmmsg" | "recvmmsg" if musl => true,
- // typed 2nd arg on linux
- // FIXME: is this necessary?
- "gettimeofday" => true,
-
// FIXME: is this necessary?
"dladdr" if musl => true, // const-ness only added recently
|
gettimeofday has incorrect signature
The signature of `gettimeofday` incorrect on ~~most~~ all targets:
```
error: incompatible pointer types returning 'int (struct timeval *, struct timezone *)' from a function with result type 'int (*)(struct timeval *, void *)' [-Werror,-Wincompatible-pointer-types]
cargo:warning= return gettimeofday;
```
we should see if we can fix it. Will depend on how many crates are using it.
|
Found this warning from [parking_lot_core 0.4.0](https://crates.io/crates/parking_lot_core). Seems to still be in use in master also.
Code: https://github.com/Amanieu/parking_lot/blob/3259fd72e0d76e9c9a6f31ff41a996648fe9ccfa/core/src/thread_parker/unix.rs#L210
```
warning: use of deprecated item 'libc::gettimeofday': The signature of this function is incorrect. If you are using it, please report that in the following issue so that we can e
valuate the impact of fixing it: https://github.com/rust-lang/libc/issues/1338
--> /Users/oherrala/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot_core-0.4.0/src/thread_parker/unix.rs:200:13
|
200 | let r = libc::gettimeofday(&mut now, ptr::null_mut());
| ^^^^^^^^^^^^^^^^^^
```
Found this warning from time 0.1.42. Still in use in master also.
Code: https://github.com/rust-lang-deprecated/time/blob/324d2eb89354c412f520dbb29ef2c812085010a9/src/sys.rs#L497
```
warning: use of deprecated item 'libc::gettimeofday': The signature of this function is incorrect. If you are using it, please report that in the following issue so that we can evaluate the impact of fixing it: https://github.com/rust-lang/libc/issues/1338
--> /Users/oherrala/.cargo/registry/src/github.com-1ecc6299db9ec823/time-0.1.42/src/sys.rs:497:22
|
497 | unsafe { libc::gettimeofday(&mut tv, ptr::null_mut()); }
| ^^^^^^^^^^^^^^^^^^
```
I can probably update `parking_lot` quickly if you change the signature. I'm working on pretty large changes there as we speak anyway. So don't let that library hold you back IMO.
Thank you both, it seems that we can't easily fix the signature of `gettimeofday` without breaking a lot of code.
|
2019-05-21T12:03:29Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 1,351
|
rust-lang__libc-1351
|
[
"1059"
] |
caf17a0641d29dc624621177f5756804dd180c13
|
diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs
index 2419a41d4c4c4..89c79620f76b1 100644
--- a/src/unix/notbsd/linux/mod.rs
+++ b/src/unix/notbsd/linux/mod.rs
@@ -1024,6 +1024,36 @@ pub const IFF_LOWER_UP: ::c_int = 0x10000;
pub const IFF_DORMANT: ::c_int = 0x20000;
pub const IFF_ECHO: ::c_int = 0x40000;
+// linux/if_addr.h
+pub const IFA_UNSPEC: ::c_ushort = 0;
+pub const IFA_ADDRESS: ::c_ushort = 1;
+pub const IFA_LOCAL: ::c_ushort = 2;
+pub const IFA_LABEL: ::c_ushort = 3;
+pub const IFA_BROADCAST: ::c_ushort = 4;
+pub const IFA_ANYCAST: ::c_ushort = 5;
+pub const IFA_CACHEINFO: ::c_ushort = 6;
+pub const IFA_MULTICAST: ::c_ushort = 7;
+
+pub const IFA_F_SECONDARY: u32 = 0x01;
+pub const IFA_F_TEMPORARY: u32 = 0x01;
+pub const IFA_F_NODAD: u32 = 0x02;
+pub const IFA_F_OPTIMISTIC: u32 = 0x04;
+pub const IFA_F_DADFAILED: u32 = 0x08;
+pub const IFA_F_HOMEADDRESS: u32 = 0x10;
+pub const IFA_F_DEPRECATED: u32 = 0x20;
+pub const IFA_F_TENTATIVE: u32 = 0x40;
+pub const IFA_F_PERMANENT: u32 = 0x80;
+
+// linux/if_link.h
+pub const IFLA_UNSPEC: ::c_ushort = 0;
+pub const IFLA_ADDRESS: ::c_ushort = 1;
+pub const IFLA_BROADCAST: ::c_ushort = 2;
+pub const IFLA_IFNAME: ::c_ushort = 3;
+pub const IFLA_MTU: ::c_ushort = 4;
+pub const IFLA_LINK: ::c_ushort = 5;
+pub const IFLA_QDISC: ::c_ushort = 6;
+pub const IFLA_STATS: ::c_ushort = 7;
+
// linux/if_tun.h
pub const IFF_TUN: ::c_short = 0x0001;
pub const IFF_TAP: ::c_short = 0x0002;
@@ -1767,6 +1797,89 @@ pub const RT_CLASS_MAIN: u8 = 254;
pub const RT_CLASS_LOCAL: u8 = 255;
pub const RT_CLASS_MAX: u8 = 255;
+// linux/neighbor.h
+pub const NUD_NONE: u16 = 0x00;
+pub const NUD_INCOMPLETE: u16 = 0x01;
+pub const NUD_REACHABLE: u16 = 0x02;
+pub const NUD_STALE: u16 = 0x04;
+pub const NUD_DELAY: u16 = 0x08;
+pub const NUD_PROBE: u16 = 0x10;
+pub const NUD_FAILED: u16 = 0x20;
+pub const NUD_NOARP: u16 = 0x40;
+pub const NUD_PERMANENT: u16 = 0x80;
+
+pub const NTF_USE: u8 = 0x01;
+pub const NTF_SELF: u8 = 0x02;
+pub const NTF_MASTER: u8 = 0x04;
+pub const NTF_PROXY: u8 = 0x08;
+pub const NTF_ROUTER: u8 = 0x80;
+
+pub const NDA_UNSPEC: ::c_ushort = 0;
+pub const NDA_DST: ::c_ushort = 1;
+pub const NDA_LLADDR: ::c_ushort = 2;
+pub const NDA_CACHEINFO: ::c_ushort = 3;
+pub const NDA_PROBES: ::c_ushort = 4;
+pub const NDA_VLAN: ::c_ushort = 5;
+pub const NDA_PORT: ::c_ushort = 6;
+pub const NDA_VNI: ::c_ushort = 7;
+pub const NDA_IFINDEX: ::c_ushort = 8;
+
+// linux/rtnetlink.h
+pub const RTM_F_NOTIFY: ::c_uint = 0x100;
+pub const RTM_F_CLONED: ::c_uint = 0x200;
+pub const RTM_F_EQUALIZE: ::c_uint = 0x400;
+pub const RTM_F_PREFIX: ::c_uint = 0x800;
+
+pub const RTA_UNSPEC: ::c_ushort = 0;
+pub const RTA_DST: ::c_ushort = 1;
+pub const RTA_SRC: ::c_ushort = 2;
+pub const RTA_IIF: ::c_ushort = 3;
+pub const RTA_OIF: ::c_ushort = 4;
+pub const RTA_GATEWAY: ::c_ushort = 5;
+pub const RTA_PRIORITY: ::c_ushort = 6;
+pub const RTA_PREFSRC: ::c_ushort = 7;
+pub const RTA_METRICS: ::c_ushort = 8;
+pub const RTA_MULTIPATH: ::c_ushort = 9;
+pub const RTA_PROTOINFO: ::c_ushort = 10; // No longer used
+pub const RTA_FLOW: ::c_ushort = 11;
+pub const RTA_CACHEINFO: ::c_ushort = 12;
+pub const RTA_SESSION: ::c_ushort = 13; // No longer used
+pub const RTA_MP_ALGO: ::c_ushort = 14; // No longer used
+pub const RTA_TABLE: ::c_ushort = 15;
+pub const RTA_MARK: ::c_ushort = 16;
+pub const RTA_MFC_STATS: ::c_ushort = 17;
+
+pub const RTN_UNSPEC: ::c_uchar = 0;
+pub const RTN_UNICAST: ::c_uchar = 1;
+pub const RTN_LOCAL: ::c_uchar = 2;
+pub const RTN_BROADCAST: ::c_uchar = 3;
+pub const RTN_ANYCAST: ::c_uchar = 4;
+pub const RTN_MULTICAST: ::c_uchar = 5;
+pub const RTN_BLACKHOLE: ::c_uchar = 6;
+pub const RTN_UNREACHABLE: ::c_uchar = 7;
+pub const RTN_PROHIBIT: ::c_uchar = 8;
+pub const RTN_THROW: ::c_uchar = 9;
+pub const RTN_NAT: ::c_uchar = 10;
+pub const RTN_XRESOLVE: ::c_uchar = 11;
+
+pub const RTPROT_UNSPEC: ::c_uchar = 0;
+pub const RTPROT_REDIRECT: ::c_uchar = 1;
+pub const RTPROT_KERNEL: ::c_uchar = 2;
+pub const RTPROT_BOOT: ::c_uchar = 3;
+pub const RTPROT_STATIC: ::c_uchar = 4;
+
+pub const RT_SCOPE_UNIVERSE: ::c_uchar = 0;
+pub const RT_SCOPE_SITE: ::c_uchar = 200;
+pub const RT_SCOPE_LINK: ::c_uchar = 253;
+pub const RT_SCOPE_HOST: ::c_uchar = 254;
+pub const RT_SCOPE_NOWHERE: ::c_uchar = 255;
+
+pub const RT_TABLE_UNSPEC: ::c_uchar = 0;
+pub const RT_TABLE_COMPAT: ::c_uchar = 252;
+pub const RT_TABLE_DEFAULT: ::c_uchar = 253;
+pub const RT_TABLE_MAIN: ::c_uchar = 254;
+pub const RT_TABLE_LOCAL: ::c_uchar = 255;
+
pub const RTMSG_OVERRUN: u32 = ::NLMSG_OVERRUN as u32;
pub const RTMSG_NEWDEVICE: u32 = 0x11;
pub const RTMSG_DELDEVICE: u32 = 0x12;
diff --git a/src/unix/notbsd/linux/other/mod.rs b/src/unix/notbsd/linux/other/mod.rs
index 1a97d1c8d6df2..1e77ab444a10a 100644
--- a/src/unix/notbsd/linux/other/mod.rs
+++ b/src/unix/notbsd/linux/other/mod.rs
@@ -601,6 +601,36 @@ pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4;
pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2;
pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543;
+// linux/rtnetlink.h
+pub const RTM_F_LOOKUP_TABLE: ::c_uint = 0x1000;
+pub const RTM_F_FIB_MATCH: ::c_uint = 0x2000;
+
+pub const RTA_VIA: ::c_ushort = 18;
+pub const RTA_NEWDST: ::c_ushort = 19;
+pub const RTA_PREF: ::c_ushort = 20;
+pub const RTA_ENCAP_TYPE: ::c_ushort = 21;
+pub const RTA_ENCAP: ::c_ushort = 22;
+pub const RTA_EXPIRES: ::c_ushort = 23;
+pub const RTA_PAD: ::c_ushort = 24;
+pub const RTA_UID: ::c_ushort = 25;
+pub const RTA_TTL_PROPAGATE: ::c_ushort = 26;
+
+// linux/neighbor.h
+pub const NTF_EXT_LEARNED: u8 = 0x10;
+pub const NTF_OFFLOADED: u8 = 0x20;
+
+pub const NDA_MASTER: ::c_ushort = 9;
+pub const NDA_LINK_NETNSID: ::c_ushort = 10;
+pub const NDA_SRC_VNI: ::c_ushort = 11;
+
+// linux/if_addr.h
+pub const IFA_FLAGS: ::c_ushort = 8;
+
+pub const IFA_F_MANAGETEMPADDR: u32 = 0x100;
+pub const IFA_F_NOPREFIXROUTE: u32 = 0x200;
+pub const IFA_F_MCAUTOJOIN: u32 = 0x400;
+pub const IFA_F_STABLE_PRIVACY: u32 = 0x800;
+
pub const NETLINK_ROUTE: ::c_int = 0;
pub const NETLINK_UNUSED: ::c_int = 1;
pub const NETLINK_USERSOCK: ::c_int = 2;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 6541fd5bd5801..d444a0a5bac88 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2358,6 +2358,7 @@ fn test_linux(target: &str) {
"linux/futex.h",
"linux/fs.h",
"linux/genetlink.h",
+ "linux/if_addr.h",
"linux/if_alg.h",
"linux/if_ether.h",
"linux/if_tun.h",
@@ -2368,6 +2369,7 @@ fn test_linux(target: &str) {
"linux/netfilter_ipv6.h",
"linux/netlink.h",
"linux/random.h",
+ "linux/rtnetlink.h",
"linux/seccomp.h",
"linux/sockios.h",
}
|
Route netlink C header #define's PR?
This is a follow up to #921 which tracks the PR that implemented genetlink constants. I maintain a [netlink library](https://github.com/jbaublitz/neli) but am now implementing the next subsystem in netlink (rtnetlink). I would like to add the constants in the rtnetlink subsystem now that I have a request to provide support for this. If I provide the PR, would you be willing to review and merge it?
|
Definitely! Always willing to have more constants and defines here :)
Great! I'll gather all of the rtnetlink constants into a PR when I get a moment.
|
2019-05-20T17:03:02Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 1,337
|
rust-lang__libc-1337
|
[
"1333"
] |
39ca01c8b3631db48c8e390f93f62e52b51a68b9
|
diff --git a/.travis.yml b/.travis.yml
index 7175ae4aad836..ad8df0763713e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -204,7 +204,7 @@ matrix:
stage: tier2
- env: TARGET=x86_64-unknown-linux-musl
stage: tier2
- - env: TARGET=wasm32-unknown-wasi
+ - env: TARGET=wasm32-wasi
rust: nightly
stage: tier2
diff --git a/ci/android-install-sdk.sh b/ci/android-install-sdk.sh
index 64cfbf1170770..e011cfc34bb4c 100644
--- a/ci/android-install-sdk.sh
+++ b/ci/android-install-sdk.sh
@@ -45,6 +45,9 @@ case "$1" in
;;
esac;
+# See: https://stackoverflow.com/a/51644855/1422197
+export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
+
# --no_https avoids
# javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
yes | ./sdk/tools/bin/sdkmanager --licenses --no_https
diff --git a/ci/build.sh b/ci/build.sh
index 8bfc77136ac6e..eb07c182ead6d 100644
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -115,6 +115,7 @@ aarch64-fuchsia \
armv5te-unknown-linux-gnueabi \
armv5te-unknown-linux-musleabi \
i686-pc-windows-gnu \
+wasm32-wasi \
x86_64-fortanix-unknown-sgx \
x86_64-fuchsia \
x86_64-pc-windows-gnu \
@@ -199,7 +200,6 @@ thumbv7neon-linux-androideabi \
thumbv7neon-unknown-linux-gnueabihf \
thumbv8m.main-none-eabi \
x86_64-pc-windows-msvc
-x86_64-unknown-bitrig \
x86_64-unknown-dragonfly \
x86_64-unknown-haiku \
x86_64-unknown-hermit \
diff --git a/ci/docker/aarch64-linux-android/Dockerfile b/ci/docker/aarch64-linux-android/Dockerfile
index 5fc83aadb333d..1458423756759 100644
--- a/ci/docker/aarch64-linux-android/Dockerfile
+++ b/ci/docker/aarch64-linux-android/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:16.04
+FROM ubuntu:19.04
RUN dpkg --add-architecture i386 && \
apt-get update && \
@@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \
python \
unzip \
expect \
- openjdk-9-jre \
+ openjdk-11-jre \
libstdc++6:i386 \
libpulse0 \
gcc \
diff --git a/ci/docker/aarch64-unknown-linux-gnu/Dockerfile b/ci/docker/aarch64-unknown-linux-gnu/Dockerfile
index 18214a3e646f9..716a445d346bf 100644
--- a/ci/docker/aarch64-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/aarch64-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:17.10
+FROM ubuntu:19.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev ca-certificates \
gcc-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user
diff --git a/ci/docker/aarch64-unknown-linux-musl/Dockerfile b/ci/docker/aarch64-unknown-linux-musl/Dockerfile
index 1fbf3f43f6315..143a960631ba2 100644
--- a/ci/docker/aarch64-unknown-linux-musl/Dockerfile
+++ b/ci/docker/aarch64-unknown-linux-musl/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:18.04
+FROM ubuntu:19.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc make libc6-dev git curl ca-certificates \
diff --git a/ci/docker/arm-linux-androideabi/Dockerfile b/ci/docker/arm-linux-androideabi/Dockerfile
index a3fc64bfd52f3..acc784e7d595f 100644
--- a/ci/docker/arm-linux-androideabi/Dockerfile
+++ b/ci/docker/arm-linux-androideabi/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:16.04
+FROM ubuntu:19.04
RUN dpkg --add-architecture i386 && \
apt-get update && \
@@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \
python \
unzip \
expect \
- openjdk-9-jre \
+ openjdk-11-jre \
libstdc++6:i386 \
libpulse0 \
gcc \
diff --git a/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile b/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile
index 9fe71dcf87cb0..bcdbb227f25ac 100644
--- a/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile
+++ b/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:17.10
+FROM ubuntu:19.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev ca-certificates \
gcc-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-user
diff --git a/ci/docker/arm-unknown-linux-musleabihf/Dockerfile b/ci/docker/arm-unknown-linux-musleabihf/Dockerfile
index 94e1651d63ec2..e29e854cc988b 100644
--- a/ci/docker/arm-unknown-linux-musleabihf/Dockerfile
+++ b/ci/docker/arm-unknown-linux-musleabihf/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:18.04
+FROM ubuntu:19.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc make libc6-dev git curl ca-certificates \
diff --git a/ci/docker/asmjs-unknown-emscripten/Dockerfile b/ci/docker/asmjs-unknown-emscripten/Dockerfile
index 3088fc53c442f..6c08340eb98b3 100644
--- a/ci/docker/asmjs-unknown-emscripten/Dockerfile
+++ b/ci/docker/asmjs-unknown-emscripten/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:16.04
+FROM ubuntu:19.04
RUN apt-get update && \
apt-get install -y --no-install-recommends \
diff --git a/ci/docker/i686-linux-android/Dockerfile b/ci/docker/i686-linux-android/Dockerfile
index f0836c38538e0..59ea2d79fc31b 100644
--- a/ci/docker/i686-linux-android/Dockerfile
+++ b/ci/docker/i686-linux-android/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:16.04
+FROM ubuntu:19.04
RUN dpkg --add-architecture i386 && \
apt-get update && \
@@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \
python \
unzip \
expect \
- openjdk-9-jre \
+ openjdk-11-jre \
libstdc++6:i386 \
libpulse0 \
gcc \
diff --git a/ci/docker/i686-unknown-linux-gnu/Dockerfile b/ci/docker/i686-unknown-linux-gnu/Dockerfile
index 03f3e8e690e32..5563a7b96b283 100644
--- a/ci/docker/i686-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/i686-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:18.04
+FROM ubuntu:19.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc-multilib libc6-dev ca-certificates
diff --git a/ci/docker/i686-unknown-linux-musl/Dockerfile b/ci/docker/i686-unknown-linux-musl/Dockerfile
index dac574fce7d96..c085c10b1427f 100644
--- a/ci/docker/i686-unknown-linux-musl/Dockerfile
+++ b/ci/docker/i686-unknown-linux-musl/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:18.04
+FROM ubuntu:19.04
RUN dpkg --add-architecture i386
RUN apt-get update
diff --git a/ci/docker/mips-unknown-linux-gnu/Dockerfile b/ci/docker/mips-unknown-linux-gnu/Dockerfile
index c66abd471b0f8..9f1bcaf7a34d6 100644
--- a/ci/docker/mips-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/mips-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:17.10
+FROM ubuntu:19.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
diff --git a/ci/docker/mips-unknown-linux-musl/Dockerfile b/ci/docker/mips-unknown-linux-musl/Dockerfile
index 1a87963a594bb..7f2764cf78217 100644
--- a/ci/docker/mips-unknown-linux-musl/Dockerfile
+++ b/ci/docker/mips-unknown-linux-musl/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:18.04
+FROM ubuntu:19.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates qemu-system-mips curl \
diff --git a/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile b/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile
index b9921fcc50d22..b97cdb4ce47e7 100644
--- a/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile
+++ b/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:17.10
+FROM ubuntu:19.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
diff --git a/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile b/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile
index 434c90819eb57..7f794525d9197 100644
--- a/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile
+++ b/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:17.10
+FROM ubuntu:19.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
diff --git a/ci/docker/mipsel-unknown-linux-musl/Dockerfile b/ci/docker/mipsel-unknown-linux-musl/Dockerfile
index 8fabf89ceba0c..03e83578ea90c 100644
--- a/ci/docker/mipsel-unknown-linux-musl/Dockerfile
+++ b/ci/docker/mipsel-unknown-linux-musl/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:18.04
+FROM ubuntu:19.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates qemu-system-mips curl \
diff --git a/ci/docker/powerpc-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc-unknown-linux-gnu/Dockerfile
index 5630685b56b87..9fa05af12ed99 100644
--- a/ci/docker/powerpc-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/powerpc-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:18.04
+FROM ubuntu:19.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
diff --git a/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile
index e4798538ae1ed..ab40789755749 100644
--- a/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:18.04
+FROM ubuntu:19.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
diff --git a/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile
index 2afd41e825e4b..4dcd632edde38 100644
--- a/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:18.04
+FROM ubuntu:19.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
diff --git a/ci/docker/s390x-unknown-linux-gnu/Dockerfile b/ci/docker/s390x-unknown-linux-gnu/Dockerfile
index 861f4f9b00ee0..75c11c11dca8d 100644
--- a/ci/docker/s390x-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/s390x-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:17.10
+FROM ubuntu:19.04
RUN apt-get update && apt-get install -y --no-install-recommends \
curl ca-certificates \
diff --git a/ci/docker/sparc64-unknown-linux-gnu/Dockerfile b/ci/docker/sparc64-unknown-linux-gnu/Dockerfile
index d9edaab426356..d1f4503d52d5a 100644
--- a/ci/docker/sparc64-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/sparc64-unknown-linux-gnu/Dockerfile
@@ -1,14 +1,11 @@
-FROM debian:stretch
+FROM ubuntu:19.04
RUN apt-get update && apt-get install -y --no-install-recommends \
curl ca-certificates \
gcc libc6-dev \
gcc-sparc64-linux-gnu libc6-dev-sparc64-cross \
qemu-system-sparc64 openbios-sparc seabios ipxe-qemu \
- p7zip-full cpio linux-libc-dev-sparc64-cross linux-headers-4.9.0-3-common
-
-# Put linux/module.h into the right spot as it is not shipped by debian
-RUN cp /usr/src/linux-headers-4.9.0-3-common/include/uapi/linux/module.h /usr/sparc64-linux-gnu/include/linux/
+ p7zip-full cpio linux-libc-dev-sparc64-cross
COPY linux-sparc64.sh /
RUN bash /linux-sparc64.sh
diff --git a/ci/docker/wasm32-unknown-emscripten/Dockerfile b/ci/docker/wasm32-unknown-emscripten/Dockerfile
index 59bf7d9a23a45..de8e35353b8e0 100644
--- a/ci/docker/wasm32-unknown-emscripten/Dockerfile
+++ b/ci/docker/wasm32-unknown-emscripten/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:16.04
+FROM ubuntu:19.04
RUN apt-get update && \
apt-get install -y --no-install-recommends \
diff --git a/ci/docker/wasm32-unknown-wasi/clang.sh b/ci/docker/wasm32-unknown-wasi/clang.sh
deleted file mode 100755
index a943e3782334e..0000000000000
--- a/ci/docker/wasm32-unknown-wasi/clang.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/usr/bin/env sh
-exec /wasmcc/bin/clang --target=wasm32-unknown-wasi --sysroot /wasi-sysroot "$@"
diff --git a/ci/docker/wasm32-unknown-wasi/Dockerfile b/ci/docker/wasm32-wasi/Dockerfile
similarity index 87%
rename from ci/docker/wasm32-unknown-wasi/Dockerfile
rename to ci/docker/wasm32-wasi/Dockerfile
index deac87a69305e..d963a442c86bb 100644
--- a/ci/docker/wasm32-unknown-wasi/Dockerfile
+++ b/ci/docker/wasm32-wasi/Dockerfile
@@ -28,13 +28,13 @@ RUN mv /clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04 /wasmcc
# those breaking changes on `libc`'s own CI
RUN git clone https://github.com/CraneStation/wasi-sysroot && \
cd wasi-sysroot && \
- git reset --hard 2201343c17b7149a75f543f523bea0c3243c6091
+ git reset --hard eee6ee7566e26f2535eb6088c8494a112ff423b9
RUN make -C wasi-sysroot install -j $(nproc) WASM_CC=/wasmcc/bin/clang INSTALL_DIR=/wasi-sysroot
# This is a small wrapper script which executes the actual clang binary in
# `/wasmcc` and then is sure to pass the right `--sysroot` argument which we
# just built above.
-COPY docker/wasm32-unknown-wasi/clang.sh /wasi-sysroot/bin/clang
+COPY docker/wasm32-wasi/clang.sh /wasi-sysroot/bin/clang
# In the second container we're going to build the `wasmtime` binary which is
# used to execute wasi executables. This is a standard Rust project so we're
@@ -58,9 +58,9 @@ RUN curl -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH=/root/.cargo/bin:$PATH
RUN apt-get install -y --no-install-recommends python
-RUN git clone https://github.com/CraneStation/wasmtime wasmtime && \
+RUN git clone --recursive https://github.com/CraneStation/wasmtime wasmtime && \
cd wasmtime && \
- git reset --hard a1c123c3dd8f9766990efe0f1734a646f61ba8a0
+ git reset --hard 67edb00f29b62864b00179fe4bfa99bc29973285
RUN cargo build --release --manifest-path wasmtime/Cargo.toml
# And finally in the last image we're going to assemble everything together.
@@ -86,8 +86,8 @@ COPY --from=wasmtime /wasmtime/target/release/wasmtime /usr/bin/
# executable with the right sysroot, and then we're sure to turn off the
# crt-static feature to ensure that the CRT that we're specifying with `clang`
# is used.
-ENV CARGO_TARGET_WASM32_UNKNOWN_WASI_RUNNER=wasmtime \
- CARGO_TARGET_WASM32_UNKNOWN_WASI_LINKER=/wasi-sysroot/bin/clang \
- CC_wasm32_unknown_wasi=/wasi-sysroot/bin/clang \
+ENV CARGO_TARGET_WASM32_WASI_RUNNER=wasmtime \
+ CARGO_TARGET_WASM32_WASI_LINKER=/wasi-sysroot/bin/clang \
+ CC_wasm32_wasi=/wasi-sysroot/bin/clang \
PATH=$PATH:/rust/bin \
RUSTFLAGS=-Ctarget-feature=-crt-static
diff --git a/ci/docker/wasm32-wasi/clang.sh b/ci/docker/wasm32-wasi/clang.sh
new file mode 100755
index 0000000000000..6f298128ab8c3
--- /dev/null
+++ b/ci/docker/wasm32-wasi/clang.sh
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+exec /wasmcc/bin/clang --target=wasm32-wasi --sysroot /wasi-sysroot "$@"
diff --git a/ci/docker/x86_64-linux-android/Dockerfile b/ci/docker/x86_64-linux-android/Dockerfile
index 0cfbc4820903a..b0984c04585d8 100644
--- a/ci/docker/x86_64-linux-android/Dockerfile
+++ b/ci/docker/x86_64-linux-android/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:16.04
+FROM ubuntu:19.04
RUN apt-get update && \
apt-get install -y --no-install-recommends \
diff --git a/ci/docker/x86_64-unknown-linux-gnu/Dockerfile b/ci/docker/x86_64-unknown-linux-gnu/Dockerfile
index 6ab9c9231955a..0dbb191fbd940 100644
--- a/ci/docker/x86_64-unknown-linux-gnu/Dockerfile
+++ b/ci/docker/x86_64-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:18.04
+FROM ubuntu:19.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc libc6-dev ca-certificates
diff --git a/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile b/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile
index 03f3e8e690e32..5563a7b96b283 100644
--- a/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile
+++ b/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:18.04
+FROM ubuntu:19.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc-multilib libc6-dev ca-certificates
diff --git a/ci/docker/x86_64-unknown-linux-musl/Dockerfile b/ci/docker/x86_64-unknown-linux-musl/Dockerfile
index d8036dc98ce45..59164d22ed641 100644
--- a/ci/docker/x86_64-unknown-linux-musl/Dockerfile
+++ b/ci/docker/x86_64-unknown-linux-musl/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:18.04
+FROM ubuntu:19.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
diff --git a/ci/linux-s390x.sh b/ci/linux-s390x.sh
index a230cfe12fb6f..00a7f88180b72 100644
--- a/ci/linux-s390x.sh
+++ b/ci/linux-s390x.sh
@@ -6,8 +6,8 @@ mkdir -m 777 /qemu
cd /qemu
curl --retry 5 -LO https://github.com/qemu/qemu/raw/master/pc-bios/s390-ccw.img
-curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20170828/images/generic/kernel.debian
-curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20170828/images/generic/initrd.debian
+curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20190410/images/generic/kernel.debian
+curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20190410/images/generic/initrd.debian
mv kernel.debian kernel
mv initrd.debian initrd.gz
diff --git a/ci/linux-sparc64.sh b/ci/linux-sparc64.sh
index 7fb28d9e14861..5580a0e3c30ea 100644
--- a/ci/linux-sparc64.sh
+++ b/ci/linux-sparc64.sh
@@ -5,11 +5,11 @@ set -ex
mkdir -m 777 /qemu
cd /qemu
-curl --retry 5 -LO https://cdimage.debian.org/cdimage/ports/9.0/sparc64/iso-cd/debian-9.0-sparc64-NETINST-1.iso
-7z e debian-9.0-sparc64-NETINST-1.iso boot/initrd.gz
-7z e debian-9.0-sparc64-NETINST-1.iso boot/sparc64
+curl --retry 5 -LO https://cdimage.debian.org/cdimage/ports/10.0/sparc64/iso-cd/debian-10.0-sparc64-NETINST-1.iso
+7z e debian-10.0-sparc64-NETINST-1.iso boot/initrd.gz
+7z e debian-10.0-sparc64-NETINST-1.iso boot/sparc64
mv sparc64 kernel
-rm debian-9.0-sparc64-NETINST-1.iso
+rm debian-10.0-sparc64-NETINST-1.iso
mkdir init
cd init
diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs
index 162be9d7f904c..03c987dd33741 100644
--- a/src/unix/bsd/mod.rs
+++ b/src/unix/bsd/mod.rs
@@ -663,8 +663,7 @@ cfg_if! {
if #[cfg(any(target_os = "macos", target_os = "ios"))] {
mod apple;
pub use self::apple::*;
- } else if #[cfg(any(target_os = "openbsd", target_os = "netbsd",
- target_os = "bitrig"))] {
+ } else if #[cfg(any(target_os = "openbsd", target_os = "netbsd"))] {
mod netbsdlike;
pub use self::netbsdlike::*;
} else if #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] {
diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs
index c75e6de0a3e16..29b4dd7649891 100644
--- a/src/unix/bsd/netbsdlike/mod.rs
+++ b/src/unix/bsd/netbsdlike/mod.rs
@@ -676,7 +676,7 @@ cfg_if! {
if #[cfg(target_os = "netbsd")] {
mod netbsd;
pub use self::netbsd::*;
- } else if #[cfg(any(target_os = "openbsd", target_os = "bitrig"))] {
+ } else if #[cfg(target_os = "openbsd")] {
mod openbsdlike;
pub use self::openbsdlike::*;
} else {
diff --git a/src/unix/bsd/netbsdlike/openbsdlike/bitrig/mod.rs b/src/unix/bsd/netbsdlike/openbsdlike/bitrig/mod.rs
deleted file mode 100644
index f73d7de7b2f04..0000000000000
--- a/src/unix/bsd/netbsdlike/openbsdlike/bitrig/mod.rs
+++ /dev/null
@@ -1,129 +0,0 @@
-pub type c_char = i8;
-
-s! {
- pub struct glob_t {
- pub gl_pathc: ::c_int,
- pub gl_matchc: ::c_int,
- pub gl_offs: ::c_int,
- pub gl_flags: ::c_int,
- pub gl_pathv: *mut *mut ::c_char,
- __unused1: *mut ::c_void,
- __unused2: *mut ::c_void,
- __unused3: *mut ::c_void,
- __unused4: *mut ::c_void,
- __unused5: *mut ::c_void,
- __unused6: *mut ::c_void,
- __unused7: *mut ::c_void,
- }
-
- pub struct lconv {
- pub decimal_point: *mut ::c_char,
- pub thousands_sep: *mut ::c_char,
- pub grouping: *mut ::c_char,
- pub int_curr_symbol: *mut ::c_char,
- pub currency_symbol: *mut ::c_char,
- pub mon_decimal_point: *mut ::c_char,
- pub mon_thousands_sep: *mut ::c_char,
- pub mon_grouping: *mut ::c_char,
- pub positive_sign: *mut ::c_char,
- pub negative_sign: *mut ::c_char,
- pub int_frac_digits: ::c_char,
- pub frac_digits: ::c_char,
- pub p_cs_precedes: ::c_char,
- pub p_sep_by_space: ::c_char,
- pub n_cs_precedes: ::c_char,
- pub n_sep_by_space: ::c_char,
- pub p_sign_posn: ::c_char,
- pub n_sign_posn: ::c_char,
- pub int_p_cs_precedes: ::c_char,
- pub int_n_cs_precedes: ::c_char,
- pub int_p_sep_by_space: ::c_char,
- pub int_n_sep_by_space: ::c_char,
- pub int_p_sign_posn: ::c_char,
- pub int_n_sign_posn: ::c_char,
- }
-}
-
-pub const LC_COLLATE_MASK: ::c_int = (1 << 0);
-pub const LC_CTYPE_MASK: ::c_int = (1 << 1);
-pub const LC_MESSAGES_MASK: ::c_int = (1 << 2);
-pub const LC_MONETARY_MASK: ::c_int = (1 << 3);
-pub const LC_NUMERIC_MASK: ::c_int = (1 << 4);
-pub const LC_TIME_MASK: ::c_int = (1 << 5);
-pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
- | LC_CTYPE_MASK
- | LC_MESSAGES_MASK
- | LC_MONETARY_MASK
- | LC_NUMERIC_MASK
- | LC_TIME_MASK;
-
-pub const ERA: ::nl_item = 52;
-pub const ERA_D_FMT: ::nl_item = 53;
-pub const ERA_D_T_FMT: ::nl_item = 54;
-pub const ERA_T_FMT: ::nl_item = 55;
-pub const ALT_DIGITS: ::nl_item = 56;
-
-pub const D_MD_ORDER: ::nl_item = 57;
-
-pub const ALTMON_1: ::nl_item = 58;
-pub const ALTMON_2: ::nl_item = 59;
-pub const ALTMON_3: ::nl_item = 60;
-pub const ALTMON_4: ::nl_item = 61;
-pub const ALTMON_5: ::nl_item = 62;
-pub const ALTMON_6: ::nl_item = 63;
-pub const ALTMON_7: ::nl_item = 64;
-pub const ALTMON_8: ::nl_item = 65;
-pub const ALTMON_9: ::nl_item = 66;
-pub const ALTMON_10: ::nl_item = 67;
-pub const ALTMON_11: ::nl_item = 68;
-pub const ALTMON_12: ::nl_item = 69;
-
-pub const KERN_RND: ::c_int = 31;
-
-// https://github.com/bitrig/bitrig/blob/master/sys/net/if.h#L187
-pub const IFF_UP: ::c_int = 0x1; // interface is up
-pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
-pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
-pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
-pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
-pub const IFF_NOTRAILERS: ::c_int = 0x20; // avoid use of trailers
-pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
-pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
-pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
-pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
-pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress
-pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
-pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
-pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
-pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
-pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
-
-pub const PTHREAD_STACK_MIN : ::size_t = 2048;
-pub const SIGSTKSZ : ::size_t = 40960;
-
-pub const PT_FIRSTMACH: ::c_int = 32;
-
-extern {
- pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
- pub fn duplocale(base: ::locale_t) -> ::locale_t;
- pub fn freelocale(loc: ::locale_t) -> ::c_int;
- pub fn newlocale(mask: ::c_int,
- locale: *const ::c_char,
- base: ::locale_t) -> ::locale_t;
- pub fn uselocale(loc: ::locale_t) -> ::locale_t;
- pub fn pledge(promises: *const ::c_char,
- paths: *mut *const ::c_char) -> ::c_int;
- pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
-}
-
-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 {
- // Unknown target_arch
- }
-}
diff --git a/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs b/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs
deleted file mode 100644
index 9b0b338b91e5b..0000000000000
--- a/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86.rs
+++ /dev/null
@@ -1,2 +0,0 @@
-pub type c_long = i32;
-pub type c_ulong = u32;
diff --git a/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs b/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs
deleted file mode 100644
index d3971aa35b87b..0000000000000
--- a/src/unix/bsd/netbsdlike/openbsdlike/bitrig/x86_64.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-use PT_FIRSTMACH;
-
-pub type c_long = i64;
-pub type c_ulong = u64;
-
-pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0;
-pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
-pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
-pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
-pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;
diff --git a/src/unix/bsd/netbsdlike/openbsdlike/mod.rs b/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
index cf9dc8f5517b1..223064b76eea4 100644
--- a/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
@@ -939,9 +939,6 @@ cfg_if! {
if #[cfg(target_os = "openbsd")] {
mod openbsd;
pub use self::openbsd::*;
- } else if #[cfg(target_os = "bitrig")] {
- mod bitrig;
- pub use self::bitrig::*;
} else {
// Unknown target_os
}
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index 1be0095343635..375acabbc35fa 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -327,8 +327,7 @@ cfg_if! {
} else if #[cfg(any(target_os = "macos",
target_os = "ios",
target_os = "android",
- target_os = "openbsd",
- target_os = "bitrig"))] {
+ target_os = "openbsd"))] {
#[link(name = "c")]
#[link(name = "m")]
extern {}
@@ -512,8 +511,11 @@ extern {
pub fn snprintf(s: *mut ::c_char, n: ::size_t,
format: *const ::c_char, ...) -> ::c_int;
pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int;
+ #[cfg_attr(target_os = "linux", link_name = "__isoc99_fscanf")]
pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
+ #[cfg_attr(target_os = "linux", link_name = "__isoc99_scanf")]
pub fn scanf(format: *const ::c_char, ...) -> ::c_int;
+ #[cfg_attr(target_os = "linux", link_name = "__isoc99_sscanf")]
pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int;
pub fn getchar_unlocked() -> ::c_int;
pub fn putchar_unlocked(c: ::c_int) -> ::c_int;
@@ -837,6 +839,14 @@ extern {
pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__gettimeofday50")]
+ #[deprecated(
+ since="0.2.54",
+ note=
+ "The signature of this function is incorrect. \
+ If you are using it, please report that in the following issue \
+ so that we can evaluate the impact of fixing it: \
+ https://github.com/rust-lang/libc/issues/1338"
+ )]
pub fn gettimeofday(tp: *mut ::timeval,
tz: *mut ::c_void) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__times13")]
@@ -1147,8 +1157,7 @@ cfg_if! {
target_os = "freebsd",
target_os = "dragonfly",
target_os = "openbsd",
- target_os = "netbsd",
- target_os = "bitrig"))] {
+ target_os = "netbsd"))] {
mod bsd;
pub use self::bsd::*;
} else if #[cfg(any(target_os = "solaris",
diff --git a/src/unix/notbsd/linux/align.rs b/src/unix/notbsd/linux/align.rs
index a35e26913af7f..0ff4649b8cfcb 100644
--- a/src/unix/notbsd/linux/align.rs
+++ b/src/unix/notbsd/linux/align.rs
@@ -7,8 +7,7 @@ macro_rules! expand_align {
target_arch = "mips64",
target_arch = "s390x",
target_arch = "sparc64",
- all(target_arch = "aarch64",
- target_env = "musl")),
+ target_arch = "aarch64"),
repr(align(4)))]
#[cfg_attr(not(any(target_pointer_width = "32",
target_arch = "x86_64",
@@ -16,8 +15,7 @@ macro_rules! expand_align {
target_arch = "mips64",
target_arch = "s390x",
target_arch = "sparc64",
- all(target_arch = "aarch64",
- target_env = "musl"))),
+ target_arch = "aarch64")),
repr(align(8)))]
pub struct pthread_mutexattr_t {
#[doc(hidden)]
diff --git a/src/unix/notbsd/linux/mips/mips32.rs b/src/unix/notbsd/linux/mips/mips32.rs
index 991161395444a..d9d55891309d7 100644
--- a/src/unix/notbsd/linux/mips/mips32.rs
+++ b/src/unix/notbsd/linux/mips/mips32.rs
@@ -353,7 +353,6 @@ pub const SYS_mknod: ::c_long = 4000 + 14;
pub const SYS_chmod: ::c_long = 4000 + 15;
pub const SYS_lchown: ::c_long = 4000 + 16;
pub const SYS_break: ::c_long = 4000 + 17;
-pub const SYS_unused18: ::c_long = 4000 + 18;
pub const SYS_lseek: ::c_long = 4000 + 19;
pub const SYS_getpid: ::c_long = 4000 + 20;
pub const SYS_mount: ::c_long = 4000 + 21;
@@ -363,7 +362,6 @@ pub const SYS_getuid: ::c_long = 4000 + 24;
pub const SYS_stime: ::c_long = 4000 + 25;
pub const SYS_ptrace: ::c_long = 4000 + 26;
pub const SYS_alarm: ::c_long = 4000 + 27;
-pub const SYS_unused28: ::c_long = 4000 + 28;
pub const SYS_pause: ::c_long = 4000 + 29;
pub const SYS_utime: ::c_long = 4000 + 30;
pub const SYS_stty: ::c_long = 4000 + 31;
@@ -394,7 +392,6 @@ pub const SYS_fcntl: ::c_long = 4000 + 55;
pub const SYS_mpx: ::c_long = 4000 + 56;
pub const SYS_setpgid: ::c_long = 4000 + 57;
pub const SYS_ulimit: ::c_long = 4000 + 58;
-pub const SYS_unused59: ::c_long = 4000 + 59;
pub const SYS_umask: ::c_long = 4000 + 60;
pub const SYS_chroot: ::c_long = 4000 + 61;
pub const SYS_ustat: ::c_long = 4000 + 62;
@@ -417,9 +414,7 @@ pub const SYS_gettimeofday: ::c_long = 4000 + 78;
pub const SYS_settimeofday: ::c_long = 4000 + 79;
pub const SYS_getgroups: ::c_long = 4000 + 80;
pub const SYS_setgroups: ::c_long = 4000 + 81;
-pub const SYS_reserved82: ::c_long = 4000 + 82;
pub const SYS_symlink: ::c_long = 4000 + 83;
-pub const SYS_unused84: ::c_long = 4000 + 84;
pub const SYS_readlink: ::c_long = 4000 + 85;
pub const SYS_uselib: ::c_long = 4000 + 86;
pub const SYS_swapon: ::c_long = 4000 + 87;
@@ -444,7 +439,6 @@ pub const SYS_getitimer: ::c_long = 4000 + 105;
pub const SYS_stat: ::c_long = 4000 + 106;
pub const SYS_lstat: ::c_long = 4000 + 107;
pub const SYS_fstat: ::c_long = 4000 + 108;
-pub const SYS_unused109: ::c_long = 4000 + 109;
pub const SYS_iopl: ::c_long = 4000 + 110;
pub const SYS_vhangup: ::c_long = 4000 + 111;
pub const SYS_idle: ::c_long = 4000 + 112;
@@ -485,7 +479,6 @@ pub const SYS_writev: ::c_long = 4000 + 146;
pub const SYS_cacheflush: ::c_long = 4000 + 147;
pub const SYS_cachectl: ::c_long = 4000 + 148;
pub const SYS_sysmips: ::c_long = 4000 + 149;
-pub const SYS_unused150: ::c_long = 4000 + 150;
pub const SYS_getsid: ::c_long = 4000 + 151;
pub const SYS_fdatasync: ::c_long = 4000 + 152;
pub const SYS__sysctl: ::c_long = 4000 + 153;
@@ -556,7 +549,6 @@ pub const SYS_mincore: ::c_long = 4000 + 217;
pub const SYS_madvise: ::c_long = 4000 + 218;
pub const SYS_getdents64: ::c_long = 4000 + 219;
pub const SYS_fcntl64: ::c_long = 4000 + 220;
-pub const SYS_reserved221: ::c_long = 4000 + 221;
pub const SYS_gettid: ::c_long = 4000 + 222;
pub const SYS_readahead: ::c_long = 4000 + 223;
pub const SYS_setxattr: ::c_long = 4000 + 224;
diff --git a/src/unix/notbsd/linux/mips/mips64.rs b/src/unix/notbsd/linux/mips/mips64.rs
index c4247c976c9bd..f480e50a848ef 100644
--- a/src/unix/notbsd/linux/mips/mips64.rs
+++ b/src/unix/notbsd/linux/mips/mips64.rs
@@ -496,7 +496,6 @@ pub const SYS_nfsservctl: ::c_long = 5000 + 173;
pub const SYS_getpmsg: ::c_long = 5000 + 174;
pub const SYS_putpmsg: ::c_long = 5000 + 175;
pub const SYS_afs_syscall: ::c_long = 5000 + 176;
-pub const SYS_reserved177: ::c_long = 5000 + 177;
pub const SYS_gettid: ::c_long = 5000 + 178;
pub const SYS_readahead: ::c_long = 5000 + 179;
pub const SYS_setxattr: ::c_long = 5000 + 180;
@@ -512,7 +511,6 @@ pub const SYS_removexattr: ::c_long = 5000 + 189;
pub const SYS_lremovexattr: ::c_long = 5000 + 190;
pub const SYS_fremovexattr: ::c_long = 5000 + 191;
pub const SYS_tkill: ::c_long = 5000 + 192;
-pub const SYS_reserved193: ::c_long = 5000 + 193;
pub const SYS_futex: ::c_long = 5000 + 194;
pub const SYS_sched_setaffinity: ::c_long = 5000 + 195;
pub const SYS_sched_getaffinity: ::c_long = 5000 + 196;
diff --git a/src/unix/notbsd/linux/mips/mod.rs b/src/unix/notbsd/linux/mips/mod.rs
index b7001866eba3a..35534b44d2ffd 100644
--- a/src/unix/notbsd/linux/mips/mod.rs
+++ b/src/unix/notbsd/linux/mips/mod.rs
@@ -706,10 +706,10 @@ pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10;
pub const GENL_ID_VFS_DQUOT: ::c_int = ::NLMSG_MIN_TYPE + 1;
pub const GENL_ID_PMCRAID: ::c_int = ::NLMSG_MIN_TYPE + 2;
-pub const NFT_TABLE_MAXNAMELEN: ::c_int = 32;
-pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 32;
-pub const NFT_SET_MAXNAMELEN: ::c_int = 32;
-pub const NFT_OBJ_MAXNAMELEN: ::c_int = 32;
+pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256;
+pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256;
+pub const NFT_SET_MAXNAMELEN: ::c_int = 256;
+pub const NFT_OBJ_MAXNAMELEN: ::c_int = 256;
pub const NFT_USERDATA_MAXLEN: ::c_int = 256;
pub const NFT_REG_VERDICT: ::c_int = 0;
@@ -766,7 +766,7 @@ pub const NFT_MSG_NEWOBJ: ::c_int = 18;
pub const NFT_MSG_GETOBJ: ::c_int = 19;
pub const NFT_MSG_DELOBJ: ::c_int = 20;
pub const NFT_MSG_GETOBJ_RESET: ::c_int = 21;
-pub const NFT_MSG_MAX: ::c_int = 22;
+pub const NFT_MSG_MAX: ::c_int = 25;
pub const NFT_SET_ANONYMOUS: ::c_int = 0x1;
pub const NFT_SET_CONSTANT: ::c_int = 0x2;
diff --git a/src/unix/notbsd/linux/musl/b32/mips.rs b/src/unix/notbsd/linux/musl/b32/mips.rs
index b0694d1ea8230..37430af5f90d7 100644
--- a/src/unix/notbsd/linux/musl/b32/mips.rs
+++ b/src/unix/notbsd/linux/musl/b32/mips.rs
@@ -514,7 +514,6 @@ pub const SYS_mknod: ::c_long = 4000 + 14;
pub const SYS_chmod: ::c_long = 4000 + 15;
pub const SYS_lchown: ::c_long = 4000 + 16;
pub const SYS_break: ::c_long = 4000 + 17;
-pub const SYS_unused18: ::c_long = 4000 + 18;
pub const SYS_lseek: ::c_long = 4000 + 19;
pub const SYS_getpid: ::c_long = 4000 + 20;
pub const SYS_mount: ::c_long = 4000 + 21;
@@ -524,7 +523,6 @@ pub const SYS_getuid: ::c_long = 4000 + 24;
pub const SYS_stime: ::c_long = 4000 + 25;
pub const SYS_ptrace: ::c_long = 4000 + 26;
pub const SYS_alarm: ::c_long = 4000 + 27;
-pub const SYS_unused28: ::c_long = 4000 + 28;
pub const SYS_pause: ::c_long = 4000 + 29;
pub const SYS_utime: ::c_long = 4000 + 30;
pub const SYS_stty: ::c_long = 4000 + 31;
@@ -555,7 +553,6 @@ pub const SYS_fcntl: ::c_long = 4000 + 55;
pub const SYS_mpx: ::c_long = 4000 + 56;
pub const SYS_setpgid: ::c_long = 4000 + 57;
pub const SYS_ulimit: ::c_long = 4000 + 58;
-pub const SYS_unused59: ::c_long = 4000 + 59;
pub const SYS_umask: ::c_long = 4000 + 60;
pub const SYS_chroot: ::c_long = 4000 + 61;
pub const SYS_ustat: ::c_long = 4000 + 62;
@@ -578,9 +575,7 @@ pub const SYS_gettimeofday: ::c_long = 4000 + 78;
pub const SYS_settimeofday: ::c_long = 4000 + 79;
pub const SYS_getgroups: ::c_long = 4000 + 80;
pub const SYS_setgroups: ::c_long = 4000 + 81;
-pub const SYS_reserved82: ::c_long = 4000 + 82;
pub const SYS_symlink: ::c_long = 4000 + 83;
-pub const SYS_unused84: ::c_long = 4000 + 84;
pub const SYS_readlink: ::c_long = 4000 + 85;
pub const SYS_uselib: ::c_long = 4000 + 86;
pub const SYS_swapon: ::c_long = 4000 + 87;
@@ -605,7 +600,6 @@ pub const SYS_getitimer: ::c_long = 4000 + 105;
pub const SYS_stat: ::c_long = 4000 + 106;
pub const SYS_lstat: ::c_long = 4000 + 107;
pub const SYS_fstat: ::c_long = 4000 + 108;
-pub const SYS_unused109: ::c_long = 4000 + 109;
pub const SYS_iopl: ::c_long = 4000 + 110;
pub const SYS_vhangup: ::c_long = 4000 + 111;
pub const SYS_idle: ::c_long = 4000 + 112;
@@ -645,7 +639,6 @@ pub const SYS_writev: ::c_long = 4000 + 146;
pub const SYS_cacheflush: ::c_long = 4000 + 147;
pub const SYS_cachectl: ::c_long = 4000 + 148;
pub const SYS_sysmips: ::c_long = 4000 + 149;
-pub const SYS_unused150: ::c_long = 4000 + 150;
pub const SYS_getsid: ::c_long = 4000 + 151;
pub const SYS_fdatasync: ::c_long = 4000 + 152;
pub const SYS__sysctl: ::c_long = 4000 + 153;
@@ -714,7 +707,6 @@ pub const SYS_mincore: ::c_long = 4000 + 217;
pub const SYS_madvise: ::c_long = 4000 + 218;
pub const SYS_getdents64: ::c_long = 4000 + 219;
pub const SYS_fcntl64: ::c_long = 4000 + 220;
-pub const SYS_reserved221: ::c_long = 4000 + 221;
pub const SYS_gettid: ::c_long = 4000 + 222;
pub const SYS_readahead: ::c_long = 4000 + 223;
pub const SYS_setxattr: ::c_long = 4000 + 224;
diff --git a/src/unix/notbsd/linux/other/b32/arm.rs b/src/unix/notbsd/linux/other/b32/arm.rs
index a70af4331f315..7f00d9a1139a7 100644
--- a/src/unix/notbsd/linux/other/b32/arm.rs
+++ b/src/unix/notbsd/linux/other/b32/arm.rs
@@ -136,9 +136,6 @@ pub const SO_RCVBUFFORCE: ::c_int = 33;
pub const FIOCLEX: ::c_ulong = 0x5451;
pub const FIONBIO: ::c_ulong = 0x5421;
-pub const PTRACE_GETFPXREGS: ::c_uint = 18;
-pub const PTRACE_SETFPXREGS: ::c_uint = 19;
-
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
diff --git a/src/unix/notbsd/linux/other/b32/x86.rs b/src/unix/notbsd/linux/other/b32/x86.rs
index 563ac98ac3335..e7c3b9a83adc9 100644
--- a/src/unix/notbsd/linux/other/b32/x86.rs
+++ b/src/unix/notbsd/linux/other/b32/x86.rs
@@ -212,6 +212,7 @@ s_no_extra_traits!{
pub uc_mcontext: mcontext_t,
pub uc_sigmask: ::sigset_t,
__private: [u8; 112],
+ __ssp: [::c_ulong; 4],
}
}
diff --git a/src/unix/notbsd/linux/other/b64/aarch64.rs b/src/unix/notbsd/linux/other/b64/aarch64.rs
index d6e37ff57bee5..3bd2e02eebe99 100644
--- a/src/unix/notbsd/linux/other/b64/aarch64.rs
+++ b/src/unix/notbsd/linux/other/b64/aarch64.rs
@@ -786,7 +786,6 @@ pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
pub const SYS_perf_event_open: ::c_long = 241;
pub const SYS_accept4: ::c_long = 242;
pub const SYS_recvmmsg: ::c_long = 243;
-pub const SYS_arch_specific_syscall: ::c_long = 244;
pub const SYS_wait4: ::c_long = 260;
pub const SYS_prlimit64: ::c_long = 261;
pub const SYS_fanotify_init: ::c_long = 262;
@@ -818,7 +817,6 @@ pub const SYS_pwritev2: ::c_long = 287;
pub const SYS_pkey_mprotect: ::c_long = 288;
pub const SYS_pkey_alloc: ::c_long = 289;
pub const SYS_pkey_free: ::c_long = 290;
-pub const SYS_syscalls: ::c_long = 291;
#[link(name = "util")]
extern {
diff --git a/src/unix/notbsd/linux/other/b64/sparc64.rs b/src/unix/notbsd/linux/other/b64/sparc64.rs
index 325c7937fc8a4..5d268658cc155 100644
--- a/src/unix/notbsd/linux/other/b64/sparc64.rs
+++ b/src/unix/notbsd/linux/other/b64/sparc64.rs
@@ -495,7 +495,7 @@ pub const VEOL2: usize = 6;
pub const VMIN: usize = 4;
pub const IEXTEN: ::tcflag_t = 0x8000;
pub const TOSTOP: ::tcflag_t = 0x100;
-pub const FLUSHO: ::tcflag_t = 0x2000;
+pub const FLUSHO: ::tcflag_t = 0x1000;
pub const EXTPROC: ::tcflag_t = 0x10000;
pub const TCGETS: ::c_ulong = 0x40245408;
pub const TCSETS: ::c_ulong = 0x80245409;
diff --git a/src/unix/notbsd/linux/other/b64/x86_64.rs b/src/unix/notbsd/linux/other/b64/x86_64.rs
index d4f4ffc4da399..79f27e083f2d6 100644
--- a/src/unix/notbsd/linux/other/b64/x86_64.rs
+++ b/src/unix/notbsd/linux/other/b64/x86_64.rs
@@ -231,6 +231,7 @@ s_no_extra_traits! {
pub uc_mcontext: mcontext_t,
pub uc_sigmask: ::sigset_t,
__private: [u8; 512],
+ __ssp: [::c_ulonglong; 4],
}
}
diff --git a/src/unix/notbsd/linux/other/mod.rs b/src/unix/notbsd/linux/other/mod.rs
index 8a643768de0c8..1a97d1c8d6df2 100644
--- a/src/unix/notbsd/linux/other/mod.rs
+++ b/src/unix/notbsd/linux/other/mod.rs
@@ -225,23 +225,19 @@ s_no_extra_traits! {
pub ut_exit: __exit_status,
#[cfg(any(target_arch = "aarch64",
- target_arch = "sparc64",
all(target_pointer_width = "32",
not(target_arch = "x86_64"))))]
pub ut_session: ::c_long,
#[cfg(any(target_arch = "aarch64",
- target_arch = "sparc64",
all(target_pointer_width = "32",
not(target_arch = "x86_64"))))]
pub ut_tv: ::timeval,
#[cfg(not(any(target_arch = "aarch64",
- target_arch = "sparc64",
all(target_pointer_width = "32",
not(target_arch = "x86_64")))))]
pub ut_session: ::int32_t,
#[cfg(not(any(target_arch = "aarch64",
- target_arch = "sparc64",
all(target_pointer_width = "32",
not(target_arch = "x86_64")))))]
pub ut_tv: __timeval,
@@ -688,23 +684,10 @@ pub const NFPROTO_INET: ::c_int = 1;
pub const NFPROTO_NETDEV: ::c_int = 5;
// linux/netfilter/nf_tables.h
-cfg_if!{
- if #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] {
- pub const NFT_TABLE_MAXNAMELEN: ::c_int = 32;
- pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 32;
- pub const NFT_SET_MAXNAMELEN: ::c_int = 32;
- pub const NFT_OBJ_MAXNAMELEN: ::c_int = 32;
- } else if #[cfg(target_arch = "sparc64")] {
- pub const NFT_TABLE_MAXNAMELEN: ::c_int = 32;
- pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 32;
- pub const NFT_SET_MAXNAMELEN: ::c_int = 32;
- } else {
- pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256;
- pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256;
- pub const NFT_SET_MAXNAMELEN: ::c_int = 256;
- pub const NFT_OBJ_MAXNAMELEN: ::c_int = 256;
- }
-}
+pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256;
+pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256;
+pub const NFT_SET_MAXNAMELEN: ::c_int = 256;
+pub const NFT_OBJ_MAXNAMELEN: ::c_int = 256;
pub const NFT_USERDATA_MAXLEN: ::c_int = 256;
pub const NFT_REG_VERDICT: ::c_int = 0;
@@ -763,11 +746,9 @@ cfg_if! {
pub const NFT_MSG_GETOBJ: ::c_int = 19;
pub const NFT_MSG_DELOBJ: ::c_int = 20;
pub const NFT_MSG_GETOBJ_RESET: ::c_int = 21;
- pub const NFT_MSG_MAX: ::c_int = 22;
- } else {
- pub const NFT_MSG_MAX: ::c_int = 18;
}
}
+pub const NFT_MSG_MAX: ::c_int = 25;
pub const NFT_SET_ANONYMOUS: ::c_int = 0x1;
pub const NFT_SET_CONSTANT: ::c_int = 0x2;
diff --git a/src/unix/notbsd/linux/s390x/mod.rs b/src/unix/notbsd/linux/s390x/mod.rs
index ebe9d41710e62..d4cf95678ed0a 100644
--- a/src/unix/notbsd/linux/s390x/mod.rs
+++ b/src/unix/notbsd/linux/s390x/mod.rs
@@ -782,10 +782,6 @@ pub const PTRACE_POKEUSER: ::c_uint = 6;
pub const PTRACE_CONT: ::c_uint = 7;
pub const PTRACE_KILL: ::c_uint = 8;
pub const PTRACE_SINGLESTEP: ::c_uint = 9;
-pub const PTRACE_GETREGS: ::c_uint = 12;
-pub const PTRACE_SETREGS: ::c_uint = 13;
-pub const PTRACE_GETFPREGS: ::c_uint = 14;
-pub const PTRACE_SETFPREGS: ::c_uint = 15;
pub const PTRACE_ATTACH: ::c_uint = 16;
pub const PTRACE_DETACH: ::c_uint = 17;
pub const PTRACE_SYSCALL: ::c_uint = 24;
diff --git a/src/unix/uclibc/mips/mips32/mod.rs b/src/unix/uclibc/mips/mips32/mod.rs
index 23b385424487e..410ab70c440a1 100644
--- a/src/unix/uclibc/mips/mips32/mod.rs
+++ b/src/unix/uclibc/mips/mips32/mod.rs
@@ -247,7 +247,6 @@ pub const SYS_mknod: ::c_long = 4000 + 14;
pub const SYS_chmod: ::c_long = 4000 + 15;
pub const SYS_lchown: ::c_long = 4000 + 16;
pub const SYS_break: ::c_long = 4000 + 17;
-pub const SYS_unused18: ::c_long = 4000 + 18;
pub const SYS_lseek: ::c_long = 4000 + 19;
pub const SYS_getpid: ::c_long = 4000 + 20;
pub const SYS_mount: ::c_long = 4000 + 21;
@@ -257,7 +256,6 @@ pub const SYS_getuid: ::c_long = 4000 + 24;
pub const SYS_stime: ::c_long = 4000 + 25;
pub const SYS_ptrace: ::c_long = 4000 + 26;
pub const SYS_alarm: ::c_long = 4000 + 27;
-pub const SYS_unused28: ::c_long = 4000 + 28;
pub const SYS_pause: ::c_long = 4000 + 29;
pub const SYS_utime: ::c_long = 4000 + 30;
pub const SYS_stty: ::c_long = 4000 + 31;
@@ -288,7 +286,6 @@ pub const SYS_fcntl: ::c_long = 4000 + 55;
pub const SYS_mpx: ::c_long = 4000 + 56;
pub const SYS_setpgid: ::c_long = 4000 + 57;
pub const SYS_ulimit: ::c_long = 4000 + 58;
-pub const SYS_unused59: ::c_long = 4000 + 59;
pub const SYS_umask: ::c_long = 4000 + 60;
pub const SYS_chroot: ::c_long = 4000 + 61;
pub const SYS_ustat: ::c_long = 4000 + 62;
@@ -311,9 +308,7 @@ pub const SYS_gettimeofday: ::c_long = 4000 + 78;
pub const SYS_settimeofday: ::c_long = 4000 + 79;
pub const SYS_getgroups: ::c_long = 4000 + 80;
pub const SYS_setgroups: ::c_long = 4000 + 81;
-pub const SYS_reserved82: ::c_long = 4000 + 82;
pub const SYS_symlink: ::c_long = 4000 + 83;
-pub const SYS_unused84: ::c_long = 4000 + 84;
pub const SYS_readlink: ::c_long = 4000 + 85;
pub const SYS_uselib: ::c_long = 4000 + 86;
pub const SYS_swapon: ::c_long = 4000 + 87;
@@ -338,7 +333,6 @@ pub const SYS_getitimer: ::c_long = 4000 + 105;
pub const SYS_stat: ::c_long = 4000 + 106;
pub const SYS_lstat: ::c_long = 4000 + 107;
pub const SYS_fstat: ::c_long = 4000 + 108;
-pub const SYS_unused109: ::c_long = 4000 + 109;
pub const SYS_iopl: ::c_long = 4000 + 110;
pub const SYS_vhangup: ::c_long = 4000 + 111;
pub const SYS_idle: ::c_long = 4000 + 112;
@@ -379,7 +373,6 @@ pub const SYS_writev: ::c_long = 4000 + 146;
pub const SYS_cacheflush: ::c_long = 4000 + 147;
pub const SYS_cachectl: ::c_long = 4000 + 148;
pub const SYS_sysmips: ::c_long = 4000 + 149;
-pub const SYS_unused150: ::c_long = 4000 + 150;
pub const SYS_getsid: ::c_long = 4000 + 151;
pub const SYS_fdatasync: ::c_long = 4000 + 152;
pub const SYS__sysctl: ::c_long = 4000 + 153;
@@ -450,7 +443,6 @@ pub const SYS_mincore: ::c_long = 4000 + 217;
pub const SYS_madvise: ::c_long = 4000 + 218;
pub const SYS_getdents64: ::c_long = 4000 + 219;
pub const SYS_fcntl64: ::c_long = 4000 + 220;
-pub const SYS_reserved221: ::c_long = 4000 + 221;
pub const SYS_gettid: ::c_long = 4000 + 222;
pub const SYS_readahead: ::c_long = 4000 + 223;
pub const SYS_setxattr: ::c_long = 4000 + 224;
diff --git a/src/wasi.rs b/src/wasi.rs
index a014e4c0fa330..345c85adb5042 100644
--- a/src/wasi.rs
+++ b/src/wasi.rs
@@ -1025,7 +1025,7 @@ extern {
path: *const c_char,
) -> c_int;
pub fn __wasilibc_fd_renumber(fd: c_int, newfd: c_int) -> c_int;
- pub fn __wasilibc_rmfileat(fd: c_int, path: *const c_char) -> c_int;
+ pub fn __wasilibc_unlinkat(fd: c_int, path: *const c_char) -> c_int;
pub fn __wasilibc_rmdirat(fd: c_int, path: *const c_char) -> c_int;
pub fn __wasilibc_init_preopen();
pub fn __wasilibc_find_relpath(
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index aba2a3056852c..4ff6b3a503f38 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -13,378 +13,291 @@ fn do_cc() {
}
fn do_ctest() {
- let target = env::var("TARGET").unwrap();
- let aarch64 = target.contains("aarch64");
- let i686 = target.contains("i686");
- let x86_64 = target.contains("x86_64");
- let x32 = target.ends_with("gnux32");
- let linux = target.contains("unknown-linux");
- let android = target.contains("android");
- let emscripten = target.contains("asm");
- let musl = target.contains("musl") || emscripten;
- let uclibc = target.contains("uclibc");
- let freebsd = target.contains("freebsd");
- let mips = target.contains("mips");
- let openbsd = target.contains("openbsd");
- let bsdlike = freebsd || openbsd;
- let mut cfg = ctest::TestGenerator::new();
-
- match &target {
+ match &env::var("TARGET").unwrap() {
+ t if t.contains("android") => return test_android(t),
t if t.contains("apple") => return test_apple(t),
+ t if t.contains("cloudabi") => return test_cloudabi(t),
+ t if t.contains("dragonfly") => return test_dragonflybsd(t),
+ t if t.contains("emscripten") => return test_emscripten(t),
+ t if t.contains("freebsd") => return test_freebsd(t),
+ t if t.contains("linux") => return test_linux(t),
+ t if t.contains("netbsd") => return test_netbsd(t),
t if t.contains("openbsd") => return test_openbsd(t),
- t if t.contains("windows") => return test_windows(t),
t if t.contains("redox") => return test_redox(t),
- t if t.contains("cloudabi") => return test_cloudabi(t),
t if t.contains("solaris") => return test_solaris(t),
- t if t.contains("netbsd") => return test_netbsd(t),
- t if t.contains("dragonfly") => return test_dragonflybsd(t),
t if t.contains("wasi") => return test_wasi(t),
- _ => (),
+ t if t.contains("windows") => return test_windows(t),
+ t => panic!("unknown target {}", t),
}
+}
- // Pull in extra goodies
- if linux || android || emscripten {
- cfg.define("_GNU_SOURCE", None);
- } else if freebsd {
- cfg.define("_WITH_GETLINE", None);
- }
+fn main() {
+ do_cc();
+ do_ctest();
+}
- // Android doesn't actually have in_port_t but it's much easier if we
- // provide one for us to test against
- if android {
- cfg.define("in_port_t", Some("uint16_t"));
- }
+macro_rules! headers {
+ ($cfg:ident: $header:expr) => {
+ $cfg.header($header);
+ };
+ ($cfg:ident: $($header:expr),*) => {
+ $(headers!($cfg: $header);)*
+ };
+ ($cfg:ident: $($header:expr,)*) => {
+ $(headers!($cfg: $header);)*
+ };
+}
- cfg.header("errno.h")
- .header("fcntl.h")
- .header("limits.h")
- .header("locale.h")
- .header("stddef.h")
- .header("stdint.h")
- .header("stdio.h")
- .header("stdlib.h")
- .header("sys/stat.h")
- .header("sys/types.h")
- .header("time.h")
- .header("wchar.h");
+fn test_apple(target: &str) {
+ assert!(target.contains("apple"));
+ let x86_64 = target.contains("x86_64");
+ let mut cfg = ctest::TestGenerator::new();
cfg.flag("-Wno-deprecated-declarations");
+ cfg.define("__APPLE_USE_RFC_3542", None);
- cfg.header("ctype.h");
- cfg.header("dirent.h");
- cfg.header("net/if.h");
- cfg.header("net/route.h");
- cfg.header("net/if_arp.h");
- if linux || android {
- cfg.header("linux/if_alg.h");
- }
- cfg.header("netdb.h");
- cfg.header("netinet/in.h");
- cfg.header("netinet/ip.h");
- cfg.header("netinet/tcp.h");
- cfg.header("netinet/udp.h");
- cfg.header("resolv.h");
- cfg.header("pthread.h");
- cfg.header("dlfcn.h");
- cfg.header("signal.h");
- cfg.header("string.h");
- cfg.header("sys/file.h");
- cfg.header("sys/ioctl.h");
- cfg.header("sys/mman.h");
- cfg.header("sys/resource.h");
- cfg.header("sys/socket.h");
- if linux && !musl {
- cfg.header("linux/if.h");
- cfg.header("sys/auxv.h");
+ headers! { cfg:
+ "aio.h",
+ "ctype.h",
+ "dirent.h",
+ "dlfcn.h",
+ "errno.h",
+ "execinfo.h",
+ "fcntl.h",
+ "glob.h",
+ "grp.h",
+ "ifaddrs.h",
+ "langinfo.h",
+ "limits.h",
+ "locale.h",
+ "mach-o/dyld.h",
+ "mach/mach_time.h",
+ "malloc/malloc.h",
+ "net/bpf.h",
+ "net/if.h",
+ "net/if_arp.h",
+ "net/if_dl.h",
+ "net/if_utun.h",
+ "net/route.h",
+ "net/route.h",
+ "netdb.h",
+ "netinet/if_ether.h",
+ "netinet/in.h",
+ "netinet/in.h",
+ "netinet/ip.h",
+ "netinet/tcp.h",
+ "netinet/udp.h",
+ "poll.h",
+ "pthread.h",
+ "pwd.h",
+ "resolv.h",
+ "sched.h",
+ "semaphore.h",
+ "signal.h",
+ "spawn.h",
+ "stddef.h",
+ "stdint.h",
+ "stdio.h",
+ "stdlib.h",
+ "string.h",
+ "sys/event.h",
+ "sys/file.h",
+ "sys/ioctl.h",
+ "sys/ipc.h",
+ "sys/kern_control.h",
+ "sys/mman.h",
+ "sys/mount.h",
+ "sys/proc_info.h",
+ "sys/ptrace.h",
+ "sys/quota.h",
+ "sys/resource.h",
+ "sys/sem.h",
+ "sys/shm.h",
+ "sys/socket.h",
+ "sys/stat.h",
+ "sys/statvfs.h",
+ "sys/sys_domain.h",
+ "sys/sysctl.h",
+ "sys/time.h",
+ "sys/times.h",
+ "sys/types.h",
+ "sys/uio.h",
+ "sys/un.h",
+ "sys/utsname.h",
+ "sys/wait.h",
+ "sys/xattr.h",
+ "syslog.h",
+ "termios.h",
+ "time.h",
+ "unistd.h",
+ "util.h",
+ "utime.h",
+ "utmpx.h",
+ "wchar.h",
+ "xlocale.h",
}
- cfg.header("sys/time.h");
- cfg.header("sys/un.h");
- cfg.header("sys/wait.h");
- cfg.header("unistd.h");
- cfg.header("utime.h");
- cfg.header("pwd.h");
- cfg.header("grp.h");
- cfg.header("sys/utsname.h");
- cfg.header("sys/ptrace.h");
- cfg.header("sys/mount.h");
- cfg.header("sys/uio.h");
- cfg.header("sched.h");
- cfg.header("termios.h");
- cfg.header("poll.h");
- cfg.header("syslog.h");
- cfg.header("semaphore.h");
- cfg.header("sys/statvfs.h");
- cfg.header("sys/times.h");
-
- if android {
- if !aarch64 && !x86_64 {
- // time64_t is not define for aarch64 and x86_64
- // If included it will generate the error 'Your time_t is already 64-bit'
- cfg.header("time64.h");
- }
- cfg.header("arpa/inet.h");
- cfg.header("xlocale.h");
- cfg.header("ifaddrs.h");
- if i686 || x86_64 {
- cfg.header("sys/reg.h");
- }
- } else {
- cfg.header("glob.h");
- cfg.header("ifaddrs.h");
- cfg.header("langinfo.h");
-
- if !openbsd && !freebsd {
- cfg.header("sys/quota.h");
- }
-
- if !musl && !x32 {
- cfg.header("sys/sysctl.h");
- }
-
- if !musl && !uclibc {
- if !openbsd && !uclibc {
- cfg.header("execinfo.h");
- }
- if openbsd {
- cfg.header("utmp.h");
- } else {
- cfg.header("utmpx.h");
- }
- }
+ if x86_64 {
+ headers! { cfg: "crt_externs.h" }
}
- if bsdlike {
- cfg.header("sys/event.h");
- cfg.header("net/if_dl.h");
- if freebsd {
- cfg.header("net/bpf.h");
- cfg.header("libutil.h");
- } else {
- cfg.header("util.h");
- }
- }
+ cfg.skip_struct(move |ty| {
+ match ty {
+ // FIXME: actually a union
+ "sigval" => true,
- if linux || emscripten {
- cfg.header("mntent.h");
- cfg.header("mqueue.h");
- cfg.header("ucontext.h");
- if !uclibc {
- // optionally included in uclibc
- cfg.header("sys/xattr.h");
- }
- cfg.header("sys/ipc.h");
- cfg.header("sys/sem.h");
- cfg.header("sys/msg.h");
- cfg.header("sys/shm.h");
- cfg.header("sys/user.h");
- cfg.header("sys/timerfd.h");
- cfg.header("shadow.h");
- if !emscripten {
- cfg.header("linux/input.h");
- cfg.header("linux/falloc.h");
- }
- if x86_64 {
- cfg.header("sys/io.h");
- }
- if i686 || x86_64 {
- cfg.header("sys/reg.h");
+ _ => false,
}
- }
+ });
- if linux || android || emscripten {
- cfg.header("malloc.h");
- cfg.header("net/ethernet.h");
- cfg.header("netpacket/packet.h");
- cfg.header("sched.h");
- cfg.header("sys/epoll.h");
- cfg.header("sys/eventfd.h");
- cfg.header("sys/prctl.h");
- cfg.header("sys/sendfile.h");
- cfg.header("sys/signalfd.h");
- cfg.header("sys/vfs.h");
- cfg.header("sys/syscall.h");
- cfg.header("sys/personality.h");
- cfg.header("sys/swap.h");
- cfg.header("pty.h");
- cfg.header("utmp.h");
- if !uclibc {
- cfg.header("sys/sysinfo.h");
- }
- cfg.header("sys/reboot.h");
- if !emscripten {
- cfg.header("linux/sockios.h");
- cfg.header("linux/netlink.h");
- cfg.header("linux/genetlink.h");
- cfg.header("linux/netfilter_ipv4.h");
- cfg.header("linux/netfilter_ipv6.h");
- cfg.header("linux/fs.h");
- }
- if !musl {
- cfg.header("asm/mman.h");
- cfg.header("linux/magic.h");
- cfg.header("linux/reboot.h");
- cfg.header("linux/netfilter/nf_tables.h");
-
- if !mips {
- cfg.header("linux/quota.h");
- }
+ cfg.skip_const(move |name| {
+ match name {
+ // These OSX constants are removed in Sierra.
+ // https://developer.apple.com/library/content/releasenotes/General/APIDiffsMacOS10_12/Swift/Darwin.html
+ "KERN_KDENABLE_BG_TRACE" | "KERN_KDDISABLE_BG_TRACE" => true,
+ _ => false,
}
- }
+ });
+
+ cfg.skip_fn(move |name| {
+ // skip those that are manually verified
+ match name {
+ // FIXME: https://github.com/rust-lang/libc/issues/1272
+ "execv" | "execve" | "execvp" => true,
- if linux || android {
- cfg.header("sys/fsuid.h");
- cfg.header("linux/module.h");
- cfg.header("linux/seccomp.h");
- cfg.header("linux/if_ether.h");
- cfg.header("linux/if_tun.h");
- cfg.header("linux/net_tstamp.h");
- cfg.header("sys/inotify.h");
+ // close calls the close_nocancel system call
+ "close" => true,
- // DCCP support
- if !uclibc && !musl && !emscripten {
- cfg.header("linux/dccp.h");
+ _ => false,
}
+ });
- if !musl || mips {
- cfg.header("linux/memfd.h");
+ cfg.skip_field_type(move |struct_, field| {
+ match (struct_, field) {
+ // FIXME: actually a union
+ ("sigevent", "sigev_value") => true,
+ _ => false,
}
- }
-
- if linux {
- cfg.header("linux/random.h");
- cfg.header("elf.h");
- cfg.header("link.h");
- cfg.header("spawn.h");
- }
-
- if freebsd {
- cfg.header("mqueue.h");
- cfg.header("pthread_np.h");
- cfg.header("sched.h");
- cfg.header("ufs/ufs/quota.h");
- cfg.header("sys/extattr.h");
- cfg.header("sys/jail.h");
- cfg.header("sys/ipc.h");
- cfg.header("sys/msg.h");
- cfg.header("sys/shm.h");
- cfg.header("sys/procdesc.h");
- cfg.header("sys/rtprio.h");
- cfg.header("spawn.h");
- }
-
- if openbsd {
- cfg.header("ufs/ufs/quota.h");
- cfg.header("pthread_np.h");
- cfg.header("sys/syscall.h");
- }
+ });
- if linux || freebsd || emscripten {
- if !uclibc {
- cfg.header("aio.h");
+ cfg.volatile_item(|i| {
+ use ctest::VolatileItemKind::*;
+ match i {
+ StructField(ref n, ref f) if n == "aiocb" && f == "aio_buf" => {
+ true
+ }
+ _ => false,
}
- }
+ });
cfg.type_name(move |ty, is_struct, is_union| {
match ty {
// Just pass all these through, no need for a "struct" prefix
- "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr"
- | "Elf64_Phdr" | "Elf32_Shdr" | "Elf64_Shdr" | "Elf32_Sym"
- | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr" | "Elf32_Chdr"
- | "Elf64_Chdr" => ty.to_string(),
+ "FILE" | "DIR" | "Dl_info" => ty.to_string(),
// OSX calls this something else
- "sighandler_t" if bsdlike => "sig_t".to_string(),
+ "sighandler_t" => "sig_t".to_string(),
t if is_union => format!("union {}", t),
-
t if t.ends_with("_t") => t.to_string(),
-
- // put `struct` in front of all structs:.
t if is_struct => format!("struct {}", t),
-
t => t.to_string(),
}
});
- let target2 = target.clone();
cfg.field_name(move |struct_, field| {
match field {
- "st_birthtime" if openbsd && struct_ == "stat" => {
- "__st_birthtime".to_string()
- }
- "st_birthtime_nsec" if openbsd && struct_ == "stat" => {
- "__st_birthtimensec".to_string()
- }
- // Our stat *_nsec fields normally don't actually exist but are part
- // of a timeval struct
s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
- if target2.contains("android") {
- s.to_string()
- } else {
- s.replace("e_nsec", ".tv_nsec")
- }
+ s.replace("e_nsec", "espec.tv_nsec")
}
- "u64" if struct_ == "epoll_event" => "data.u64".to_string(),
- "type_"
- if (linux || freebsd)
- && (struct_ == "input_event"
- || struct_ == "input_mask"
- || struct_ == "ff_effect"
- || struct_ == "rtprio") =>
- {
- "type".to_string()
+ // FIXME: sigaction actually contains a union with two variants:
+ // a sa_sigaction with type: (*)(int, struct __siginfo *, void *)
+ // a sa_handler with type sig_t
+ "sa_sigaction" if struct_ == "sigaction" => {
+ "sa_handler".to_string()
}
s => s.to_string(),
}
});
- cfg.skip_type(move |ty| {
- match ty {
- // sighandler_t is crazy across platforms
- "sighandler_t" => true,
-
- _ => false,
- }
- });
-
- cfg.skip_struct(move |ty| {
- match ty {
- "sockaddr_nl" => musl,
-
- // On Linux, the type of `ut_tv` field of `struct utmpx`
- // can be an anonymous struct, so an extra struct,
- // which is absent in glibc, has to be defined.
- "__timeval" if linux => true,
-
- // This is actually a union, not a struct
- "sigval" => true,
-
- // Linux kernel headers used on musl are too old to have this
- // definition. Because it's tested on other Linux targets, skip it.
- "input_mask" if musl => true,
-
- // These structs have changed since unified headers in NDK r14b.
- // `st_atime` and `st_atime_nsec` have changed sign.
- // FIXME: unskip it for next major release
- "stat" | "stat64" if android => true,
+ cfg.generate("../src/lib.rs", "main.rs");
+}
- // These are tested as part of the linux_fcntl tests since there are
- // header conflicts when including them with all the other structs.
- "termios2" => true,
+fn test_openbsd(target: &str) {
+ assert!(target.contains("openbsd"));
- _ => false,
- }
- });
+ let mut cfg = ctest::TestGenerator::new();
+ cfg.flag("-Wno-deprecated-declarations");
- cfg.skip_signededness(move |c| {
- match c {
- "LARGE_INTEGER" | "float" | "double" => true,
- n if n.starts_with("pthread") => true,
- // sem_t is a struct or pointer
- "sem_t" if openbsd || freebsd => true,
- // mqd_t is a pointer on FreeBSD
- "mqd_t" if freebsd => true,
+ headers! { cfg:
+ "errno.h",
+ "fcntl.h",
+ "limits.h",
+ "locale.h",
+ "stddef.h",
+ "stdint.h",
+ "stdio.h",
+ "stdlib.h",
+ "sys/stat.h",
+ "sys/types.h",
+ "time.h",
+ "wchar.h",
+ "ctype.h",
+ "dirent.h",
+ "sys/socket.h",
+ "net/if.h",
+ "net/route.h",
+ "net/if_arp.h",
+ "netdb.h",
+ "netinet/in.h",
+ "netinet/ip.h",
+ "netinet/tcp.h",
+ "netinet/udp.h",
+ "resolv.h",
+ "pthread.h",
+ "dlfcn.h",
+ "signal.h",
+ "string.h",
+ "sys/file.h",
+ "sys/ioctl.h",
+ "sys/mman.h",
+ "sys/resource.h",
+ "sys/socket.h",
+ "sys/time.h",
+ "sys/un.h",
+ "sys/wait.h",
+ "unistd.h",
+ "utime.h",
+ "pwd.h",
+ "grp.h",
+ "sys/utsname.h",
+ "sys/ptrace.h",
+ "sys/mount.h",
+ "sys/uio.h",
+ "sched.h",
+ "termios.h",
+ "poll.h",
+ "syslog.h",
+ "semaphore.h",
+ "sys/statvfs.h",
+ "sys/times.h",
+ "glob.h",
+ "ifaddrs.h",
+ "langinfo.h",
+ "sys/sysctl.h",
+ "utmp.h",
+ "sys/event.h",
+ "net/if_dl.h",
+ "util.h",
+ "ufs/ufs/quota.h",
+ "pthread_np.h",
+ "sys/syscall.h",
+ }
+
+ cfg.skip_struct(move |ty| {
+ match ty {
+ // FIXME: actually a union
+ "sigval" => true,
_ => false,
}
@@ -392,183 +305,579 @@ fn do_ctest() {
cfg.skip_const(move |name| {
match name {
- "SIG_DFL" | "SIG_ERR" | "SIG_IGN" => true, // sighandler_t weirdness
- "SIGUNUSED" => true, // removed in glibc 2.26
+ // Removed in OpenBSD 6.0
+ "KERN_USERMOUNT" | "KERN_ARND" => true,
+ _ => false,
+ }
+ });
- // types on musl are defined a little differently
- n if musl && n.contains("__SIZEOF_PTHREAD") => true,
+ cfg.skip_fn(move |name| {
+ match name {
+ "execv" | "execve" | "execvp" | "execvpe" => true,
- // Skip constants not defined in MUSL but just passed down to the
- // kernel regardless
- "RLIMIT_NLIMITS"
- | "TCP_COOKIE_TRANSACTIONS"
- | "RLIMIT_RTTIME"
- | "MSG_COPY"
- if musl =>
- {
- true
- }
- // work around super old mips toolchain
- "SCHED_IDLE" | "SHM_NORESERVE" => mips,
+ // typed 2nd arg
+ "gettimeofday" => true,
- // weird signed extension or something like that?
- "MS_NOUSER" => true,
- "MS_RMT_MASK" => true, // updated in glibc 2.22 and musl 1.1.13
+ // Removed in OpenBSD 6.5
+ // https://marc.info/?l=openbsd-cvs&m=154723400730318
+ "mincore" => true,
- // These constants were removed in FreeBSD 11 (svn r273250) but will
- // still be accepted and ignored at runtime.
- "MAP_RENAME" | "MAP_NORESERVE" if freebsd => true,
+ _ => false,
+ }
+ });
- // These constants were removed in FreeBSD 11 (svn r262489),
- // and they've never had any legitimate use outside of the
- // base system anyway.
- "CTL_MAXID" | "KERN_MAXID" | "HW_MAXID" | "NET_MAXID"
- | "USER_MAXID"
- if freebsd =>
- {
- true
- }
+ cfg.type_name(move |ty, is_struct, is_union| {
+ match ty {
+ // Just pass all these through, no need for a "struct" prefix
+ "FILE" | "DIR" | "Dl_info" => ty.to_string(),
- // These constants were added in FreeBSD 11
- "EVFILT_PROCDESC" | "EVFILT_SENDFILE" | "EVFILT_EMPTY"
- | "PD_CLOEXEC" | "PD_ALLOWED_AT_FORK"
- if freebsd =>
- {
- true
- }
+ // OSX calls this something else
+ "sighandler_t" => "sig_t".to_string(),
- // These constants were added in FreeBSD 12
- "SF_USER_READAHEAD" | "SO_REUSEPORT_LB" if freebsd => true,
+ t if is_union => format!("union {}", t),
+ t if t.ends_with("_t") => t.to_string(),
+ t if is_struct => format!("struct {}", t),
+ t => t.to_string(),
+ }
+ });
- // These constants were removed in OpenBSD 6 (https://git.io/v7gBO
- // https://git.io/v7gBq)
- "KERN_USERMOUNT" | "KERN_ARND" if openbsd => true,
+ cfg.field_name(move |struct_, field| match field {
+ "st_birthtime" if struct_.starts_with("stat") => {
+ "__st_birthtime".to_string()
+ }
+ "st_birthtime_nsec" if struct_.starts_with("stat") => {
+ "__st_birthtimensec".to_string()
+ }
+ s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
+ s.replace("e_nsec", ".tv_nsec")
+ }
+ "sa_sigaction" if struct_ == "sigaction" => "sa_handler".to_string(),
+ s => s.to_string(),
+ });
- // These are either unimplemented or optionally built into uClibc
- "LC_CTYPE_MASK"
- | "LC_NUMERIC_MASK"
- | "LC_TIME_MASK"
- | "LC_COLLATE_MASK"
- | "LC_MONETARY_MASK"
- | "LC_MESSAGES_MASK"
- | "MADV_MERGEABLE"
- | "MADV_UNMERGEABLE"
- | "MADV_HWPOISON"
- | "IPV6_ADD_MEMBERSHIP"
- | "IPV6_DROP_MEMBERSHIP"
- | "IPV6_MULTICAST_LOOP"
- | "IPV6_V6ONLY"
- | "MAP_STACK"
- | "RTLD_DEEPBIND"
- | "SOL_IPV6"
- | "SOL_ICMPV6"
- if uclibc =>
- {
- true
- }
+ cfg.skip_field_type(move |struct_, field| {
+ // type siginfo_t.si_addr changed from OpenBSD 6.0 to 6.1
+ (struct_ == "siginfo_t" && field == "si_addr")
+ });
- // Musl uses old, patched kernel headers
- "FALLOC_FL_COLLAPSE_RANGE"
- | "FALLOC_FL_ZERO_RANGE"
- | "FALLOC_FL_INSERT_RANGE"
- | "FALLOC_FL_UNSHARE_RANGE"
- | "RENAME_NOREPLACE"
- | "RENAME_EXCHANGE"
- | "RENAME_WHITEOUT"
- // ALG_SET_AEAD_* constants are available starting from kernel 3.19
- | "ALG_SET_AEAD_ASSOCLEN"
- | "ALG_SET_AEAD_AUTHSIZE"
- if musl =>
- {
- true
- }
+ cfg.generate("../src/lib.rs", "main.rs");
+}
- // Both android and musl use old kernel headers
- // These are constants used in getrandom syscall
- "GRND_NONBLOCK" | "GRND_RANDOM" if musl || android => true,
+fn test_windows(target: &str) {
+ assert!(target.contains("windows"));
+ let gnu = target.contains("gnu");
- // Defined by libattr not libc on linux (hard to test).
- // See constant definition for more details.
- "ENOATTR" if android || linux => true,
+ let mut cfg = ctest::TestGenerator::new();
+ cfg.define("_WIN32_WINNT", Some("0x8000"));
- // On mips*-unknown-linux-gnu* CMSPAR cannot be included with the set of headers we
- // want to use here for testing. It's originally defined in asm/termbits.h, which is
- // also included by asm/termios.h, but not the standard termios.h. There's no way to
- // include both asm/termbits.h and termios.h and there's no way to include both
- // asm/termios.h and ioctl.h (+ some other headers) because of redeclared types.
- "CMSPAR" if mips && linux && !musl => true,
+ headers! { cfg:
+ "direct.h",
+ "errno.h",
+ "fcntl.h",
+ "io.h",
+ "limits.h",
+ "locale.h",
+ "process.h",
+ "signal.h",
+ "stddef.h",
+ "stdint.h",
+ "stdio.h",
+ "stdlib.h",
+ "sys/stat.h",
+ "sys/types.h",
+ "sys/utime.h",
+ "time.h",
+ "wchar.h",
+ }
+
+ if gnu {
+ headers! { cfg: "ws2tcpip.h" }
+ } else {
+ headers! { cfg: "Winsock2.h" };
+ }
+
+ cfg.type_name(move |ty, is_struct, is_union| {
+ match ty {
+ // Just pass all these through, no need for a "struct" prefix
+ "FILE" | "DIR" | "Dl_info" => ty.to_string(),
+
+ // FIXME: these don't exist:
+ "time64_t" => "__time64_t".to_string(),
+ "ssize_t" => "SSIZE_T".to_string(),
+
+ "sighandler_t" if !gnu => "_crt_signal_t".to_string(),
+ "sighandler_t" if gnu => "__p_sig_fn_t".to_string(),
+
+ t if is_union => format!("union {}", t),
+ t if t.ends_with("_t") => t.to_string(),
+
+ // Windows uppercase structs don't have `struct` in front:
+ t if is_struct => {
+ if ty.clone().chars().next().unwrap().is_uppercase() {
+ t.to_string()
+ } else if t == "stat" {
+ "struct __stat64".to_string()
+ } else if t == "utimbuf" {
+ "struct __utimbuf64".to_string()
+ } else {
+ // put `struct` in front of all structs:
+ format!("struct {}", t)
+ }
+ }
+ t => t.to_string(),
+ }
+ });
+
+ cfg.fn_cname(move |name, cname| cname.unwrap_or(name).to_string());
+
+ cfg.skip_type(move |name| match name {
+ "SSIZE_T" if !gnu => true,
+ "ssize_t" if !gnu => true,
+ _ => false,
+ });
+
+ cfg.skip_const(move |name| {
+ match name {
+ // FIXME: API error:
+ // SIG_ERR type is "void (*)(int)", not "int"
+ "SIG_ERR" => true,
+ _ => false,
+ }
+ });
+
+ // FIXME: All functions point to the wrong addresses?
+ cfg.skip_fn_ptrcheck(|_| true);
+
+ cfg.skip_signededness(move |c| {
+ match c {
+ // windows-isms
+ n if n.starts_with("P") => true,
+ n if n.starts_with("H") => true,
+ n if n.starts_with("LP") => true,
+ "sighandler_t" if gnu => true,
+ _ => false,
+ }
+ });
+
+ cfg.skip_fn(move |name| {
+ match name {
+ // FIXME: API error:
+ "execv" | "execve" | "execvp" | "execvpe" => true,
+
+ _ => false,
+ }
+ });
+
+ cfg.generate("../src/lib.rs", "main.rs");
+}
+
+fn test_redox(target: &str) {
+ assert!(target.contains("redox"));
+
+ let mut cfg = ctest::TestGenerator::new();
+ cfg.flag("-Wno-deprecated-declarations");
+
+ headers! {
+ cfg:
+ "ctype.h",
+ "dirent.h",
+ "dlfcn.h",
+ "errno.h",
+ "execinfo.h",
+ "fcntl.h",
+ "glob.h",
+ "grp.h",
+ "ifaddrs.h",
+ "langinfo.h",
+ "limits.h",
+ "locale.h",
+ "net/if.h",
+ "net/if_arp.h",
+ "net/route.h",
+ "netdb.h",
+ "netinet/in.h",
+ "netinet/ip.h",
+ "netinet/tcp.h",
+ "netinet/udp.h",
+ "poll.h",
+ "pthread.h",
+ "pwd.h",
+ "resolv.h",
+ "sched.h",
+ "semaphore.h",
+ "string.h",
+ "strings.h",
+ "sys/file.h",
+ "sys/ioctl.h",
+ "sys/mman.h",
+ "sys/mount.h",
+ "sys/ptrace.h",
+ "sys/quota.h",
+ "sys/resource.h",
+ "sys/socket.h",
+ "sys/stat.h",
+ "sys/statvfs.h",
+ "sys/sysctl.h",
+ "sys/time.h",
+ "sys/times.h",
+ "sys/types.h",
+ "sys/uio.h",
+ "sys/un.h",
+ "sys/utsname.h",
+ "sys/wait.h",
+ "syslog.h",
+ "termios.h",
+ "time.h",
+ "unistd.h",
+ "utime.h",
+ "utmpx.h",
+ "wchar.h",
+ }
+
+ cfg.generate("../src/lib.rs", "main.rs");
+}
+
+fn test_cloudabi(target: &str) {
+ assert!(target.contains("cloudabi"));
+
+ let mut cfg = ctest::TestGenerator::new();
+ cfg.flag("-Wno-deprecated-declarations");
+
+ headers! {
+ cfg:
+ "execinfo.h",
+ "glob.h",
+ "ifaddrs.h",
+ "langinfo.h",
+ "sys/ptrace.h",
+ "sys/quota.h",
+ "sys/sysctl.h",
+ "utmpx.h",
+ "ctype.h",
+ "dirent.h",
+ "dlfcn.h",
+ "errno.h",
+ "fcntl.h",
+ "grp.h",
+ "limits.h",
+ "locale.h",
+ "net/if.h",
+ "net/if_arp.h",
+ "net/route.h",
+ "netdb.h",
+ "netinet/in.h",
+ "netinet/ip.h",
+ "netinet/tcp.h",
+ "netinet/udp.h",
+ "poll.h",
+ "pthread.h",
+ "pwd.h",
+ "resolv.h",
+ "sched.h",
+ "semaphore.h",
+ "signal.h",
+ "stddef.h",
+ "stdint.h",
+ "stdio.h",
+ "stdlib.h",
+ "string.h",
+ "strings.h",
+ "sys/file.h",
+ "sys/ioctl.h",
+ "sys/mman.h",
+ "sys/mount.h",
+ "sys/resource.h",
+ "sys/socket.h",
+ "sys/stat.h",
+ "sys/statvfs.h",
+ "sys/time.h",
+ "sys/times.h",
+ "sys/types.h",
+ "sys/uio.h",
+ "sys/un.h",
+ "sys/utsname.h",
+ "sys/wait.h",
+ "syslog.h",
+ "termios.h",
+ "time.h",
+ "unistd.h",
+ "utime.h",
+ "wchar.h",
+ }
+
+ cfg.generate("../src/lib.rs", "main.rs");
+}
+
+fn test_solaris(target: &str) {
+ assert!(target.contains("solaris"));
+
+ let mut cfg = ctest::TestGenerator::new();
+ cfg.flag("-Wno-deprecated-declarations");
+
+ cfg.define("_XOPEN_SOURCE", Some("700"));
+ cfg.define("__EXTENSIONS__", None);
+ cfg.define("_LCONV_C99", None);
+
+ headers! {
+ cfg:
+ "ctype.h",
+ "dirent.h",
+ "dlfcn.h",
+ "errno.h",
+ "execinfo.h",
+ "fcntl.h",
+ "glob.h",
+ "grp.h",
+ "ifaddrs.h",
+ "langinfo.h",
+ "limits.h",
+ "locale.h",
+ "net/if.h",
+ "net/if_arp.h",
+ "net/route.h",
+ "netdb.h",
+ "netinet/in.h",
+ "netinet/ip.h",
+ "netinet/tcp.h",
+ "netinet/udp.h",
+ "poll.h",
+ "port.h",
+ "pthread.h",
+ "pwd.h",
+ "resolv.h",
+ "sched.h",
+ "semaphore.h",
+ "signal.h",
+ "stddef.h",
+ "stdint.h",
+ "stdio.h",
+ "stdlib.h",
+ "string.h",
+ "sys/epoll.h",
+ "sys/file.h",
+ "sys/filio.h",
+ "sys/ioctl.h",
+ "sys/loadavg.h",
+ "sys/mman.h",
+ "sys/mount.h",
+ "sys/resource.h",
+ "sys/socket.h",
+ "sys/stat.h",
+ "sys/statvfs.h",
+ "sys/time.h",
+ "sys/times.h",
+ "sys/types.h",
+ "sys/uio.h",
+ "sys/un.h",
+ "sys/utsname.h",
+ "sys/wait.h",
+ "syslog.h",
+ "termios.h",
+ "time.h",
+ "ucontext.h",
+ "unistd.h",
+ "utime.h",
+ "utmpx.h",
+ "wchar.h",
+ }
+
+ cfg.skip_const(move |name| match name {
+ "DT_FIFO" | "DT_CHR" | "DT_DIR" | "DT_BLK" | "DT_REG" | "DT_LNK"
+ | "DT_SOCK" | "USRQUOTA" | "GRPQUOTA" | "PRIO_MIN" | "PRIO_MAX" => {
+ true
+ }
+
+ _ => false,
+ });
+
+ cfg.skip_fn(move |name| {
+ // skip those that are manually verified
+ match name {
+ // const-ness only added recently
+ "dladdr" => true,
+
+ // Definition of those functions as changed since unified headers
+ // from NDK r14b These changes imply some API breaking changes but
+ // are still ABI compatible. We can wait for the next major release
+ // to be compliant with the new API.
+ //
+ // FIXME: unskip these for next major release
+ "setpriority" | "personality" => true,
+
+ // signal is defined with sighandler_t, so ignore
+ "signal" => true,
+
+ "cfmakeraw" | "cfsetspeed" => true,
+
+ // FIXME: mincore is defined with caddr_t on Solaris.
+ "mincore" => true,
+
+ _ => false,
+ }
+ });
+
+ cfg.generate("../src/lib.rs", "main.rs");
+}
+
+fn test_netbsd(target: &str) {
+ assert!(target.contains("netbsd"));
+ let rumprun = target.contains("rumprun");
+ let mut cfg = ctest::TestGenerator::new();
+
+ cfg.flag("-Wno-deprecated-declarations");
+ cfg.define("_NETBSD_SOURCE", Some("1"));
+
+ headers! {
+ cfg:
+ "errno.h",
+ "fcntl.h",
+ "limits.h",
+ "locale.h",
+ "stddef.h",
+ "stdint.h",
+ "stdio.h",
+ "stdlib.h",
+ "sys/stat.h",
+ "sys/types.h",
+ "time.h",
+ "wchar.h",
+ "aio.h",
+ "ctype.h",
+ "dirent.h",
+ "dlfcn.h",
+ "glob.h",
+ "grp.h",
+ "ifaddrs.h",
+ "langinfo.h",
+ "net/if.h",
+ "net/if_arp.h",
+ "net/if_dl.h",
+ "net/route.h",
+ "netdb.h",
+ "netinet/in.h",
+ "netinet/ip.h",
+ "netinet/tcp.h",
+ "netinet/udp.h",
+ "poll.h",
+ "pthread.h",
+ "pwd.h",
+ "resolv.h",
+ "sched.h",
+ "semaphore.h",
+ "signal.h",
+ "string.h",
+ "sys/extattr.h",
+ "sys/file.h",
+ "sys/ioctl.h",
+ "sys/ioctl_compat.h",
+ "sys/mman.h",
+ "sys/mount.h",
+ "sys/ptrace.h",
+ "sys/resource.h",
+ "sys/socket.h",
+ "sys/statvfs.h",
+ "sys/sysctl.h",
+ "sys/time.h",
+ "sys/times.h",
+ "sys/uio.h",
+ "sys/un.h",
+ "sys/utsname.h",
+ "sys/wait.h",
+ "syslog.h",
+ "termios.h",
+ "ufs/ufs/quota.h",
+ "ufs/ufs/quota1.h",
+ "unistd.h",
+ "util.h",
+ "utime.h",
+ "mqueue.h",
+ "netinet/dccp.h",
+ "sys/event.h",
+ "sys/quota.h",
+ }
+
+ cfg.type_name(move |ty, is_struct, is_union| {
+ match ty {
+ // Just pass all these through, no need for a "struct" prefix
+ "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr"
+ | "Elf64_Phdr" | "Elf32_Shdr" | "Elf64_Shdr" | "Elf32_Sym"
+ | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr" | "Elf32_Chdr"
+ | "Elf64_Chdr" => ty.to_string(),
+
+ // OSX calls this something else
+ "sighandler_t" => "sig_t".to_string(),
- // On mips Linux targets, MADV_SOFT_OFFLINE is currently missing, though it's been added but CI has too old
- // of a Linux version. Since it exists on all other Linux targets, just ignore this for now and remove once
- // it's been fixed in CI.
- "MADV_SOFT_OFFLINE" if mips && linux => true,
+ t if is_union => format!("union {}", t),
- // These constants are tested in a separate test program generated below because there
- // are header conflicts if we try to include the headers that define them here.
- "F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS" => true,
- "F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW"
- | "F_SEAL_WRITE" => true,
- "QFMT_VFS_OLD" | "QFMT_VFS_V0" | "QFMT_VFS_V1"
- if mips && linux =>
- {
- true
- } // Only on MIPS
- "BOTHER" => true,
+ t if t.ends_with("_t") => t.to_string(),
- "MFD_CLOEXEC" | "MFD_ALLOW_SEALING" if !mips && musl => true,
- // MFD_HUGETLB is not available in some older libc versions on the CI builders. On the
- // x86_64 and i686 builders it seems to be available for all targets, so at least test
- // it there.
- "MFD_HUGETLB"
- if !(x86_64 || i686) || musl || (x86_64 && android) =>
- {
- true
+ // put `struct` in front of all structs:.
+ t if is_struct => format!("struct {}", t),
+
+ t => t.to_string(),
+ }
+ });
+
+ cfg.field_name(move |struct_, field| {
+ match field {
+ // Our stat *_nsec fields normally don't actually exist but are part
+ // of a timeval struct
+ s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
+ s.replace("e_nsec", ".tv_nsec")
}
+ "u64" if struct_ == "epoll_event" => "data.u64".to_string(),
+ s => s.to_string(),
+ }
+ });
- // These are defined for Solaris 11, but the crate is tested on
- // illumos, where they are currently not defined
- "EADI"
- | "PORT_SOURCE_POSTWAIT"
- | "PORT_SOURCE_SIGNAL"
- | "PTHREAD_STACK_MIN" => true,
+ cfg.skip_type(move |ty| {
+ match ty {
+ // FIXME: sighandler_t is crazy across platforms
+ "sighandler_t" => true,
+ _ => false,
+ }
+ });
- // These change all the time from release to release of linux
- // distros, let's just not bother trying to verify them. They
- // shouldn't be used in code anyway...
- "AF_MAX" | "PF_MAX" => true,
+ cfg.skip_struct(move |ty| {
+ match ty {
+ // This is actually a union, not a struct
+ "sigval" => true,
+ // These are tested as part of the linux_fcntl tests since there are
+ // header conflicts when including them with all the other structs.
+ "termios2" => true,
+ _ => false,
+ }
+ });
- // These are not in a glibc release yet, only in kernel headers.
- "AF_XDP"
- | "PF_XDP"
- | "SOL_XDP"
- | "IPV6_FLOWINFO"
- | "IPV6_FLOWLABEL_MGR"
- | "IPV6_FLOWINFO_SEND"
- | "IPV6_FLOWINFO_FLOWLABEL"
- | "IPV6_FLOWINFO_PRIORITY"
- if linux =>
- {
- true
- }
+ cfg.skip_signededness(move |c| {
+ match c {
+ "LARGE_INTEGER" | "float" | "double" => true,
+ // uuid_t is a struct, not an integer.
+ n if n.starts_with("pthread") => true,
+ // sem_t is a struct or pointer
+ "sem_t" => true,
+ _ => false,
+ }
+ });
- | "IP_ORIGDSTADDR"
- | "IP_RECVORIGDSTADDR"
- | "IPV6_ORIGDSTADDR"
- | "IPV6_RECVORIGDSTADDR"
- if freebsd =>
- {
- // FreeBSD 12 required, but CI has FreeBSD 11.
- true
- }
+ cfg.skip_const(move |name| {
+ match name {
+ "SIG_DFL" | "SIG_ERR" | "SIG_IGN" => true, // sighandler_t weirdness
+ "SIGUNUSED" => true, // removed in glibc 2.26
+
+ // weird signed extension or something like that?
+ "MS_NOUSER" => true,
+ "MS_RMT_MASK" => true, // updated in glibc 2.22 and musl 1.1.13
+ "BOTHER" => true,
_ => false,
}
});
cfg.skip_fn(move |name| {
- // skip those that are manually verified
match name {
- "execv" | // crazy stuff with const/mut
+ // FIXME: incorrect API
+ "execv" |
"execve" |
"execvp" |
"execvpe" |
@@ -577,94 +886,27 @@ fn do_ctest() {
"getrlimit" | "getrlimit64" | // non-int in 1st arg
"setrlimit" | "setrlimit64" | // non-int in 1st arg
"prlimit" | "prlimit64" | // non-int in 2nd arg
- "strerror_r" if linux => true, // actually xpg-something-or-other
-
- // int vs uint. Sorry musl, your prototype declarations are "correct" in the sense that
- // they match the interface defined by Linux verbatim, but they conflict with other
- // send*/recv* syscalls
- "sendmmsg" | "recvmmsg" if musl => true,
-
- // typed 2nd arg on linux and android
- "gettimeofday" if linux || android || freebsd || openbsd => true,
-
- // not declared in newer android toolchains
- "getdtablesize" if android => true,
-
- "dlerror" if android => true, // const-ness is added
- "dladdr" if musl => true, // const-ness only added recently
-
- // There seems to be a small error in EGLIBC's eventfd.h header. The
- // [underlying system call][1] always takes its first `count`
- // argument as an `unsigned int`, but [EGLIBC's <sys/eventfd.h>
- // header][2] declares it to take an `int`. [GLIBC's header][3]
- // matches the kernel.
- //
- // EGLIBC is no longer actively developed, and Debian, the largest
- // distribution that had been using it, switched back to GLIBC in
- // April 2015. So effectively all Linux <sys/eventfd.h> headers will
- // be using `unsigned int` soon.
- //
- // [1]: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/fs/eventfd.c?id=refs/tags/v3.12.51#n397
- // [2]: http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/eglibc/trusty/view/head:/sysdeps/unix/sysv/linux/sys/eventfd.h
- // [3]: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/sys/eventfd.h;h=6295f32e937e779e74318eb9d3bdbe76aef8a8f3;hb=4e42b5b8f89f0e288e68be7ad70f9525aebc2cff#l34
- "eventfd" if linux => true,
-
- // The `uname` function in freebsd is now an inline wrapper that
- // delegates to another, but the symbol still exists, so don't check
- // the symbol.
- "uname" if freebsd => true,
-
- // FIXME: need to upgrade FreeBSD version; see https://github.com/rust-lang/libc/issues/938
- "setgrent" if freebsd => true,
-
- // aio_waitcomplete's return type changed between FreeBSD 10 and 11.
- "aio_waitcomplete" if freebsd => true,
-
- // lio_listio confuses the checker, probably because one of its
- // arguments is an array
- "lio_listio" if freebsd => true,
- "lio_listio" if musl => true,
-
- // Apparently the NDK doesn't have this defined on android, but
- // it's in a header file?
- "endpwent" if android => true,
-
- // These are either unimplemented or optionally built into uClibc
- // or "sysinfo", where it's defined but the structs in linux/sysinfo.h and sys/sysinfo.h
- // clash so it can't be tested
- "getxattr" | "lgetxattr" | "fgetxattr" | "setxattr" | "lsetxattr" | "fsetxattr" |
- "listxattr" | "llistxattr" | "flistxattr" | "removexattr" | "lremovexattr" |
- "fremovexattr" |
- "backtrace" |
- "sysinfo" | "newlocale" | "duplocale" | "freelocale" | "uselocale" |
- "nl_langinfo_l" | "wcslen" | "wcstombs" if uclibc => true,
-
- // Apparently res_init exists on Android, but isn't defined in a header:
- // https://mail.gnome.org/archives/commits-list/2013-May/msg01329.html
- "res_init" if android => true,
- // Definition of those functions as changed since unified headers from NDK r14b
- // These changes imply some API breaking changes but are still ABI compatible.
- // We can wait for the next major release to be compliant with the new API.
- // FIXME: unskip these for next major release
- "strerror_r" | "madvise" | "msync" | "mprotect" | "recvfrom" | "getpriority" |
- "setpriority" | "personality" if android => true,
- // In Android 64 bits, these functions have been fixed since unified headers.
- // Ignore these until next major version.
- "bind" | "writev" | "readv" | "sendmsg" | "recvmsg" if android && (aarch64 || x86_64) => true,
-
- // Removed in OpenBSD 6.5
- // https://marc.info/?l=openbsd-cvs&m=154723400730318
- "mincore" if openbsd => true,
-
- _ => false,
- }
- });
+ // These functions presumably exist on netbsd but don't look like
+ // they're implemented on rumprun yet, just let them slide for now.
+ // Some of them look like they have headers but then don't have
+ // corresponding actual definitions either...
+ "shm_open" |
+ "shm_unlink" |
+ "syscall" |
+ "mq_open" |
+ "mq_close" |
+ "mq_getattr" |
+ "mq_notify" |
+ "mq_receive" |
+ "mq_send" |
+ "mq_setattr" |
+ "mq_timedreceive" |
+ "mq_timedsend" |
+ "mq_unlink" |
+ "ptrace" |
+ "sigaltstack" if rumprun => true,
- cfg.skip_static(move |name| {
- match name {
- // Internal constant, not declared in any headers.
- "__progname" if android => true,
_ => false,
}
});
@@ -672,116 +914,24 @@ fn do_ctest() {
cfg.skip_field_type(move |struct_, field| {
// This is a weird union, don't check the type.
(struct_ == "ifaddrs" && field == "ifa_ifu") ||
- // sighandler_t type is super weird
- (struct_ == "sigaction" && field == "sa_sigaction") ||
- // __timeval type is a patch which doesn't exist in glibc
- (linux && struct_ == "utmpx" && field == "ut_tv") ||
- // sigval is actually a union, but we pretend it's a struct
- (struct_ == "sigevent" && field == "sigev_value") ||
- // aio_buf is "volatile void*" and Rust doesn't understand volatile
- (struct_ == "aiocb" && field == "aio_buf") ||
- // stack_t.ss_sp's type changed from FreeBSD 10 to 11 in svn r294930
- (freebsd && struct_ == "stack_t" && field == "ss_sp") ||
- // type siginfo_t.si_addr changed from OpenBSD 6.0 to 6.1
- (openbsd && struct_ == "siginfo_t" && field == "si_addr") ||
- // this one is an anonymous union
- (linux && struct_ == "ff_effect" && field == "u")
- });
-
- cfg.skip_field(move |struct_, field| {
- // this is actually a union on linux, so we can't represent it well and
- // just insert some padding.
- (struct_ == "siginfo_t" && field == "_pad") ||
- // musl names this __dummy1 but it's still there
- (musl && struct_ == "glob_t" && field == "gl_flags") ||
- // musl seems to define this as an *anonymous* bitfield
- (musl && struct_ == "statvfs" && field == "__f_unused") ||
- // sigev_notify_thread_id is actually part of a sigev_un union
- (struct_ == "sigevent" && field == "sigev_notify_thread_id") ||
- // signalfd had SIGSYS fields added in Linux 4.18, but no libc release has them yet.
- (struct_ == "signalfd_siginfo" && (field == "ssi_addr_lsb" ||
- field == "_pad2" ||
- field == "ssi_syscall" ||
- field == "ssi_call_addr" ||
- field == "ssi_arch"))
- });
-
- // FIXME: remove
- cfg.fn_cname(move |name, _cname| name.to_string());
-
- cfg.generate("../src/lib.rs", "main.rs");
-
- // On Linux or Android also generate another script for testing linux/fcntl declarations.
- // These cannot be tested normally because including both `linux/fcntl.h` and `fcntl.h`
- // fails on a lot of platforms.
- let mut cfg = ctest::TestGenerator::new();
- cfg.skip_type(|_| true)
- .skip_fn(|_| true)
- .skip_static(|_| true);
- if android || linux {
- // musl defines these directly in `fcntl.h`
- if musl {
- cfg.header("fcntl.h");
- } else {
- cfg.header("linux/fcntl.h");
- }
- if !musl {
- cfg.header("net/if.h");
- cfg.header("linux/if.h");
- }
- cfg.header("linux/quota.h");
- cfg.header("asm/termbits.h");
- cfg.skip_const(move |name| match name {
- "F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS" => false,
- "F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW"
- | "F_SEAL_WRITE" => false,
- "QFMT_VFS_OLD" | "QFMT_VFS_V0" | "QFMT_VFS_V1"
- if mips && linux =>
- {
- false
- }
- "BOTHER" => false,
- _ => true,
- });
- cfg.skip_struct(|s| s != "termios2");
- cfg.type_name(move |ty, is_struct, is_union| match ty {
- t if is_struct => format!("struct {}", t),
- t if is_union => format!("union {}", t),
- t => t.to_string(),
- });
- } else {
- cfg.skip_const(|_| true);
- cfg.skip_struct(|_| true);
- }
- cfg.generate("../src/lib.rs", "linux_fcntl.rs");
-}
-
-fn main() {
- do_cc();
- do_ctest();
-}
+ // sighandler_t type is super weird
+ (struct_ == "sigaction" && field == "sa_sigaction") ||
+ // sigval is actually a union, but we pretend it's a struct
+ (struct_ == "sigevent" && field == "sigev_value") ||
+ // aio_buf is "volatile void*" and Rust doesn't understand volatile
+ (struct_ == "aiocb" && field == "aio_buf")
+ });
-macro_rules! headers {
- ($cfg:ident: $header:expr) => {
- $cfg.header($header);
- };
- ($cfg:ident: $($header:expr),*) => {
- $(headers!($cfg: $header);)*
- };
- ($cfg:ident: $($header:expr,)*) => {
- $(headers!($cfg: $header);)*
- };
+ cfg.generate("../src/lib.rs", "main.rs");
}
-fn test_apple(target: &str) {
- assert!(target.contains("apple"));
- let x86_64 = target.contains("x86_64");
-
+fn test_dragonflybsd(target: &str) {
+ assert!(target.contains("dragonfly"));
let mut cfg = ctest::TestGenerator::new();
cfg.flag("-Wno-deprecated-declarations");
- cfg.define("__APPLE_USE_RFC_3542", None);
- headers! { cfg:
+ headers! {
+ cfg:
"aio.h",
"ctype.h",
"dirent.h",
@@ -795,31 +945,24 @@ fn test_apple(target: &str) {
"langinfo.h",
"limits.h",
"locale.h",
- "mach-o/dyld.h",
- "mach/mach_time.h",
- "malloc/malloc.h",
- "net/bpf.h",
+ "mqueue.h",
"net/if.h",
"net/if_arp.h",
"net/if_dl.h",
- "net/if_utun.h",
- "net/route.h",
"net/route.h",
"netdb.h",
- "netinet/if_ether.h",
- "netinet/in.h",
"netinet/in.h",
"netinet/ip.h",
"netinet/tcp.h",
"netinet/udp.h",
"poll.h",
"pthread.h",
+ "pthread_np.h",
"pwd.h",
"resolv.h",
"sched.h",
"semaphore.h",
"signal.h",
- "spawn.h",
"stddef.h",
"stdint.h",
"stdio.h",
@@ -828,20 +971,14 @@ fn test_apple(target: &str) {
"sys/event.h",
"sys/file.h",
"sys/ioctl.h",
- "sys/ipc.h",
- "sys/kern_control.h",
"sys/mman.h",
"sys/mount.h",
- "sys/proc_info.h",
"sys/ptrace.h",
- "sys/quota.h",
"sys/resource.h",
- "sys/sem.h",
- "sys/shm.h",
+ "sys/rtprio.h",
"sys/socket.h",
"sys/stat.h",
"sys/statvfs.h",
- "sys/sys_domain.h",
"sys/sysctl.h",
"sys/time.h",
"sys/times.h",
@@ -850,36 +987,117 @@ fn test_apple(target: &str) {
"sys/un.h",
"sys/utsname.h",
"sys/wait.h",
- "sys/xattr.h",
"syslog.h",
"termios.h",
"time.h",
+ "ufs/ufs/quota.h",
"unistd.h",
"util.h",
"utime.h",
"utmpx.h",
"wchar.h",
- "xlocale.h",
}
- if x86_64 {
- headers! { cfg: "crt_externs.h" }
- }
+ cfg.type_name(move |ty, is_struct, is_union| {
+ match ty {
+ // Just pass all these through, no need for a "struct" prefix
+ "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr"
+ | "Elf64_Phdr" | "Elf32_Shdr" | "Elf64_Shdr" | "Elf32_Sym"
+ | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr" | "Elf32_Chdr"
+ | "Elf64_Chdr" => ty.to_string(),
+
+ // FIXME: OSX calls this something else
+ "sighandler_t" => "sig_t".to_string(),
+
+ t if is_union => format!("union {}", t),
+
+ t if t.ends_with("_t") => t.to_string(),
+
+ // put `struct` in front of all structs:.
+ t if is_struct => format!("struct {}", t),
+
+ t => t.to_string(),
+ }
+ });
+
+ cfg.field_name(move |struct_, field| {
+ match field {
+ // Our stat *_nsec fields normally don't actually exist but are part
+ // of a timeval struct
+ s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
+ s.replace("e_nsec", ".tv_nsec")
+ }
+ "u64" if struct_ == "epoll_event" => "data.u64".to_string(),
+ "type_"
+ if struct_ == "input_event"
+ || struct_ == "input_mask"
+ || struct_ == "ff_effect"
+ || struct_ == "rtprio" =>
+ {
+ "type".to_string()
+ }
+ s => s.to_string(),
+ }
+ });
+
+ cfg.skip_type(move |ty| {
+ match ty {
+ // sighandler_t is crazy across platforms
+ "sighandler_t" => true,
+
+ _ => false,
+ }
+ });
cfg.skip_struct(move |ty| {
match ty {
- // FIXME: actually a union
+ // This is actually a union, not a struct
"sigval" => true,
+ // FIXME: These are tested as part of the linux_fcntl tests since
+ // there are header conflicts when including them with all the other
+ // structs.
+ "termios2" => true,
+
+ _ => false,
+ }
+ });
+
+ cfg.skip_signededness(move |c| {
+ match c {
+ "LARGE_INTEGER" | "float" | "double" => true,
+ // uuid_t is a struct, not an integer.
+ "uuid_t" => true,
+ n if n.starts_with("pthread") => true,
+ // sem_t is a struct or pointer
+ "sem_t" => true,
+ // mqd_t is a pointer on DragonFly
+ "mqd_t" => true,
+
_ => false,
}
});
cfg.skip_const(move |name| {
match name {
- // These OSX constants are removed in Sierra.
- // https://developer.apple.com/library/content/releasenotes/General/APIDiffsMacOS10_12/Swift/Darwin.html
- "KERN_KDENABLE_BG_TRACE" | "KERN_KDDISABLE_BG_TRACE" => true,
+ "SIG_DFL" | "SIG_ERR" | "SIG_IGN" => true, // sighandler_t weirdness
+
+ // weird signed extension or something like that?
+ "MS_NOUSER" => true,
+ "MS_RMT_MASK" => true, // updated in glibc 2.22 and musl 1.1.13
+
+ // These are defined for Solaris 11, but the crate is tested on
+ // illumos, where they are currently not defined
+ "EADI"
+ | "PORT_SOURCE_POSTWAIT"
+ | "PORT_SOURCE_SIGNAL"
+ | "PTHREAD_STACK_MIN" => true,
+
+ // These change all the time from release to release of linux
+ // distros, let's just not bother trying to verify them. They
+ // shouldn't be used in code anyway...
+ "AF_MAX" | "PF_MAX" => true,
+
_ => false,
}
});
@@ -887,650 +1105,894 @@ fn test_apple(target: &str) {
cfg.skip_fn(move |name| {
// skip those that are manually verified
match name {
- // FIXME: https://github.com/rust-lang/libc/issues/1272
- "execv" | "execve" | "execvp" => true,
+ "execv" | // crazy stuff with const/mut
+ "execve" |
+ "execvp" |
+ "execvpe" |
+ "fexecve" => true,
- // close calls the close_nocancel system call
- "close" => true,
+ "getrlimit" | "getrlimit64" | // non-int in 1st arg
+ "setrlimit" | "setrlimit64" | // non-int in 1st arg
+ "prlimit" | "prlimit64" | // non-int in 2nd arg
+ // typed 2nd arg on linux
+ "gettimeofday" => true,
_ => false,
}
});
cfg.skip_field_type(move |struct_, field| {
- match (struct_, field) {
- // FIXME: actually a union
- ("sigevent", "sigev_value") => true,
- _ => false,
+ // This is a weird union, don't check the type.
+ (struct_ == "ifaddrs" && field == "ifa_ifu") ||
+ // sighandler_t type is super weird
+ (struct_ == "sigaction" && field == "sa_sigaction") ||
+ // sigval is actually a union, but we pretend it's a struct
+ (struct_ == "sigevent" && field == "sigev_value") ||
+ // aio_buf is "volatile void*" and Rust doesn't understand volatile
+ (struct_ == "aiocb" && field == "aio_buf")
+ });
+
+ cfg.skip_field(move |struct_, field| {
+ // this is actually a union on linux, so we can't represent it well and
+ // just insert some padding.
+ (struct_ == "siginfo_t" && field == "_pad") ||
+ // sigev_notify_thread_id is actually part of a sigev_un union
+ (struct_ == "sigevent" && field == "sigev_notify_thread_id")
+ });
+
+ cfg.generate("../src/lib.rs", "main.rs");
+}
+
+fn test_wasi(target: &str) {
+ assert!(target.contains("wasi"));
+
+ let mut cfg = ctest::TestGenerator::new();
+ cfg.define("_GNU_SOURCE", None);
+
+ headers! { cfg:
+ "ctype.h",
+ "dirent.h",
+ "errno.h",
+ "fcntl.h",
+ "limits.h",
+ "locale.h",
+ "malloc.h",
+ "poll.h",
+ "stdbool.h",
+ "stddef.h",
+ "stdint.h",
+ "stdio.h",
+ "stdlib.h",
+ "string.h",
+ "sys/resource.h",
+ "sys/select.h",
+ "sys/socket.h",
+ "sys/stat.h",
+ "sys/times.h",
+ "sys/types.h",
+ "sys/uio.h",
+ "sys/utsname.h",
+ "time.h",
+ "unistd.h",
+ "wasi/core.h",
+ "wasi/libc.h",
+ "wasi/libc-find-relpath.h",
+ "wchar.h",
+ }
+
+ cfg.type_name(move |ty, is_struct, is_union| match ty {
+ "FILE" | "fd_set" | "DIR" => ty.to_string(),
+ t if is_union => format!("union {}", t),
+ t if t.starts_with("__wasi") && t.ends_with("_u") => {
+ format!("union {}", t)
+ }
+ t if t.starts_with("__wasi") && is_struct => format!("struct {}", t),
+ t if t.ends_with("_t") => t.to_string(),
+ t if is_struct => format!("struct {}", t),
+ t => t.to_string(),
+ });
+
+ cfg.field_name(move |_struct, field| {
+ match field {
+ // deal with fields as rust keywords
+ "type_" => "type".to_string(),
+ s => s.to_string(),
}
});
- cfg.volatile_item(|i| {
- use ctest::VolatileItemKind::*;
- match i {
- StructField(ref n, ref f) if n == "aiocb" && f == "aio_buf" => {
- true
- }
- _ => false,
- }
- });
+ // Looks like LLD doesn't merge duplicate imports, so if the Rust
+ // code imports from a module and the C code also imports from a
+ // module we end up with two imports of function pointers which
+ // import the same thing but have different function pointers
+ cfg.skip_fn_ptrcheck(|f| f.starts_with("__wasi"));
+
+ // d_name is declared as a flexible array in WASI libc, so it
+ // doesn't support sizeof.
+ cfg.skip_field(|s, field| s == "dirent" && field == "d_name");
+
+ cfg.generate("../src/lib.rs", "main.rs");
+}
+
+fn test_android(target: &str) {
+ assert!(target.contains("android"));
+ let target_pointer_width = match target {
+ t if t.contains("aarch64") || t.contains("x86_64") => 64,
+ t if t.contains("i686") || t.contains("arm") => 32,
+ t => panic!("unsupported target: {}", t),
+ };
+ let x86 = target.contains("i686") || target.contains("x86_64");
+
+ let mut cfg = ctest::TestGenerator::new();
+ cfg.define("_GNU_SOURCE", None);
+
+ // FIXME: still necessary?
+ cfg.flag("-Wno-deprecated-declarations");
+
+ // Android doesn't actually have in_port_t but it's much easier if we
+ // provide one for us to test against
+ // FIXME: still necessary?
+ cfg.define("in_port_t", Some("uint16_t"));
+
+ headers! { cfg:
+ "arpa/inet.h",
+ "asm/mman.h",
+ "ctype.h",
+ "dirent.h",
+ "dlfcn.h",
+ "errno.h",
+ "fcntl.h",
+ "grp.h",
+ "ifaddrs.h",
+ "limits.h",
+ "linux/dccp.h",
+ "linux/fs.h",
+ "linux/genetlink.h",
+ "linux/if_alg.h",
+ "linux/if_ether.h",
+ "linux/if_tun.h",
+ "linux/magic.h",
+ "linux/memfd.h",
+ "linux/module.h",
+ "linux/net_tstamp.h",
+ "linux/netfilter/nf_tables.h",
+ "linux/netfilter_ipv4.h",
+ "linux/netfilter_ipv6.h",
+ "linux/netlink.h",
+ "linux/quota.h",
+ "linux/reboot.h",
+ "linux/seccomp.h",
+ "linux/sockios.h",
+ "locale.h",
+ "malloc.h",
+ "net/ethernet.h",
+ "net/if.h",
+ "net/if_arp.h",
+ "net/route.h",
+ "netdb.h",
+ "netinet/in.h",
+ "netinet/ip.h",
+ "netinet/tcp.h",
+ "netinet/udp.h",
+ "netpacket/packet.h",
+ "poll.h",
+ "pthread.h",
+ "pty.h",
+ "pwd.h",
+ "resolv.h",
+ "sched.h",
+ "semaphore.h",
+ "signal.h",
+ "stddef.h",
+ "stdint.h",
+ "stdio.h",
+ "stdlib.h",
+ "string.h",
+ "sys/epoll.h",
+ "sys/eventfd.h",
+ "sys/file.h",
+ "sys/fsuid.h",
+ "sys/inotify.h",
+ "sys/ioctl.h",
+ "sys/mman.h",
+ "sys/mount.h",
+ "sys/personality.h",
+ "sys/prctl.h",
+ "sys/ptrace.h",
+ "sys/reboot.h",
+ "sys/resource.h",
+ "sys/sendfile.h",
+ "sys/signalfd.h",
+ "sys/socket.h",
+ "sys/stat.h",
+ "sys/statvfs.h",
+ "sys/swap.h",
+ "sys/syscall.h",
+ "sys/sysinfo.h",
+ "sys/time.h",
+ "sys/times.h",
+ "sys/types.h",
+ "sys/uio.h",
+ "sys/un.h",
+ "sys/utsname.h",
+ "sys/vfs.h",
+ "sys/wait.h",
+ "syslog.h",
+ "termios.h",
+ "time.h",
+ "unistd.h",
+ "utime.h",
+ "utmp.h",
+ "wchar.h",
+ "xlocale.h",
+ }
+
+ if target_pointer_width == 32 {
+ // time64_t is not defined for 64-bit targets If included it will
+ // generate the error 'Your time_t is already 64-bit'
+ cfg.header("time64.h");
+ }
+ if x86 {
+ cfg.header("sys/reg.h");
+ }
cfg.type_name(move |ty, is_struct, is_union| {
match ty {
// Just pass all these through, no need for a "struct" prefix
- "FILE" | "DIR" | "Dl_info" => ty.to_string(),
-
- // OSX calls this something else
- "sighandler_t" => "sig_t".to_string(),
+ // FIXME: still required ?
+ "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr"
+ | "Elf64_Phdr" | "Elf32_Shdr" | "Elf64_Shdr" | "Elf32_Sym"
+ | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr" | "Elf32_Chdr"
+ | "Elf64_Chdr" => ty.to_string(),
t if is_union => format!("union {}", t),
+
t if t.ends_with("_t") => t.to_string(),
+
+ // put `struct` in front of all structs:.
t if is_struct => format!("struct {}", t),
+
t => t.to_string(),
}
});
cfg.field_name(move |struct_, field| {
match field {
+ // Our stat *_nsec fields normally don't actually exist but are part
+ // of a timeval struct
s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
- s.replace("e_nsec", "espec.tv_nsec")
- }
- // FIXME: sigaction actually contains a union with two variants:
- // a sa_sigaction with type: (*)(int, struct __siginfo *, void *)
- // a sa_handler with type sig_t
- "sa_sigaction" if struct_ == "sigaction" => {
- "sa_handler".to_string()
+ s.to_string()
}
+ // FIXME: still necessary?
+ "u64" if struct_ == "epoll_event" => "data.u64".to_string(),
s => s.to_string(),
}
});
- cfg.generate("../src/lib.rs", "main.rs");
-}
-
-fn test_openbsd(target: &str) {
- assert!(target.contains("openbsd"));
-
- let mut cfg = ctest::TestGenerator::new();
- cfg.flag("-Wno-deprecated-declarations");
-
- headers! { cfg:
- "errno.h",
- "fcntl.h",
- "limits.h",
- "locale.h",
- "stddef.h",
- "stdint.h",
- "stdio.h",
- "stdlib.h",
- "sys/stat.h",
- "sys/types.h",
- "time.h",
- "wchar.h",
- "ctype.h",
- "dirent.h",
- "sys/socket.h",
- "net/if.h",
- "net/route.h",
- "net/if_arp.h",
- "netdb.h",
- "netinet/in.h",
- "netinet/ip.h",
- "netinet/tcp.h",
- "netinet/udp.h",
- "resolv.h",
- "pthread.h",
- "dlfcn.h",
- "signal.h",
- "string.h",
- "sys/file.h",
- "sys/ioctl.h",
- "sys/mman.h",
- "sys/resource.h",
- "sys/socket.h",
- "sys/time.h",
- "sys/un.h",
- "sys/wait.h",
- "unistd.h",
- "utime.h",
- "pwd.h",
- "grp.h",
- "sys/utsname.h",
- "sys/ptrace.h",
- "sys/mount.h",
- "sys/uio.h",
- "sched.h",
- "termios.h",
- "poll.h",
- "syslog.h",
- "semaphore.h",
- "sys/statvfs.h",
- "sys/times.h",
- "glob.h",
- "ifaddrs.h",
- "langinfo.h",
- "sys/sysctl.h",
- "utmp.h",
- "sys/event.h",
- "net/if_dl.h",
- "util.h",
- "ufs/ufs/quota.h",
- "pthread_np.h",
- "sys/syscall.h",
- }
+ cfg.skip_type(move |ty| {
+ match ty {
+ // sighandler_t is crazy across platforms
+ // FIXME: still necessary?
+ "sighandler_t" => true,
+ _ => false,
+ }
+ });
cfg.skip_struct(move |ty| {
match ty {
- // FIXME: actually a union
+ // This is actually a union, not a struct
+ // FIXME: still necessary
"sigval" => true,
+ // These structs have changed since unified headers in NDK r14b.
+ // `st_atime` and `st_atime_nsec` have changed sign.
+ // FIXME: unskip it for next major release
+ "stat" | "stat64" => true,
+
+ // These are tested as part of the linux_fcntl tests since there are
+ // header conflicts when including them with all the other structs.
+ // FIXME: still necessary
+ "termios2" => true,
+
+ _ => false,
+ }
+ });
+
+ cfg.skip_signededness(move |c| {
+ match c {
+ // FIXME: still necessary?
+ "LARGE_INTEGER" | "float" | "double" => true,
+ // FIXME: still necessary?
+ n if n.starts_with("pthread") => true,
_ => false,
}
});
cfg.skip_const(move |name| {
match name {
- // Removed in OpenBSD 6.0
- "KERN_USERMOUNT" | "KERN_ARND" => true,
+ // FIXME: still necessary?
+ "SIG_DFL" | "SIG_ERR" | "SIG_IGN" => true, // sighandler_t weirdness
+ // FIXME: still necessary?
+ "SIGUNUSED" => true, // removed in glibc 2.26
+
+ // weird signed extension or something like that?
+ // FIXME: still necessary?
+ "MS_NOUSER" => true,
+ // FIXME: still necessary?
+ "MS_RMT_MASK" => true, // updated in glibc 2.22 and musl 1.1.13
+
+ // Android uses old kernel headers
+ // These are constants used in getrandom syscall
+ // FIXME: still necessary?
+ "GRND_NONBLOCK" | "GRND_RANDOM" => true,
+
+ // Defined by libattr not libc on linux (hard to test).
+ // See constant definition for more details.
+ // FIXME: still necessary?
+ "ENOATTR" => true,
+
+ // FIXME: still necessary?
+ "BOTHER" => true,
+
+ // MFD_HUGETLB is not available in some older libc versions on the CI builders. On the
+ // x86_64 and i686 builders it seems to be available for all targets, so at least test
+ // it there.
+ // FIXME: still necessary?
+ "MFD_HUGETLB" => true,
+
+ // These change all the time from release to release of linux
+ // distros, let's just not bother trying to verify them. They
+ // shouldn't be used in code anyway...
+ // FIXME: still necessary?
+ "AF_MAX" | "PF_MAX" => true,
+
_ => false,
}
});
cfg.skip_fn(move |name| {
+ // skip those that are manually verified
match name {
- "execv" | "execve" | "execvp" | "execvpe" => true,
+ // FIXME: still necessary?
+ "execv" | // crazy stuff with const/mut
+ "execve" |
+ "execvp" |
+ "execvpe" |
+ "fexecve" => true,
- // typed 2nd arg
+ // typed 2nd arg on android
+ // FIXME: still necessary?
"gettimeofday" => true,
- // Removed in OpenBSD 6.5
- // https://marc.info/?l=openbsd-cvs&m=154723400730318
- "mincore" => true,
+ // not declared in newer android toolchains
+ // FIXME: still necessary?
+ "getdtablesize" => true,
- _ => false,
- }
- });
+ // FIXME: still necessary?
+ "dlerror" => true, // const-ness is added
- cfg.type_name(move |ty, is_struct, is_union| {
- match ty {
- // Just pass all these through, no need for a "struct" prefix
- "FILE" | "DIR" | "Dl_info" => ty.to_string(),
+ // Apparently the NDK doesn't have this defined on android, but
+ // it's in a header file?
+ // FIXME: still necessary?
+ "endpwent" => true,
- // OSX calls this something else
- "sighandler_t" => "sig_t".to_string(),
+ // Apparently res_init exists on Android, but isn't defined in a header:
+ // https://mail.gnome.org/archives/commits-list/2013-May/msg01329.html
+ // FIXME: still necessary?
+ "res_init" => true,
- t if is_union => format!("union {}", t),
- t if t.ends_with("_t") => t.to_string(),
- t if is_struct => format!("struct {}", t),
- t => t.to_string(),
+ // Definition of those functions as changed since unified headers from NDK r14b
+ // These changes imply some API breaking changes but are still ABI compatible.
+ // We can wait for the next major release to be compliant with the new API.
+ // FIXME: unskip these for next major release
+ "strerror_r" | "madvise" | "msync" | "mprotect" | "recvfrom" | "getpriority" |
+ "setpriority" | "personality" => true,
+ // In Android 64 bits, these functions have been fixed since unified headers.
+ // Ignore these until next major version.
+ "bind" | "writev" | "readv" | "sendmsg" | "recvmsg"
+ if target_pointer_width == 64 => true,
+
+ _ => false,
}
});
- cfg.field_name(move |struct_, field| match field {
- "st_birthtime" if struct_.starts_with("stat") => {
- "__st_birthtime".to_string()
- }
- "st_birthtime_nsec" if struct_.starts_with("stat") => {
- "__st_birthtimensec".to_string()
- }
- s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
- s.replace("e_nsec", ".tv_nsec")
+ cfg.skip_static(move |name| {
+ match name {
+ // Internal constant, not declared in any headers.
+ // FIXME: still necessary
+ "__progname" => true,
+ _ => false,
}
- "sa_sigaction" if struct_ == "sigaction" => "sa_handler".to_string(),
- s => s.to_string(),
});
+ // FIXME: still necessary?
cfg.skip_field_type(move |struct_, field| {
- // type siginfo_t.si_addr changed from OpenBSD 6.0 to 6.1
- (struct_ == "siginfo_t" && field == "si_addr")
+ // This is a weird union, don't check the type.
+ (struct_ == "ifaddrs" && field == "ifa_ifu") ||
+ // sighandler_t type is super weird
+ (struct_ == "sigaction" && field == "sa_sigaction") ||
+ // sigval is actually a union, but we pretend it's a struct
+ (struct_ == "sigevent" && field == "sigev_value") ||
+ // aio_buf is "volatile void*" and Rust doesn't understand volatile
+ (struct_ == "aiocb" && field == "aio_buf")
+ });
+
+ // FIXME: still necessary?
+ cfg.skip_field(move |struct_, field| {
+ // this is actually a union on linux, so we can't represent it well and
+ // just insert some padding.
+ (struct_ == "siginfo_t" && field == "_pad") ||
+ // sigev_notify_thread_id is actually part of a sigev_un union
+ (struct_ == "sigevent" && field == "sigev_notify_thread_id") ||
+ // signalfd had SIGSYS fields added in Linux 4.18, but no libc release has them yet.
+ (struct_ == "signalfd_siginfo" && (field == "ssi_addr_lsb" ||
+ field == "_pad2" ||
+ field == "ssi_syscall" ||
+ field == "ssi_call_addr" ||
+ field == "ssi_arch"))
+ });
+
+ // FIXME: remove
+ cfg.fn_cname(move |name, _cname| name.to_string());
+
+ cfg.generate("../src/lib.rs", "main.rs");
+
+ // On Android also generate another script for testing linux/fcntl
+ // declarations. These cannot be tested normally because including both
+ // `linux/fcntl.h` and `fcntl.h` fails.
+ //
+ // FIXME: is still necessary?
+ let mut cfg = ctest::TestGenerator::new();
+ cfg.skip_type(|_| true)
+ .skip_fn(|_| true)
+ .skip_static(|_| true);
+ cfg.header("linux/fcntl.h");
+ cfg.header("net/if.h");
+ cfg.header("linux/if.h");
+ cfg.header("linux/quota.h");
+ cfg.header("asm/termbits.h");
+ cfg.skip_const(move |name| match name {
+ "F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS" => false,
+ "F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW" | "F_SEAL_WRITE" => {
+ false
+ }
+ "BOTHER" => false,
+ _ => true,
+ });
+ cfg.skip_struct(|s| s != "termios2");
+ cfg.type_name(move |ty, is_struct, is_union| match ty {
+ t if is_struct => format!("struct {}", t),
+ t if is_union => format!("union {}", t),
+ t => t.to_string(),
});
-
- cfg.generate("../src/lib.rs", "main.rs");
+ cfg.generate("../src/lib.rs", "linux_fcntl.rs");
}
-fn test_windows(target: &str) {
- assert!(target.contains("windows"));
- let gnu = target.contains("gnu");
+fn test_freebsd(target: &str) {
+ assert!(target.contains("freebsd"));
+ let x86 = target.contains("i686") || target.contains("x86_64");
let mut cfg = ctest::TestGenerator::new();
- cfg.define("_WIN32_WINNT", Some("0x8000"));
+ // Required for `getline`:
+ cfg.define("_WITH_GETLINE", None);
headers! { cfg:
- "direct.h",
- "errno.h",
- "fcntl.h",
- "io.h",
- "limits.h",
- "locale.h",
- "process.h",
- "signal.h",
- "stddef.h",
- "stdint.h",
- "stdio.h",
- "stdlib.h",
- "sys/stat.h",
- "sys/types.h",
- "sys/utime.h",
- "time.h",
- "wchar.h",
- }
-
- if gnu {
- headers! { cfg: "ws2tcpip.h" }
- } else {
- headers! { cfg: "Winsock2.h" };
+ "aio.h",
+ "arpa/inet.h",
+ "ctype.h",
+ "dirent.h",
+ "dlfcn.h",
+ "errno.h",
+ "fcntl.h",
+ "glob.h",
+ "grp.h",
+ "ifaddrs.h",
+ "langinfo.h",
+ "libutil.h",
+ "limits.h",
+ "locale.h",
+ "mqueue.h",
+ "net/bpf.h",
+ "net/if.h",
+ "net/if_arp.h",
+ "net/if_dl.h",
+ "net/route.h",
+ "netdb.h",
+ "netinet/ip.h",
+ "netinet/in.h",
+ "netinet/tcp.h",
+ "netinet/udp.h",
+ "poll.h",
+ "pthread.h",
+ "pthread_np.h",
+ "pwd.h",
+ "resolv.h",
+ "sched.h",
+ "semaphore.h",
+ "signal.h",
+ "spawn.h",
+ "stddef.h",
+ "stdint.h",
+ "stdio.h",
+ "stdlib.h",
+ "string.h",
+ "sys/event.h",
+ "sys/extattr.h",
+ "sys/file.h",
+ "sys/ioctl.h",
+ "sys/ipc.h",
+ "sys/jail.h",
+ "sys/mman.h",
+ "sys/mount.h",
+ "sys/msg.h",
+ "sys/procdesc.h",
+ "sys/ptrace.h",
+ "sys/resource.h",
+ "sys/rtprio.h",
+ "sys/shm.h",
+ "sys/socket.h",
+ "sys/stat.h",
+ "sys/statvfs.h",
+ "sys/sysctl.h",
+ "sys/time.h",
+ "sys/times.h",
+ "sys/types.h",
+ "sys/uio.h",
+ "sys/un.h",
+ "sys/utsname.h",
+ "sys/wait.h",
+ "syslog.h",
+ "termios.h",
+ "time.h",
+ "ufs/ufs/quota.h",
+ "unistd.h",
+ "utime.h",
+ "utmpx.h",
+ "wchar.h",
}
cfg.type_name(move |ty, is_struct, is_union| {
match ty {
// Just pass all these through, no need for a "struct" prefix
- "FILE" | "DIR" | "Dl_info" => ty.to_string(),
-
- // FIXME: these don't exist:
- "time64_t" => "__time64_t".to_string(),
- "ssize_t" => "SSIZE_T".to_string(),
+ // FIXME: still required?
+ "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr"
+ | "Elf64_Phdr" | "Elf32_Shdr" | "Elf64_Shdr" | "Elf32_Sym"
+ | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr" | "Elf32_Chdr"
+ | "Elf64_Chdr" => ty.to_string(),
- "sighandler_t" if !gnu => "_crt_signal_t".to_string(),
- "sighandler_t" if gnu => "__p_sig_fn_t".to_string(),
+ // FIXME: still required?
+ "sighandler_t" => "sig_t".to_string(),
t if is_union => format!("union {}", t),
+
t if t.ends_with("_t") => t.to_string(),
- // Windows uppercase structs don't have `struct` in front:
- t if is_struct => {
- if ty.clone().chars().next().unwrap().is_uppercase() {
- t.to_string()
- } else if t == "stat" {
- "struct __stat64".to_string()
- } else if t == "utimbuf" {
- "struct __utimbuf64".to_string()
- } else {
- // put `struct` in front of all structs:
- format!("struct {}", t)
- }
- }
+ // put `struct` in front of all structs:.
+ t if is_struct => format!("struct {}", t),
+
t => t.to_string(),
}
});
- cfg.fn_cname(move |name, cname| cname.unwrap_or(name).to_string());
-
- cfg.skip_type(move |name| match name {
- "SSIZE_T" if !gnu => true,
- "ssize_t" if !gnu => true,
- _ => false,
- });
-
- cfg.skip_const(move |name| {
- match name {
- // FIXME: API error:
- // SIG_ERR type is "void (*)(int)", not "int"
- "SIG_ERR" => true,
- _ => false,
+ cfg.field_name(move |struct_, field| {
+ match field {
+ // Our stat *_nsec fields normally don't actually exist but are part
+ // of a timeval struct
+ s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
+ s.replace("e_nsec", ".tv_nsec")
+ }
+ // FIXME: still required?
+ "u64" if struct_ == "epoll_event" => "data.u64".to_string(),
+ // FIXME: still required?
+ "type_"
+ if struct_ == "input_event"
+ || struct_ == "input_mask"
+ || struct_ == "ff_effect"
+ || struct_ == "rtprio" =>
+ {
+ "type".to_string()
+ }
+ s => s.to_string(),
}
});
- // FIXME: All functions point to the wrong addresses?
- cfg.skip_fn_ptrcheck(|_| true);
+ cfg.skip_type(move |ty| {
+ match ty {
+ // sighandler_t is crazy across platforms
+ // FIXME: still required?
+ "sighandler_t" => true,
- cfg.skip_signededness(move |c| {
- match c {
- // windows-isms
- n if n.starts_with("P") => true,
- n if n.starts_with("H") => true,
- n if n.starts_with("LP") => true,
- "sighandler_t" if gnu => true,
_ => false,
}
});
- cfg.skip_fn(move |name| {
- match name {
- // FIXME: API error:
- "execv" | "execve" | "execvp" | "execvpe" => true,
+ cfg.skip_struct(move |ty| {
+ match ty {
+ // This is actually a union, not a struct
+ // FIXME: still required?
+ "sigval" => true,
+
+ // These are tested as part of the linux_fcntl tests since there are
+ // header conflicts when including them with all the other structs.
+ // FIXME: still required?
+ "termios2" => true,
_ => false,
}
});
- cfg.generate("../src/lib.rs", "main.rs");
-}
-
-fn test_redox(target: &str) {
- assert!(target.contains("redox"));
-
- let mut cfg = ctest::TestGenerator::new();
- cfg.flag("-Wno-deprecated-declarations");
-
- headers! {
- cfg:
- "ctype.h",
- "dirent.h",
- "dlfcn.h",
- "errno.h",
- "execinfo.h",
- "fcntl.h",
- "glob.h",
- "grp.h",
- "ifaddrs.h",
- "langinfo.h",
- "limits.h",
- "locale.h",
- "net/if.h",
- "net/if_arp.h",
- "net/route.h",
- "netdb.h",
- "netinet/in.h",
- "netinet/ip.h",
- "netinet/tcp.h",
- "netinet/udp.h",
- "poll.h",
- "pthread.h",
- "pwd.h",
- "resolv.h",
- "sched.h",
- "semaphore.h",
- "string.h",
- "strings.h",
- "sys/file.h",
- "sys/ioctl.h",
- "sys/mman.h",
- "sys/mount.h",
- "sys/ptrace.h",
- "sys/quota.h",
- "sys/resource.h",
- "sys/socket.h",
- "sys/stat.h",
- "sys/statvfs.h",
- "sys/sysctl.h",
- "sys/time.h",
- "sys/times.h",
- "sys/types.h",
- "sys/uio.h",
- "sys/un.h",
- "sys/utsname.h",
- "sys/wait.h",
- "syslog.h",
- "termios.h",
- "time.h",
- "unistd.h",
- "utime.h",
- "utmpx.h",
- "wchar.h",
- }
-
- cfg.generate("../src/lib.rs", "main.rs");
-}
-
-fn test_cloudabi(target: &str) {
- assert!(target.contains("cloudabi"));
-
- let mut cfg = ctest::TestGenerator::new();
- cfg.flag("-Wno-deprecated-declarations");
-
- headers! {
- cfg:
- "execinfo.h",
- "glob.h",
- "ifaddrs.h",
- "langinfo.h",
- "sys/ptrace.h",
- "sys/quota.h",
- "sys/sysctl.h",
- "utmpx.h",
- "ctype.h",
- "dirent.h",
- "dlfcn.h",
- "errno.h",
- "fcntl.h",
- "grp.h",
- "limits.h",
- "locale.h",
- "net/if.h",
- "net/if_arp.h",
- "net/route.h",
- "netdb.h",
- "netinet/in.h",
- "netinet/ip.h",
- "netinet/tcp.h",
- "netinet/udp.h",
- "poll.h",
- "pthread.h",
- "pwd.h",
- "resolv.h",
- "sched.h",
- "semaphore.h",
- "signal.h",
- "stddef.h",
- "stdint.h",
- "stdio.h",
- "stdlib.h",
- "string.h",
- "strings.h",
- "sys/file.h",
- "sys/ioctl.h",
- "sys/mman.h",
- "sys/mount.h",
- "sys/resource.h",
- "sys/socket.h",
- "sys/stat.h",
- "sys/statvfs.h",
- "sys/time.h",
- "sys/times.h",
- "sys/types.h",
- "sys/uio.h",
- "sys/un.h",
- "sys/utsname.h",
- "sys/wait.h",
- "syslog.h",
- "termios.h",
- "time.h",
- "unistd.h",
- "utime.h",
- "wchar.h",
- }
+ cfg.skip_signededness(move |c| {
+ match c {
+ // FIXME: still required?
+ "LARGE_INTEGER" | "float" | "double" => true,
+ // FIXME: still required?
+ n if n.starts_with("pthread") => true,
+ // sem_t is a struct or pointer
+ // FIXME: still required?
+ "sem_t" => true,
+ // mqd_t is a pointer on FreeBSD
+ // FIXME: still required?
+ "mqd_t" => true,
- cfg.generate("../src/lib.rs", "main.rs");
-}
+ _ => false,
+ }
+ });
-fn test_solaris(target: &str) {
- assert!(target.contains("solaris"));
+ cfg.skip_const(move |name| {
+ match name {
+ // FIXME: still required?
+ "SIG_DFL" | "SIG_ERR" | "SIG_IGN" => true, // sighandler_t weirdness
+ // FIXME: still required?
+ "SIGUNUSED" => true, // removed in glibc 2.26
- let mut cfg = ctest::TestGenerator::new();
- cfg.flag("-Wno-deprecated-declarations");
+ // weird signed extension or something like that?
+ // FIXME: still required?
+ "MS_NOUSER" => true,
+ // FIXME: still required?
+ "MS_RMT_MASK" => true, // updated in glibc 2.22 and musl 1.1.13
- cfg.define("_XOPEN_SOURCE", Some("700"));
- cfg.define("__EXTENSIONS__", None);
- cfg.define("_LCONV_C99", None);
+ // These constants were removed in FreeBSD 11 (svn r273250) but will
+ // still be accepted and ignored at runtime.
+ "MAP_RENAME" | "MAP_NORESERVE" => true,
- headers! {
- cfg:
- "ctype.h",
- "dirent.h",
- "dlfcn.h",
- "errno.h",
- "execinfo.h",
- "fcntl.h",
- "glob.h",
- "grp.h",
- "ifaddrs.h",
- "langinfo.h",
- "limits.h",
- "locale.h",
- "net/if.h",
- "net/if_arp.h",
- "net/route.h",
- "netdb.h",
- "netinet/in.h",
- "netinet/ip.h",
- "netinet/tcp.h",
- "netinet/udp.h",
- "poll.h",
- "port.h",
- "pthread.h",
- "pwd.h",
- "resolv.h",
- "sched.h",
- "semaphore.h",
- "signal.h",
- "stddef.h",
- "stdint.h",
- "stdio.h",
- "stdlib.h",
- "string.h",
- "sys/epoll.h",
- "sys/file.h",
- "sys/filio.h",
- "sys/ioctl.h",
- "sys/loadavg.h",
- "sys/mman.h",
- "sys/mount.h",
- "sys/resource.h",
- "sys/socket.h",
- "sys/stat.h",
- "sys/statvfs.h",
- "sys/time.h",
- "sys/times.h",
- "sys/types.h",
- "sys/uio.h",
- "sys/un.h",
- "sys/utsname.h",
- "sys/wait.h",
- "syslog.h",
- "termios.h",
- "time.h",
- "ucontext.h",
- "unistd.h",
- "utime.h",
- "utmpx.h",
- "wchar.h",
- }
+ // These constants were removed in FreeBSD 11 (svn r262489),
+ // and they've never had any legitimate use outside of the
+ // base system anyway.
+ "CTL_MAXID" | "KERN_MAXID" | "HW_MAXID" | "NET_MAXID"
+ | "USER_MAXID" => true,
- cfg.skip_const(move |name| match name {
- "DT_FIFO" | "DT_CHR" | "DT_DIR" | "DT_BLK" | "DT_REG" | "DT_LNK"
- | "DT_SOCK" | "USRQUOTA" | "GRPQUOTA" | "PRIO_MIN" | "PRIO_MAX" => {
- true
- }
+ // These constants were added in FreeBSD 11
+ // FIXME: still required?
+ "EVFILT_PROCDESC" | "EVFILT_SENDFILE" | "EVFILT_EMPTY"
+ | "PD_CLOEXEC" | "PD_ALLOWED_AT_FORK" => true,
- _ => false,
+ // These constants were added in FreeBSD 12
+ // FIXME: still required?
+ "SF_USER_READAHEAD" | "SO_REUSEPORT_LB" => true,
+
+ // These constants are tested in a separate test program generated
+ // below because there are header conflicts if we try to include the
+ // headers that define them here.
+ // FIXME: still required?
+ "F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS" => true,
+ // FIXME: still required?
+ "F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW"
+ | "F_SEAL_WRITE" => true,
+ // FIXME: still required?
+ "BOTHER" => true,
+
+ // MFD_HUGETLB is not available in some older libc versions on the
+ // CI builders. On the x86_64 and i686 builders it seems to be
+ // available for all targets, so at least test it there.
+ // FIXME: still required?
+ "MFD_HUGETLB" if !x86 => true,
+
+ // These change all the time from release to release of linux
+ // distros, let's just not bother trying to verify them. They
+ // shouldn't be used in code anyway...
+ // FIXME: still required?
+ "AF_MAX" | "PF_MAX" => true,
+
+ // FreeBSD 12 required, but CI has FreeBSD 11.
+ // FIXME: still required?
+ "IP_ORIGDSTADDR"
+ | "IP_RECVORIGDSTADDR"
+ | "IPV6_ORIGDSTADDR"
+ | "IPV6_RECVORIGDSTADDR" => true,
+
+ _ => false,
+ }
});
cfg.skip_fn(move |name| {
// skip those that are manually verified
match name {
- // const-ness only added recently
- "dladdr" => true,
+ // FIXME: still required?
+ "execv" | // crazy stuff with const/mut
+ "execve" |
+ "execvp" |
+ "execvpe" |
+ "fexecve" => true,
- // Definition of those functions as changed since unified headers
- // from NDK r14b These changes imply some API breaking changes but
- // are still ABI compatible. We can wait for the next major release
- // to be compliant with the new API.
- //
- // FIXME: unskip these for next major release
- "setpriority" | "personality" => true,
+ // FIXME: for some reason, our signature is wrong
+ "gettimeofday" => true,
- // signal is defined with sighandler_t, so ignore
- "signal" => true,
+ // The `uname` function in freebsd is now an inline wrapper that
+ // delegates to another, but the symbol still exists, so don't check
+ // the symbol.
+ // FIXME: still required?
+ "uname" => true,
- "cfmakeraw" | "cfsetspeed" => true,
+ // FIXME: need to upgrade FreeBSD version; see https://github.com/rust-lang/libc/issues/938
+ // FIXME: still required?
+ "setgrent" => true,
- // FIXME: mincore is defined with caddr_t on Solaris.
- "mincore" => true,
+ // aio_waitcomplete's return type changed between FreeBSD 10 and 11.
+ // FIXME: still required?
+ "aio_waitcomplete" => true,
+
+ // lio_listio confuses the checker, probably because one of its
+ // arguments is an array
+ // FIXME: still required?
+ "lio_listio" => true,
+
+ // Definition of those functions as changed since unified headers from NDK r14b
+ // These changes imply some API breaking changes but are still ABI compatible.
+ // We can wait for the next major release to be compliant with the new API.
+ // FIXME: unskip these for next major release
+ // FIXME: still required ?
+ "strerror_r" | "madvise" | "msync" | "mprotect" | "recvfrom" | "getpriority" |
_ => false,
}
});
+ cfg.skip_field_type(move |struct_, field| {
+ // This is a weird union, don't check the type.
+ // FIXME: still required?
+ (struct_ == "ifaddrs" && field == "ifa_ifu") ||
+ // FIXME: still required?
+ // sighandler_t type is super weird
+ (struct_ == "sigaction" && field == "sa_sigaction") ||
+ // FIXME: still required?
+ // sigval is actually a union, but we pretend it's a struct
+ (struct_ == "sigevent" && field == "sigev_value") ||
+ // aio_buf is "volatile void*" and Rust doesn't understand volatile
+ // FIXME: still required?
+ (struct_ == "aiocb" && field == "aio_buf") ||
+ // stack_t.ss_sp's type changed from FreeBSD 10 to 11 in svn r294930
+ // FIXME: still required?
+ (struct_ == "stack_t" && field == "ss_sp")
+ });
+
+ cfg.skip_field(move |struct_, field| {
+ // this is actually a union on linux, so we can't represent it well and
+ // just insert some padding.
+ // FIXME: still required?
+ (struct_ == "siginfo_t" && field == "_pad") ||
+ // sigev_notify_thread_id is actually part of a sigev_un union
+ // FIXME: still required?
+ (struct_ == "sigevent" && field == "sigev_notify_thread_id") ||
+ // signalfd had SIGSYS fields added in Linux 4.18, but no libc release has them yet.
+ // FIXME: still required?
+ (struct_ == "signalfd_siginfo" && (field == "ssi_addr_lsb" ||
+ field == "_pad2" ||
+ field == "ssi_syscall" ||
+ field == "ssi_call_addr" ||
+ field == "ssi_arch"))
+ });
+
+ // FIXME: remove
+ cfg.fn_cname(move |name, _cname| name.to_string());
+
cfg.generate("../src/lib.rs", "main.rs");
}
-fn test_netbsd(target: &str) {
- assert!(target.contains("netbsd"));
- let rumprun = target.contains("rumprun");
+fn test_emscripten(target: &str) {
+ assert!(target.contains("emscripten"));
+
let mut cfg = ctest::TestGenerator::new();
+ // FIXME: still necessary?
+ cfg.define("_GNU_SOURCE", None);
+ // FIXME: still necessary?
cfg.flag("-Wno-deprecated-declarations");
- cfg.define("_NETBSD_SOURCE", Some("1"));
- headers! {
- cfg:
- "errno.h",
- "fcntl.h",
- "limits.h",
- "locale.h",
- "stddef.h",
- "stdint.h",
- "stdio.h",
- "stdlib.h",
- "sys/stat.h",
- "sys/types.h",
- "time.h",
- "wchar.h",
- "aio.h",
- "ctype.h",
- "dirent.h",
- "dlfcn.h",
- "glob.h",
- "grp.h",
- "ifaddrs.h",
- "langinfo.h",
- "net/if.h",
- "net/if_arp.h",
- "net/if_dl.h",
- "net/route.h",
- "netdb.h",
- "netinet/in.h",
- "netinet/ip.h",
- "netinet/tcp.h",
- "netinet/udp.h",
- "poll.h",
- "pthread.h",
- "pwd.h",
- "resolv.h",
- "sched.h",
- "semaphore.h",
- "signal.h",
- "string.h",
- "sys/extattr.h",
- "sys/file.h",
- "sys/ioctl.h",
- "sys/ioctl_compat.h",
- "sys/mman.h",
- "sys/mount.h",
- "sys/ptrace.h",
- "sys/resource.h",
- "sys/socket.h",
- "sys/statvfs.h",
- "sys/sysctl.h",
- "sys/time.h",
- "sys/times.h",
- "sys/uio.h",
- "sys/un.h",
- "sys/utsname.h",
- "sys/wait.h",
- "syslog.h",
- "termios.h",
- "ufs/ufs/quota.h",
- "ufs/ufs/quota1.h",
- "unistd.h",
- "util.h",
- "utime.h",
- "mqueue.h",
- "netinet/dccp.h",
- "sys/event.h",
- "sys/quota.h",
+ headers! { cfg:
+ "aio.h",
+ "ctype.h",
+ "dirent.h",
+ "dlfcn.h",
+ "errno.h",
+ "fcntl.h",
+ "glob.h",
+ "grp.h",
+ "ifaddrs.h",
+ "langinfo.h",
+ "limits.h",
+ "locale.h",
+ "malloc.h",
+ "mntent.h",
+ "mqueue.h",
+ "net/ethernet.h",
+ "net/if.h",
+ "net/if_arp.h",
+ "net/route.h",
+ "netdb.h",
+ "netinet/in.h",
+ "netinet/ip.h",
+ "netinet/tcp.h",
+ "netinet/udp.h",
+ "netpacket/packet.h",
+ "poll.h",
+ "pthread.h",
+ "pty.h",
+ "pwd.h",
+ "resolv.h",
+ "sched.h",
+ "sched.h",
+ "semaphore.h",
+ "shadow.h",
+ "signal.h",
+ "stddef.h",
+ "stdint.h",
+ "stdio.h",
+ "stdlib.h",
+ "string.h",
+ "sys/epoll.h",
+ "sys/eventfd.h",
+ "sys/file.h",
+ "sys/ioctl.h",
+ "sys/ipc.h",
+ "sys/mman.h",
+ "sys/mount.h",
+ "sys/msg.h",
+ "sys/personality.h",
+ "sys/prctl.h",
+ "sys/ptrace.h",
+ "sys/quota.h",
+ "sys/reboot.h",
+ "sys/resource.h",
+ "sys/sem.h",
+ "sys/sendfile.h",
+ "sys/shm.h",
+ "sys/signalfd.h",
+ "sys/socket.h",
+ "sys/stat.h",
+ "sys/statvfs.h",
+ "sys/swap.h",
+ "sys/syscall.h",
+ "sys/sysctl.h",
+ "sys/sysinfo.h",
+ "sys/time.h",
+ "sys/timerfd.h",
+ "sys/times.h",
+ "sys/types.h",
+ "sys/uio.h",
+ "sys/un.h",
+ "sys/user.h",
+ "sys/utsname.h",
+ "sys/vfs.h",
+ "sys/wait.h",
+ "sys/xattr.h",
+ "syslog.h",
+ "termios.h",
+ "time.h",
+ "ucontext.h",
+ "unistd.h",
+ "utime.h",
+ "utmp.h",
+ "utmpx.h",
+ "wchar.h",
}
cfg.type_name(move |ty, is_struct, is_union| {
match ty {
// Just pass all these through, no need for a "struct" prefix
+ // FIXME: is this necessary?
"FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr"
| "Elf64_Phdr" | "Elf32_Shdr" | "Elf64_Shdr" | "Elf32_Sym"
| "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr" | "Elf32_Chdr"
- | "Elf64_Chdr" => ty.to_string(),
-
- // OSX calls this something else
- "sighandler_t" => "sig_t".to_string(),
+ | "Elf64_Chdr" => ty.to_string(),
t if is_union => format!("union {}", t),
@@ -1550,6 +2012,7 @@ fn test_netbsd(target: &str) {
s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
s.replace("e_nsec", ".tv_nsec")
}
+ // FIXME: is this necessary?
"u64" if struct_ == "epoll_event" => "data.u64".to_string(),
s => s.to_string(),
}
@@ -1557,52 +2020,141 @@ fn test_netbsd(target: &str) {
cfg.skip_type(move |ty| {
match ty {
- // FIXME: sighandler_t is crazy across platforms
+ // sighandler_t is crazy across platforms
+ // FIXME: is this necessary?
"sighandler_t" => true,
+
_ => false,
}
});
cfg.skip_struct(move |ty| {
match ty {
+ // FIXME: is this necessary?
+ "sockaddr_nl" => true,
+
// This is actually a union, not a struct
+ // FIXME: is this necessary?
"sigval" => true,
+
+ // Linux kernel headers used on musl are too old to have this
+ // definition. Because it's tested on other Linux targets, skip it.
+ // FIXME: is this necessary?
+ "input_mask" => true,
+
// These are tested as part of the linux_fcntl tests since there are
// header conflicts when including them with all the other structs.
+ // FIXME: is this necessary?
"termios2" => true,
+
_ => false,
}
});
- cfg.skip_signededness(move |c| {
- match c {
- "LARGE_INTEGER" | "float" | "double" => true,
- // uuid_t is a struct, not an integer.
- n if n.starts_with("pthread") => true,
- // sem_t is a struct or pointer
- "sem_t" => true,
- _ => false,
- }
+ cfg.skip_signededness(move |c| match c {
+ // FIXME: is this necessary?
+ "LARGE_INTEGER" | "float" | "double" => true,
+ // FIXME: is this necessary?
+ n if n.starts_with("pthread") => true,
+ _ => false,
});
cfg.skip_const(move |name| {
match name {
+ // FIXME: is this necessary?
"SIG_DFL" | "SIG_ERR" | "SIG_IGN" => true, // sighandler_t weirdness
+ // FIXME: is this necessary?
"SIGUNUSED" => true, // removed in glibc 2.26
+ // types on musl are defined a little differently
+ // FIXME: is this necessary?
+ n if n.contains("__SIZEOF_PTHREAD") => true,
+
+ // Skip constants not defined in MUSL but just passed down to the
+ // kernel regardless
+ // FIXME: is this necessary?
+ "RLIMIT_NLIMITS"
+ | "TCP_COOKIE_TRANSACTIONS"
+ | "RLIMIT_RTTIME"
+ | "MSG_COPY"
+ =>
+ {
+ true
+ }
+
// weird signed extension or something like that?
+ // FIXME: is this necessary?
"MS_NOUSER" => true,
+ // FIXME: is this necessary?
"MS_RMT_MASK" => true, // updated in glibc 2.22 and musl 1.1.13
+
+ // Musl uses old, patched kernel headers
+ // FIXME: is this necessary?
+ "FALLOC_FL_COLLAPSE_RANGE"
+ | "FALLOC_FL_ZERO_RANGE"
+ | "FALLOC_FL_INSERT_RANGE"
+ | "FALLOC_FL_UNSHARE_RANGE"
+ | "RENAME_NOREPLACE"
+ | "RENAME_EXCHANGE"
+ | "RENAME_WHITEOUT"
+ // ALG_SET_AEAD_* constants are available starting from kernel 3.19
+ | "ALG_SET_AEAD_ASSOCLEN"
+ | "ALG_SET_AEAD_AUTHSIZE"
+ =>
+ {
+ true
+ }
+
+ // musl uses old kernel headers
+ // These are constants used in getrandom syscall
+ // FIXME: is this necessary?
+ "GRND_NONBLOCK" | "GRND_RANDOM" => true,
+
+
+ // These constants are tested in a separate test program generated below because there
+ // are header conflicts if we try to include the headers that define them here.
+ // FIXME: is this necessary?
+ "F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS" => true,
+ // FIXME: is this necessary?
+ "F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW"
+ | "F_SEAL_WRITE" => true,
+ // FIXME: is this necessary?
"BOTHER" => true,
+ // FIXME: is this necessary?
+ "MFD_CLOEXEC" | "MFD_ALLOW_SEALING" => true,
+ // MFD_HUGETLB is not available in some older libc versions on the CI builders. On the
+ // x86_64 and i686 builders it seems to be available for all targets, so at least test
+ // it there.
+ // FIXME: is this necessary?
+ "MFD_HUGETLB" =>
+ {
+ true
+ }
+
+ // These are defined for Solaris 11, but the crate is tested on
+ // illumos, where they are currently not defined
+ // FIXME: is this necessary?
+ "EADI"
+ | "PORT_SOURCE_POSTWAIT"
+ | "PORT_SOURCE_SIGNAL"
+ | "PTHREAD_STACK_MIN" => true,
+
+ // These change all the time from release to release of linux
+ // distros, let's just not bother trying to verify them. They
+ // shouldn't be used in code anyway...
+ // FIXME: is this necessary?
+ "AF_MAX" | "PF_MAX" => true,
+
_ => false,
}
});
cfg.skip_fn(move |name| {
+ // skip those that are manually verified
match name {
- // FIXME: incorrect API
- "execv" |
+ // FIXME: is this necessary?
+ "execv" | // crazy stuff with const/mut
"execve" |
"execvp" |
"execvpe" |
@@ -1612,25 +2164,23 @@ fn test_netbsd(target: &str) {
"setrlimit" | "setrlimit64" | // non-int in 1st arg
"prlimit" | "prlimit64" | // non-int in 2nd arg
- // These functions presumably exist on netbsd but don't look like
- // they're implemented on rumprun yet, just let them slide for now.
- // Some of them look like they have headers but then don't have
- // corresponding actual definitions either...
- "shm_open" |
- "shm_unlink" |
- "syscall" |
- "mq_open" |
- "mq_close" |
- "mq_getattr" |
- "mq_notify" |
- "mq_receive" |
- "mq_send" |
- "mq_setattr" |
- "mq_timedreceive" |
- "mq_timedsend" |
- "mq_unlink" |
- "ptrace" |
- "sigaltstack" if rumprun => true,
+ // int vs uint. Sorry musl, your prototype declarations are "correct" in the sense that
+ // they match the interface defined by Linux verbatim, but they conflict with other
+ // send*/recv* syscalls
+ // FIXME: is this necessary?
+ "sendmmsg" | "recvmmsg" => true,
+
+ // FIXME: is this necessary?
+ "dladdr" => true, // const-ness only added recently
+
+ // FIXME: is this necessary?
+ "lio_listio" => true,
+
+ // Definition of those functions as changed since unified headers from NDK r14b
+ // These changes imply some API breaking changes but are still ABI compatible.
+ // We can wait for the next major release to be compliant with the new API.
+ // FIXME: unskip these for next major release
+ "strerror_r" | "madvise" | "msync" | "mprotect" | "recvfrom" | "getpriority" |
_ => false,
}
@@ -1638,89 +2188,242 @@ fn test_netbsd(target: &str) {
cfg.skip_field_type(move |struct_, field| {
// This is a weird union, don't check the type.
+ // FIXME: is this necessary?
(struct_ == "ifaddrs" && field == "ifa_ifu") ||
// sighandler_t type is super weird
+ // FIXME: is this necessary?
(struct_ == "sigaction" && field == "sa_sigaction") ||
// sigval is actually a union, but we pretend it's a struct
+ // FIXME: is this necessary?
(struct_ == "sigevent" && field == "sigev_value") ||
// aio_buf is "volatile void*" and Rust doesn't understand volatile
+ // FIXME: is this necessary?
(struct_ == "aiocb" && field == "aio_buf")
});
+ cfg.skip_field(move |struct_, field| {
+ // this is actually a union on linux, so we can't represent it well and
+ // just insert some padding.
+ // FIXME: is this necessary?
+ (struct_ == "siginfo_t" && field == "_pad") ||
+ // musl names this __dummy1 but it's still there
+ // FIXME: is this necessary?
+ (struct_ == "glob_t" && field == "gl_flags") ||
+ // musl seems to define this as an *anonymous* bitfield
+ // FIXME: is this necessary?
+ (struct_ == "statvfs" && field == "__f_unused") ||
+ // sigev_notify_thread_id is actually part of a sigev_un union
+ (struct_ == "sigevent" && field == "sigev_notify_thread_id") ||
+ // signalfd had SIGSYS fields added in Linux 4.18, but no libc release has them yet.
+ (struct_ == "signalfd_siginfo" && (field == "ssi_addr_lsb" ||
+ field == "_pad2" ||
+ field == "ssi_syscall" ||
+ field == "ssi_call_addr" ||
+ field == "ssi_arch"))
+ });
+
+ // FIXME: remove
+ cfg.fn_cname(move |name, _cname| name.to_string());
+
cfg.generate("../src/lib.rs", "main.rs");
}
-fn test_dragonflybsd(target: &str) {
- assert!(target.contains("dragonfly"));
+fn test_linux(target: &str) {
+ assert!(target.contains("linux"));
+
+ // target_env
+ let gnu = target.contains("gnu");
+ let musl = target.contains("musl");
+ let uclibc = target.contains("uclibc");
+
+ match (gnu, musl, uclibc) {
+ (true, false, false) => (),
+ (false, true, false) => (),
+ (false, false, true) => (),
+ (_, _, _) => panic!(
+ "linux target lib is gnu: {}, musl: {}, uclibc: {}",
+ gnu, musl, uclibc
+ ),
+ }
+
+ let mips = target.contains("mips");
+ let i686 = target.contains("i686");
+ let x86_64 = target.contains("x86_64");
+ let x32 = target.ends_with("gnux32");
+
let mut cfg = ctest::TestGenerator::new();
+ // FIXME: still necessary?
+ cfg.define("_GNU_SOURCE", None);
+ // This macro re-deifnes fscanf,scanf,sscanf to link to the symbols that are
+ // deprecated since glibc >= 2.29. This allows Rust binaries to link against
+ // glibc versions older than 2.29.
+ cfg.define("__GLIBC_USE_DEPRECATED_SCANF", None);
+
+ // FIXME: still necessary?
cfg.flag("-Wno-deprecated-declarations");
+ headers! { cfg:
+ "ctype.h",
+ "dirent.h",
+ "dlfcn.h",
+ "elf.h",
+ "fcntl.h",
+ "glob.h",
+ "grp.h",
+ "ifaddrs.h",
+ "langinfo.h",
+ "limits.h",
+ "link.h",
+ "locale.h",
+ "malloc.h",
+ "mntent.h",
+ "mqueue.h",
+ "net/ethernet.h",
+ "net/if.h",
+ "net/if_arp.h",
+ "net/route.h",
+ "netdb.h",
+ "netinet/in.h",
+ "netinet/ip.h",
+ "netinet/tcp.h",
+ "netinet/udp.h",
+ "netpacket/packet.h",
+ "poll.h",
+ "pthread.h",
+ "pty.h",
+ "pwd.h",
+ "resolv.h",
+ "sched.h",
+ "semaphore.h",
+ "shadow.h",
+ "signal.h",
+ "spawn.h",
+ "stddef.h",
+ "stdint.h",
+ "stdio.h",
+ "stdlib.h",
+ "string.h",
+ "sys/epoll.h",
+ "sys/eventfd.h",
+ "sys/file.h",
+ "sys/fsuid.h",
+ "sys/inotify.h",
+ "sys/ioctl.h",
+ "sys/ipc.h",
+ "sys/mman.h",
+ "sys/mount.h",
+ "sys/msg.h",
+ "sys/personality.h",
+ "sys/prctl.h",
+ "sys/ptrace.h",
+ "sys/quota.h",
+ "sys/reboot.h",
+ "sys/resource.h",
+ "sys/sem.h",
+ "sys/sendfile.h",
+ "sys/shm.h",
+ "sys/signalfd.h",
+ "sys/socket.h",
+ "sys/stat.h",
+ "sys/statvfs.h",
+ "sys/swap.h",
+ "sys/syscall.h",
+ "sys/time.h",
+ "sys/timerfd.h",
+ "sys/times.h",
+ "sys/types.h",
+ "sys/uio.h",
+ "sys/un.h",
+ "sys/user.h",
+ "sys/utsname.h",
+ "sys/vfs.h",
+ "sys/wait.h",
+ "syslog.h",
+ "termios.h",
+ "time.h",
+ "ucontext.h",
+ "unistd.h",
+ "utime.h",
+ "utmp.h",
+ "wchar.h",
+ "errno.h",
+ }
+
+ // Include linux headers at the end:
headers! {
cfg:
- "aio.h",
- "ctype.h",
- "dirent.h",
- "dlfcn.h",
- "errno.h",
- "execinfo.h",
- "fcntl.h",
- "glob.h",
- "grp.h",
- "ifaddrs.h",
- "langinfo.h",
- "limits.h",
- "locale.h",
- "mqueue.h",
- "net/if.h",
- "net/if_arp.h",
- "net/if_dl.h",
- "net/route.h",
- "netdb.h",
- "netinet/in.h",
- "netinet/ip.h",
- "netinet/tcp.h",
- "netinet/udp.h",
- "poll.h",
- "pthread.h",
- "pthread_np.h",
- "pwd.h",
- "resolv.h",
- "sched.h",
- "semaphore.h",
- "signal.h",
- "stddef.h",
- "stdint.h",
- "stdio.h",
- "stdlib.h",
- "string.h",
- "sys/event.h",
- "sys/file.h",
- "sys/ioctl.h",
- "sys/mman.h",
- "sys/mount.h",
- "sys/ptrace.h",
- "sys/resource.h",
- "sys/rtprio.h",
- "sys/socket.h",
- "sys/stat.h",
- "sys/statvfs.h",
- "sys/sysctl.h",
- "sys/time.h",
- "sys/times.h",
- "sys/types.h",
- "sys/uio.h",
- "sys/un.h",
- "sys/utsname.h",
- "sys/wait.h",
- "syslog.h",
- "termios.h",
- "time.h",
- "ufs/ufs/quota.h",
- "unistd.h",
- "util.h",
- "utime.h",
- "utmpx.h",
- "wchar.h",
+ "linux/falloc.h",
+ "linux/fs.h",
+ "linux/genetlink.h",
+ "linux/if_alg.h",
+ "linux/if_ether.h",
+ "linux/if_tun.h",
+ "linux/input.h",
+ "linux/module.h",
+ "linux/net_tstamp.h",
+ "linux/netfilter_ipv4.h",
+ "linux/netfilter_ipv6.h",
+ "linux/netlink.h",
+ "linux/random.h",
+ "linux/seccomp.h",
+ "linux/sockios.h",
+ }
+
+ if x86_64 {
+ headers! { cfg: "sys/io.h" };
+ }
+ if i686 || x86_64 {
+ headers! { cfg: "sys/reg.h" };
+ }
+
+ if !musl {
+ assert!(uclibc || gnu);
+ headers! { cfg:
+ "asm/mman.h",
+ "linux/if.h",
+ "linux/magic.h",
+ "linux/netfilter/nf_tables.h",
+ "linux/reboot.h",
+ "sys/auxv.h",
+ };
+
+ if !x32 {
+ assert!((gnu || uclibc) && !x32);
+ headers! { cfg: "sys/sysctl.h", }
+ }
+ if !uclibc {
+ assert!(gnu);
+ headers! { cfg:
+ "execinfo.h",
+ "utmpx.h",
+ }
+ }
+ if !mips {
+ assert!((gnu || uclibc) && !mips);
+ headers! { cfg: "linux/quota.h" };
+ }
+ }
+
+ // DCCP support
+ if !uclibc && !musl {
+ assert!(gnu);
+ headers! { cfg: "linux/dccp.h" };
+ }
+
+ if !musl || mips {
+ assert!(gnu || uclibc || (mips && musl));
+ headers! { cfg: "linux/memfd.h" };
+ }
+
+ // note: aio.h must be included before sys/mount.h
+ if !uclibc {
+ assert!(gnu || musl);
+ // optionally included in uclibc
+ headers! { cfg:
+ "sys/xattr.h",
+ "sys/sysinfo.h",
+ "aio.h",
+ }
}
cfg.type_name(move |ty, is_struct, is_union| {
@@ -1731,9 +2434,6 @@ fn test_dragonflybsd(target: &str) {
| "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr" | "Elf32_Chdr"
| "Elf64_Chdr" => ty.to_string(),
- // FIXME: OSX calls this something else
- "sighandler_t" => "sig_t".to_string(),
-
t if is_union => format!("union {}", t),
t if t.ends_with("_t") => t.to_string(),
@@ -1752,7 +2452,9 @@ fn test_dragonflybsd(target: &str) {
s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
s.replace("e_nsec", ".tv_nsec")
}
+ // FIXME: is this necessary?
"u64" if struct_ == "epoll_event" => "data.u64".to_string(),
+ // FIXME: is this necessary?
"type_"
if struct_ == "input_event"
|| struct_ == "input_mask"
@@ -1768,51 +2470,184 @@ fn test_dragonflybsd(target: &str) {
cfg.skip_type(move |ty| {
match ty {
// sighandler_t is crazy across platforms
+ // FIXME: is this necessary?
"sighandler_t" => true,
+ // These cannot be tested when "resolv.h" is included and are tested
+ // below.
+ "Elf64_Phdr" | "Elf32_Phdr" => true,
+
_ => false,
}
});
cfg.skip_struct(move |ty| {
match ty {
- // This is actually a union, not a struct
- "sigval" => true,
+ // FIXME: is this necessary?
+ "sockaddr_nl" if musl => true,
- // FIXME: These are tested as part of the linux_fcntl tests since
- // there are header conflicts when including them with all the other
- // structs.
- "termios2" => true,
+ // These cannot be tested when "resolv.h" is included and are tested
+ // below.
+ "Elf64_Phdr" | "Elf32_Phdr" => true,
- _ => false,
- }
- });
+ // On Linux, the type of `ut_tv` field of `struct utmpx`
+ // can be an anonymous struct, so an extra struct,
+ // which is absent in glibc, has to be defined.
+ "__timeval" => true,
- cfg.skip_signededness(move |c| {
- match c {
- "LARGE_INTEGER" | "float" | "double" => true,
- // uuid_t is a struct, not an integer.
- "uuid_t" => true,
- n if n.starts_with("pthread") => true,
- // sem_t is a struct or pointer
- "sem_t" => true,
- // mqd_t is a pointer on DragonFly
- "mqd_t" => true,
+ // This is actually a union, not a struct
+ "sigval" => true,
+
+ // Linux kernel headers used on musl are too old to have this
+ // definition. Because it's tested on other Linux targets, skip it.
+ // FIXME: is this necessary?
+ "input_mask" if musl => true,
+
+ // These are tested as part of the linux_fcntl tests since there are
+ // header conflicts when including them with all the other structs.
+ // FIXME: is this necessary?
+ "termios2" => true,
_ => false,
}
});
+ cfg.skip_signededness(move |c| match c {
+ // FIXME: is this necessary?
+ "LARGE_INTEGER" | "float" | "double" => true,
+ // FIXME: is this necessary?
+ n if n.starts_with("pthread") => true,
+ _ => false,
+ });
+
cfg.skip_const(move |name| {
match name {
+ // FIXME: is this necessary?
"SIG_DFL" | "SIG_ERR" | "SIG_IGN" => true, // sighandler_t weirdness
+ // FIXME: is this necessary?
+ "SIGUNUSED" => true, // removed in glibc 2.26
+
+ // types on musl are defined a little differently
+ // FIXME: is this necessary?
+ n if musl && n.contains("__SIZEOF_PTHREAD") => true,
+
+ // Skip constants not defined in MUSL but just passed down to the
+ // kernel regardless
+ // FIXME: is this necessary?
+ "RLIMIT_NLIMITS"
+ | "TCP_COOKIE_TRANSACTIONS"
+ | "RLIMIT_RTTIME"
+ | "MSG_COPY"
+ if musl =>
+ {
+ true
+ }
+ // work around super old mips toolchain
+ // FIXME: is this necessary?
+ "SCHED_IDLE" | "SHM_NORESERVE" => mips,
// weird signed extension or something like that?
+ // FIXME: is this necessary?
"MS_NOUSER" => true,
+ // FIXME: is this necessary?
"MS_RMT_MASK" => true, // updated in glibc 2.22 and musl 1.1.13
+ // These are either unimplemented or optionally built into uClibc
+ // FIXME: is this necessary?
+ "LC_CTYPE_MASK"
+ | "LC_NUMERIC_MASK"
+ | "LC_TIME_MASK"
+ | "LC_COLLATE_MASK"
+ | "LC_MONETARY_MASK"
+ | "LC_MESSAGES_MASK"
+ | "MADV_MERGEABLE"
+ | "MADV_UNMERGEABLE"
+ | "MADV_HWPOISON"
+ | "IPV6_ADD_MEMBERSHIP"
+ | "IPV6_DROP_MEMBERSHIP"
+ | "IPV6_MULTICAST_LOOP"
+ | "IPV6_V6ONLY"
+ | "MAP_STACK"
+ | "RTLD_DEEPBIND"
+ | "SOL_IPV6"
+ | "SOL_ICMPV6"
+ if uclibc =>
+ {
+ true
+ }
+
+ // Musl uses old, patched kernel headers
+ // FIXME: is this necessary?
+ "FALLOC_FL_COLLAPSE_RANGE"
+ | "FALLOC_FL_ZERO_RANGE"
+ | "FALLOC_FL_INSERT_RANGE"
+ | "FALLOC_FL_UNSHARE_RANGE"
+ | "RENAME_NOREPLACE"
+ | "RENAME_EXCHANGE"
+ | "RENAME_WHITEOUT"
+ // ALG_SET_AEAD_* constants are available starting from kernel 3.19
+ | "ALG_SET_AEAD_ASSOCLEN"
+ | "ALG_SET_AEAD_AUTHSIZE"
+ if musl =>
+ {
+ true
+ }
+
+ // musl uses old kernel headers
+ // These are constants used in getrandom syscall
+ // FIXME: is this necessary?
+ "GRND_NONBLOCK" | "GRND_RANDOM" if musl => true,
+
+ // Defined by libattr not libc on linux (hard to test).
+ // See constant definition for more details.
+ // FIXME: is this necessary?
+ "ENOATTR" => true,
+
+ // On mips*-unknown-linux-gnu* CMSPAR cannot be included with the set of headers we
+ // want to use here for testing. It's originally defined in asm/termbits.h, which is
+ // also included by asm/termios.h, but not the standard termios.h. There's no way to
+ // include both asm/termbits.h and termios.h and there's no way to include both
+ // asm/termios.h and ioctl.h (+ some other headers) because of redeclared types.
+ // FIXME: is this necessary?
+ "CMSPAR" if mips && !musl => true,
+
+ // On mips Linux targets, MADV_SOFT_OFFLINE is currently missing, though it's been added but CI has too old
+ // of a Linux version. Since it exists on all other Linux targets, just ignore this for now and remove once
+ // it's been fixed in CI.
+ // FIXME: is this necessary?
+ "MADV_SOFT_OFFLINE" if mips => true,
+
+ // These constants are tested in a separate test program generated below because there
+ // are header conflicts if we try to include the headers that define them here.
+ // FIXME: is this necessary?
+ "F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS" => true,
+ // FIXME: is this necessary?
+ "F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW"
+ | "F_SEAL_WRITE" => true,
+ // FIXME: is this necessary?
+ "QFMT_VFS_OLD" | "QFMT_VFS_V0" | "QFMT_VFS_V1"
+ if mips =>
+ {
+ true
+ } // Only on MIPS
+ // FIXME: is this necessary?
+ "BOTHER" => true,
+
+ // FIXME: is this necessary?
+ "MFD_CLOEXEC" | "MFD_ALLOW_SEALING" if !mips && musl => true,
+ // MFD_HUGETLB is not available in some older libc versions on the CI builders. On the
+ // x86_64 and i686 builders it seems to be available for all targets, so at least test
+ // it there.
+ // FIXME: is this necessary?
+ "MFD_HUGETLB"
+ if !(x86_64 || i686) || musl =>
+ {
+ true
+ }
+
// These are defined for Solaris 11, but the crate is tested on
// illumos, where they are currently not defined
+ // FIXME: is this necessary?
"EADI"
| "PORT_SOURCE_POSTWAIT"
| "PORT_SOURCE_SIGNAL"
@@ -1821,8 +2656,24 @@ fn test_dragonflybsd(target: &str) {
// These change all the time from release to release of linux
// distros, let's just not bother trying to verify them. They
// shouldn't be used in code anyway...
+ // FIXME: is this necessary?
"AF_MAX" | "PF_MAX" => true,
+ // These are not in a glibc release yet, only in kernel headers.
+ // FIXME: is this necessary?
+ "AF_XDP"
+ | "PF_XDP"
+ | "SOL_XDP"
+ | "IPV6_FLOWINFO"
+ | "IPV6_FLOWLABEL_MGR"
+ | "IPV6_FLOWINFO_SEND"
+ | "IPV6_FLOWINFO_FLOWLABEL"
+ | "IPV6_FLOWINFO_PRIORITY"
+ =>
+ {
+ true
+ }
+
_ => false,
}
});
@@ -1838,102 +2689,159 @@ fn test_dragonflybsd(target: &str) {
"getrlimit" | "getrlimit64" | // non-int in 1st arg
"setrlimit" | "setrlimit64" | // non-int in 1st arg
- "prlimit" | "prlimit64" | // non-int in 2nd arg
- // typed 2nd arg on linux and android
+ "prlimit" | "prlimit64" // non-int in 2nd arg
+ => true,
+
+ // int vs uint. Sorry musl, your prototype declarations are "correct" in the sense that
+ // they match the interface defined by Linux verbatim, but they conflict with other
+ // send*/recv* syscalls
+ // FIXME: is this necessary?
+ "sendmmsg" | "recvmmsg" if musl => true,
+
+ // typed 2nd arg on linux
+ // FIXME: is this necessary?
"gettimeofday" => true,
+ // FIXME: is this necessary?
+ "dladdr" if musl => true, // const-ness only added recently
+
+ // There seems to be a small error in EGLIBC's eventfd.h header. The
+ // [underlying system call][1] always takes its first `count`
+ // argument as an `unsigned int`, but [EGLIBC's <sys/eventfd.h>
+ // header][2] declares it to take an `int`. [GLIBC's header][3]
+ // matches the kernel.
+ //
+ // EGLIBC is no longer actively developed, and Debian, the largest
+ // distribution that had been using it, switched back to GLIBC in
+ // April 2015. So effectively all Linux <sys/eventfd.h> headers will
+ // be using `unsigned int` soon.
+ //
+ // [1]: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/fs/eventfd.c?id=refs/tags/v3.12.51#n397
+ // [2]: http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/eglibc/trusty/view/head:/sysdeps/unix/sysv/linux/sys/eventfd.h
+ // [3]: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/sys/eventfd.h;h=6295f32e937e779e74318eb9d3bdbe76aef8a8f3;hb=4e42b5b8f89f0e288e68be7ad70f9525aebc2cff#l34
+ // FIXME: is this necessary?
+ "eventfd" => true,
+
+ "lio_listio" if musl => true,
+
+ // These are either unimplemented or optionally built into uClibc
+ // or "sysinfo", where it's defined but the structs in linux/sysinfo.h and sys/sysinfo.h
+ // clash so it can't be tested
+ "getxattr" | "lgetxattr" | "fgetxattr" | "setxattr" | "lsetxattr" | "fsetxattr" |
+ "listxattr" | "llistxattr" | "flistxattr" | "removexattr" | "lremovexattr" |
+ "fremovexattr" |
+ "backtrace" |
+ "sysinfo" | "newlocale" | "duplocale" | "freelocale" | "uselocale" |
+ "nl_langinfo_l" | "wcslen" | "wcstombs" if uclibc => true,
+
+ // Definition of those functions as changed since unified headers from NDK r14b
+ // These changes imply some API breaking changes but are still ABI compatible.
+ // We can wait for the next major release to be compliant with the new API.
+ // FIXME: unskip these for next major release
+ "strerror_r" | "madvise" | "msync" | "mprotect" | "recvfrom" | "getpriority" => true,
+
_ => false,
}
});
+ // FIXME: is this necessary?
cfg.skip_field_type(move |struct_, field| {
// This is a weird union, don't check the type.
(struct_ == "ifaddrs" && field == "ifa_ifu") ||
// sighandler_t type is super weird
(struct_ == "sigaction" && field == "sa_sigaction") ||
+ // __timeval type is a patch which doesn't exist in glibc
+ (struct_ == "utmpx" && field == "ut_tv") ||
// sigval is actually a union, but we pretend it's a struct
(struct_ == "sigevent" && field == "sigev_value") ||
// aio_buf is "volatile void*" and Rust doesn't understand volatile
- (struct_ == "aiocb" && field == "aio_buf")
+ (struct_ == "aiocb" && field == "aio_buf") ||
+ // this one is an anonymous union
+ (struct_ == "ff_effect" && field == "u")
});
cfg.skip_field(move |struct_, field| {
// this is actually a union on linux, so we can't represent it well and
// just insert some padding.
(struct_ == "siginfo_t" && field == "_pad") ||
+ // musl names this __dummy1 but it's still there
+ (musl && struct_ == "glob_t" && field == "gl_flags") ||
+ // musl seems to define this as an *anonymous* bitfield
+ (musl && struct_ == "statvfs" && field == "__f_unused") ||
// sigev_notify_thread_id is actually part of a sigev_un union
- (struct_ == "sigevent" && field == "sigev_notify_thread_id")
+ (struct_ == "sigevent" && field == "sigev_notify_thread_id") ||
+ // signalfd had SIGSYS fields added in Linux 4.18, but no libc release has them yet.
+ (struct_ == "signalfd_siginfo" && (field == "ssi_addr_lsb" ||
+ field == "_pad2" ||
+ field == "ssi_syscall" ||
+ field == "ssi_call_addr" ||
+ field == "ssi_arch"))
});
- cfg.generate("../src/lib.rs", "main.rs");
-}
+ // FIXME: remove
+ cfg.fn_cname(move |name, _cname| name.to_string());
-fn test_wasi(target: &str) {
- assert!(target.contains("wasi"));
+ cfg.generate("../src/lib.rs", "main.rs");
+ // On Linux also generate another script for testing linux/fcntl declarations.
+ // These cannot be tested normally because including both `linux/fcntl.h` and `fcntl.h`
+ // fails on a lot of platforms.
let mut cfg = ctest::TestGenerator::new();
- cfg.define("_GNU_SOURCE", None);
-
- headers! { cfg:
- "ctype.h",
- "dirent.h",
- "errno.h",
- "fcntl.h",
- "limits.h",
- "locale.h",
- "malloc.h",
- "poll.h",
- "stdbool.h",
- "stddef.h",
- "stdint.h",
- "stdio.h",
- "stdlib.h",
- "string.h",
- "sys/resource.h",
- "sys/select.h",
- "sys/socket.h",
- "sys/stat.h",
- "sys/times.h",
- "sys/types.h",
- "sys/uio.h",
- "sys/utsname.h",
- "time.h",
- "unistd.h",
- "wasi/core.h",
- "wasi/libc.h",
- "wasi/libc-find-relpath.h",
- "wchar.h",
+ cfg.skip_type(|_| true)
+ .skip_fn(|_| true)
+ .skip_static(|_| true);
+ // musl defines these directly in `fcntl.h`
+ if musl {
+ cfg.header("fcntl.h");
+ } else {
+ cfg.header("linux/fcntl.h");
}
-
- cfg.type_name(move |ty, is_struct, is_union| match ty {
- "FILE" | "fd_set" | "DIR" => ty.to_string(),
- t if is_union => format!("union {}", t),
- t if t.starts_with("__wasi") && t.ends_with("_u") => {
- format!("union {}", t)
+ if !musl {
+ cfg.header("net/if.h");
+ cfg.header("linux/if.h");
+ }
+ cfg.header("linux/quota.h");
+ cfg.header("asm/termbits.h");
+ cfg.skip_const(move |name| match name {
+ "F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS" => false,
+ "F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW" | "F_SEAL_WRITE" => {
+ false
}
- t if t.starts_with("__wasi") && is_struct => format!("struct {}", t),
- t if t.ends_with("_t") => t.to_string(),
+ "QFMT_VFS_OLD" | "QFMT_VFS_V0" | "QFMT_VFS_V1" if mips => false,
+ "BOTHER" => false,
+ _ => true,
+ });
+ cfg.skip_struct(|s| s != "termios2");
+ cfg.type_name(move |ty, is_struct, is_union| match ty {
t if is_struct => format!("struct {}", t),
+ t if is_union => format!("union {}", t),
t => t.to_string(),
});
+ cfg.generate("../src/lib.rs", "linux_fcntl.rs");
- cfg.field_name(move |_struct, field| {
- match field {
- // deal with fields as rust keywords
- "type_" => "type".to_string(),
- s => s.to_string(),
+ // Test Elf64_Phdr and Elf32_Phdr
+ // These types have a field called `p_type`, but including
+ // "resolve.h" defines a `p_type` macro that expands to `__p_type`
+ // making the tests for these fails when both are included.
+ let mut cfg = ctest::TestGenerator::new();
+ cfg.skip_fn(|_| true)
+ .skip_const(|_| true)
+ .skip_static(|_| true)
+ .type_name(move |ty, _is_struct, _is_union| {
+ ty.to_string()
+ });
+ cfg.skip_struct(move |ty| {
+ match ty {
+ "Elf64_Phdr" | "Elf32_Phdr" => false,
+ _ => true,
}
});
-
- // Looks like LLD doesn't merge duplicate imports, so if the Rust
- // code imports from a module and the C code also imports from a
- // module we end up with two imports of function pointers which
- // import the same thing but have different function pointers
- cfg.skip_fn_ptrcheck(|f| f.starts_with("__wasi"));
-
- // d_name is declared as a flexible array in WASI libc, so it
- // doesn't support sizeof.
- cfg.skip_field(|s, field| s == "dirent" && field == "d_name");
-
- cfg.generate("../src/lib.rs", "main.rs");
+ cfg.skip_type(move |ty| {
+ match ty {
+ "Elf64_Phdr" | "Elf32_Phdr" => false,
+ _ => true,
+ }
+ });
+ cfg.header("elf.h");
+ cfg.generate("../src/lib.rs", "linux_elf.rs");
}
|
Ubuntu 17.10 repository is no longer available
It will result in following jobs failure: https://github.com/rust-lang/libc/search?l=Dockerfile&q=17.10
cc https://github.com/rust-lang/libc/pull/1297
|
2019-05-14T08:40:34Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 1,224
|
rust-lang__libc-1224
|
[
"1170"
] |
70284d78eebe89dcc941147bfb331a59c4fcc15b
|
diff --git a/.travis.yml b/.travis.yml
index da882aea61b9d..52d2403cd5963 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -89,8 +89,9 @@ matrix:
- shellcheck ci/*.sh
allow_failures:
- - env: TARGET=aarch64-linux-android
- - env: TARGET=x86_64-linux-android
+ # FIXME: https://github.com/rust-lang/libc/issues/1226
+ - env: TARGET=asmjs-unknown-emscripten
+ - env: TARGET=wasm32-unknown-emscripten
install: rustup target add $TARGET
script:
diff --git a/ci/android-install-sdk.sh b/ci/android-install-sdk.sh
index c0f63c9baa0f8..6b5ac09ab04af 100644
--- a/ci/android-install-sdk.sh
+++ b/ci/android-install-sdk.sh
@@ -46,9 +46,9 @@ case "$1" in
esac;
# --no_https avoids
-# javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
-echo "yes" | \
- ./sdk/tools/bin/sdkmanager --no_https \
+ # javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
+yes | ./sdk/tools/bin/sdkmanager --licenses --no_https
+yes | ./sdk/tools/bin/sdkmanager --no_https \
"emulator" \
"platform-tools" \
"platforms;android-24" \
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 7606800afb9cd..5edbdf5b73893 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -658,7 +658,7 @@ fn main() {
// MFD_HUGETLB is not available in some older libc versions on the CI builders. On the
// x86_64 and i686 builders it seems to be available for all targets, so at least test
// it there.
- "MFD_HUGETLB" if !(x86_64 || i686) || musl => true,
+ "MFD_HUGETLB" if !(x86_64 || i686) || musl || (x86_64 && android)=> true,
"DT_FIFO" | "DT_CHR" | "DT_DIR" | "DT_BLK" | "DT_REG"
| "DT_LNK" | "DT_SOCK"
|
Fix flakiness of Android builds
In https://github.com/rust-lang/libc/pull/1159 I'm configuring some android builds under "allowed failures". They've been insanely flaky recently and are basically just serving as preventing things from landing currently. This issue is intended to track re-enabling these as gating by default on CI
|
I don't know exactly why these stall. Sometimes things fail to download, so maybe retying multiple times would help, but sometimes the installer just hangs waiting for a `Y/n` input =/
|
2019-01-21T19:35:11Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 1,114
|
rust-lang__libc-1114
|
[
"856"
] |
04a13d1b979e12a999fcef99437eabc0e6c806c6
|
diff --git a/.travis.yml b/.travis.yml
index 197d8c663b93f..d5982e6e4d262 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -53,8 +53,6 @@ matrix:
- env: TARGET=arm-unknown-linux-musleabihf
- env: TARGET=aarch64-unknown-linux-gnu
- env: TARGET=aarch64-unknown-linux-musl
- # FIXME(#856)
- rust: 1.22.1
- env: TARGET=powerpc-unknown-linux-gnu
- env: TARGET=powerpc64-unknown-linux-gnu
- env: TARGET=powerpc64le-unknown-linux-gnu
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index 653cfa5c66ae5..78154927a3435 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -186,6 +186,10 @@ s! {
pub const SIGEV_THREAD_ID: ::c_int = 4;
+pub const EXTATTR_NAMESPACE_EMPTY: ::c_int = 0;
+pub const EXTATTR_NAMESPACE_USER: ::c_int = 1;
+pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2;
+
pub const RAND_MAX: ::c_int = 0x7fff_fffd;
pub const PTHREAD_STACK_MIN: ::size_t = 2048;
pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 4;
@@ -934,6 +938,58 @@ extern {
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 extattr_delete_fd(fd: ::c_int,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char) -> ::c_int;
+ pub fn extattr_delete_file(path: *const ::c_char,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char) -> ::c_int;
+ pub fn extattr_delete_link(path: *const ::c_char,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char) -> ::c_int;
+ pub fn extattr_get_fd(fd: ::c_int,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char,
+ data: *mut ::c_void,
+ nbytes: ::size_t) -> ::ssize_t;
+ pub fn extattr_get_file(path: *const ::c_char,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char,
+ data: *mut ::c_void,
+ nbytes: ::size_t) -> ::ssize_t;
+ pub fn extattr_get_link(path: *const ::c_char,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char,
+ data: *mut ::c_void,
+ nbytes: ::size_t) -> ::ssize_t;
+ pub fn extattr_list_fd(fd: ::c_int,
+ attrnamespace: ::c_int,
+ data: *mut ::c_void,
+ nbytes: ::size_t) -> ::ssize_t;
+ pub fn extattr_list_file(path: *const ::c_char,
+ attrnamespace: ::c_int,
+ data: *mut ::c_void,
+ nbytes: ::size_t) -> ::ssize_t;
+ pub fn extattr_list_link(path: *const ::c_char,
+ attrnamespace: ::c_int,
+ data: *mut ::c_void,
+ nbytes: ::size_t) -> ::ssize_t;
+ pub fn extattr_set_fd(fd: ::c_int,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char,
+ data: *const ::c_void,
+ nbytes: ::size_t) -> ::ssize_t;
+ pub fn extattr_set_file(path: *const ::c_char,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char,
+ data: *const ::c_void,
+ nbytes: ::size_t) -> ::ssize_t;
+ pub fn extattr_set_link(path: *const ::c_char,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char,
+ data: *const ::c_void,
+ nbytes: ::size_t) -> ::ssize_t;
+
pub fn jail(jail: *mut ::jail) -> ::c_int;
pub fn jail_attach(jid: ::c_int) -> ::c_int;
pub fn jail_remove(jid: ::c_int) -> ::c_int;
@@ -1060,6 +1116,14 @@ extern {
pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
}
+#[link(name = "util")]
+extern {
+ pub fn extattr_namespace_to_string(attrnamespace: ::c_int,
+ string: *mut *mut ::c_char) -> ::c_int;
+ pub fn extattr_string_to_namespace(string: *const ::c_char,
+ attrnamespace: *mut ::c_int) -> ::c_int;
+}
+
cfg_if! {
if #[cfg(target_arch = "x86")] {
mod x86;
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index 3f735278c0e07..915505d14beae 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -334,6 +334,9 @@ pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
pub const AT_REMOVEDIR: ::c_int = 0x800;
+pub const EXTATTR_NAMESPACE_USER: ::c_int = 1;
+pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2;
+
pub const LC_COLLATE_MASK: ::c_int = (1 << ::LC_COLLATE);
pub const LC_CTYPE_MASK: ::c_int = (1 << ::LC_CTYPE);
pub const LC_MONETARY_MASK: ::c_int = (1 << ::LC_MONETARY);
@@ -1013,6 +1016,46 @@ extern {
pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb,
nitems: ::c_int, sevp: *mut sigevent) -> ::c_int;
+ pub fn extattr_delete_fd(fd: ::c_int,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char) -> ::c_int;
+ pub fn extattr_delete_file(path: *const ::c_char,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char) -> ::c_int;
+ pub fn extattr_delete_link(path: *const ::c_char,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char) -> ::c_int;
+ pub fn extattr_get_fd(fd: ::c_int,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char,
+ data: *mut ::c_void,
+ nbytes: ::size_t) -> ::ssize_t;
+ pub fn extattr_get_file(path: *const ::c_char,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char,
+ data: *mut ::c_void,
+ nbytes: ::size_t) -> ::ssize_t;
+ pub fn extattr_get_link(path: *const ::c_char,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char,
+ data: *mut ::c_void,
+ nbytes: ::size_t) -> ::ssize_t;
+ pub fn extattr_set_fd(fd: ::c_int,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char,
+ data: *const ::c_void,
+ nbytes: ::size_t) -> ::ssize_t;
+ pub fn extattr_set_file(path: *const ::c_char,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char,
+ data: *const ::c_void,
+ nbytes: ::size_t) -> ::ssize_t;
+ pub fn extattr_set_link(path: *const ::c_char,
+ attrnamespace: ::c_int,
+ attrname: *const ::c_char,
+ data: *const ::c_void,
+ nbytes: ::size_t) -> ::ssize_t;
+
#[link_name = "__lutimes50"]
pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
pub fn getnameinfo(sa: *const ::sockaddr,
@@ -1112,6 +1155,10 @@ extern {
#[link(name = "util")]
extern {
+ pub fn extattr_namespace_to_string(attrnamespace: ::c_int,
+ string: *mut *mut ::c_char) -> ::c_int;
+ pub fn extattr_string_to_namespace(string: *const ::c_char,
+ attrnamespace: *mut ::c_int) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
pub fn getpwent_r(pwd: *mut ::passwd,
buf: *mut ::c_char,
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index db6588b802ba0..be148b83fb4a6 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -304,6 +304,7 @@ fn main() {
cfg.header("pthread_np.h");
cfg.header("sched.h");
cfg.header("ufs/ufs/quota.h");
+ cfg.header("sys/extattr.h");
cfg.header("sys/jail.h");
cfg.header("sys/ipc.h");
cfg.header("sys/msg.h");
@@ -317,6 +318,7 @@ fn main() {
cfg.header("mqueue.h");
cfg.header("ufs/ufs/quota.h");
cfg.header("ufs/ufs/quota1.h");
+ cfg.header("sys/extattr.h");
cfg.header("sys/ioctl_compat.h");
// DCCP support
|
aarch64-unknown-linux-musl double panic on 1.23.0+
This is the current beta channel as of this writing. No idea why it double panics, gonna pin it to 1.22.0
|
The timing is a bit different, but I wonder if this could be related to rust-lang/rust#48967?
|
2018-10-30T19:32:06Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 930
|
rust-lang__libc-930
|
[
"928"
] |
bb2a95c9f229593ad6ce135c7900fad75ef5c47d
|
diff --git a/appveyor.yml b/appveyor.yml
index 07ac4a92a5ae1..fe2a332a1c425 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -24,4 +24,5 @@ build: false
test_script:
- cargo test --target %TARGET%
+ - cargo test --no-default-features --target %TARGET%
- cargo test --manifest-path libc-test/Cargo.toml --target %TARGET%
diff --git a/ci/run.sh b/ci/run.sh
index 02dd35a12bf8e..8a1d10b29edb9 100755
--- a/ci/run.sh
+++ b/ci/run.sh
@@ -79,4 +79,5 @@ if [ "$TARGET" = "x86_64-unknown-linux-gnux32" ]; then
opt="--release"
fi
+cargo test $opt --no-default-features --manifest-path libc-test/Cargo.toml --target $TARGET
exec cargo test $opt --manifest-path libc-test/Cargo.toml --target $TARGET
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index 0d344edc5fbd2..286748d72aea3 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -277,16 +277,20 @@ cfg_if! {
// cargo build, don't pull in anything extra as the libstd dep
// already pulls in all libs.
} else if #[cfg(target_env = "musl")] {
- #[link(name = "c", kind = "static", cfg(target_feature = "crt-static"))]
- #[link(name = "c", cfg(not(target_feature = "crt-static")))]
+ #[cfg_attr(feature = "stdbuild",
+ link(name = "c", kind = "static",
+ cfg(target_feature = "crt-static")))]
+ #[cfg_attr(feature = "stdbuild",
+ link(name = "c", cfg(not(target_feature = "crt-static"))))]
extern {}
} else if #[cfg(target_os = "emscripten")] {
#[link(name = "c")]
extern {}
- } else if #[cfg(all(target_os = "netbsd", target_vendor = "rumprun"))] {
+ } else if #[cfg(all(target_os = "netbsd"))] {
// Since we don't use -nodefaultlibs on Rumprun, libc is always pulled
// in automatically by the linker. We avoid passing it explicitly, as it
// causes some versions of binutils to crash with an assertion failure.
+ #[cfg_attr(feature = "stdbuild", target_vendor = "rumprun")]
#[link(name = "m")]
extern {}
} else if #[cfg(any(target_os = "macos",
|
diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml
index 771d3b3ff0b04..8d0f9d34e6e09 100644
--- a/libc-test/Cargo.toml
+++ b/libc-test/Cargo.toml
@@ -4,12 +4,17 @@ version = "0.1.0"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
build = "build.rs"
-[dependencies]
-libc = { path = ".." }
+[dependencies.libc]
+path = ".."
+default-features = false
[build-dependencies]
ctest = { git = "https://github.com/alexcrichton/ctest" }
+[features]
+default = [ "use_std" ]
+use_std = [ "libc/use_std" ]
+
[[test]]
name = "main"
path = "test/main.rs"
@@ -19,3 +24,4 @@ harness = false
name = "linux-fcntl"
path = "test/linux_fcntl.rs"
harness = false
+
|
Hard error compiling libc 0.2.36: #![feature(link_cfg)] missing ?
```shell
Compiling libc v0.2.36
error[E0658]: is feature gated (see issue #37406)
--> /cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.36/src/unix/mod.rs:279:9
|
279 | #[link(name = "c", kind = "static", cfg(target_feature = "crt-static"))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add #![feature(link_cfg)] to the crate attributes to enable
```
|
Seems to only fail when building libc with `--no-default-features` on some targets:
* arm-unknown-linux-musleabi
* armv7-unknown-linux-musleabi
* i686-unknown-linux-musl
* x86_64-unknown-linux-musl
Looks like `libc`'s CI does not test building libc with `--no-default-features`... opening an issue about this: https://github.com/rust-lang/libc/issues/929
Argh this definitely wasn't intentional. Although I'm not sure that the `no_std` build of the musl version of `libc` would work otherwise...
They used to work last month just fine :/
I forget which PR caused this at this point but I think it's fine to fix whenever basically
yeah I am working on a fix :)
I don't know if we just need to enable the nightly feature and require nightly for no-std builds, or if there is something better that we can do like not using the link attribute somehow. Requiring nightly for libc is... probably a bad idea.
Yeah I don't think we should require nightly for no_std builds, but rather we just need to compile it differently when included in libstd and when included in cargo
|
2018-02-27T17:56:09Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 902
|
rust-lang__libc-902
|
[
"901"
] |
041fd77ea72a0ea6974439130921ed593903bcf8
|
diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs
index 6ab171d44ad9c..c2900de085eb4 100644
--- a/src/unix/notbsd/linux/mod.rs
+++ b/src/unix/notbsd/linux/mod.rs
@@ -1481,7 +1481,6 @@ extern {
nbytes: ::off64_t, flags: ::c_uint) -> ::c_int;
pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
pub fn freeifaddrs(ifa: *mut ::ifaddrs);
-
pub fn mremap(addr: *mut ::c_void,
len: ::size_t,
new_len: ::size_t,
@@ -1507,7 +1506,8 @@ extern {
-> ::c_int;
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
-
+ pub fn remap_file_pages(addr: *mut ::c_void, size: ::size_t, prot: ::c_int,
+ pgoff: ::size_t, flags: ::c_int) -> ::c_int;
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;
diff --git a/src/unix/notbsd/linux/other/mod.rs b/src/unix/notbsd/linux/other/mod.rs
index c256d5f498fb3..fefeda2ccb81e 100644
--- a/src/unix/notbsd/linux/other/mod.rs
+++ b/src/unix/notbsd/linux/other/mod.rs
@@ -165,6 +165,19 @@ s! {
__size: [::c_char; 32],
__align: [::c_long; 0],
}
+
+ pub struct mallinfo {
+ pub arena: ::c_int,
+ pub ordblks: ::c_int,
+ pub smblks: ::c_int,
+ pub hblks: ::c_int,
+ pub hblkhd: ::c_int,
+ pub usmblks: ::c_int,
+ pub fsmblks: ::c_int,
+ pub uordblks: ::c_int,
+ pub fordblks: ::c_int,
+ pub keepcost: ::c_int,
+ }
}
pub const __UT_LINESIZE: usize = 32;
@@ -597,6 +610,9 @@ extern {
pub fn pthread_rwlockattr_setkind_np(attr: *mut ::pthread_rwlockattr_t,
val: ::c_int) -> ::c_int;
pub fn sched_getcpu() -> ::c_int;
+ pub fn mallinfo() -> ::mallinfo;
+ pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
+ pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
}
cfg_if! {
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 1c1b0f5c2579d..a864615879204 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -99,6 +99,7 @@ fn main() {
cfg.header("sys/socket.h");
if linux && !musl {
cfg.header("linux/if.h");
+ cfg.header("sys/auxv.h");
}
cfg.header("sys/time.h");
cfg.header("sys/un.h");
|
mallinfo is missing
http://man7.org/linux/man-pages/man3/mallinfo.3.html
|
2018-01-17T17:30:50Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
|
rust-lang/libc
| 634
|
rust-lang__libc-634
|
[
"632"
] |
158d778258124b7def4107f3003c23dafa08c2d8
|
diff --git a/ci/android-install-ndk.sh b/ci/android-install-ndk.sh
index 75bcd20f2f77d..873f6c52c8f18 100644
--- a/ci/android-install-ndk.sh
+++ b/ci/android-install-ndk.sh
@@ -11,8 +11,8 @@
set -ex
-curl -O https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
-unzip -q android-ndk-r13b-linux-x86_64.zip
+curl -O https://dl.google.com/android/repository/android-ndk-r15b-linux-x86_64.zip
+unzip -q android-ndk-r15b-linux-x86_64.zip
case "$1" in
aarch64)
@@ -28,9 +28,10 @@ case "$1" in
;;
esac;
-android-ndk-r13b/build/tools/make_standalone_toolchain.py \
+android-ndk-r15b/build/tools/make_standalone_toolchain.py \
+ --unified-headers \
--install-dir /android/ndk-$1 \
--arch $arch \
--api 24
-rm -rf ./android-ndk-r13b-linux-x86_64.zip ./android-ndk-r13b
+rm -rf ./android-ndk-r15b-linux-x86_64.zip ./android-ndk-r15b
diff --git a/ci/docker/x86_64-linux-android/Dockerfile b/ci/docker/x86_64-linux-android/Dockerfile
index dfc0c83dae923..0cfbc4820903a 100644
--- a/ci/docker/x86_64-linux-android/Dockerfile
+++ b/ci/docker/x86_64-linux-android/Dockerfile
@@ -17,7 +17,7 @@ RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
# We do not run x86_64-linux-android tests on an android emulator.
# See ci/android-sysimage.sh for informations about how tests are run.
COPY android-sysimage.sh /android/
-RUN bash /android/android-sysimage.sh x86_64 x86_64-21_r04.zip
+RUN bash /android/android-sysimage.sh x86_64 x86_64-24_r07.zip
ENV PATH=$PATH:/rust/bin:/android/ndk-$ANDROID_ARCH/bin \
CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER=x86_64-linux-android-gcc \
diff --git a/ci/run-docker.sh b/ci/run-docker.sh
old mode 100644
new mode 100755
diff --git a/src/unix/notbsd/android/b32/mod.rs b/src/unix/notbsd/android/b32/mod.rs
index 32f88e4987bac..f6b0f03d48d12 100644
--- a/src/unix/notbsd/android/b32/mod.rs
+++ b/src/unix/notbsd/android/b32/mod.rs
@@ -166,6 +166,9 @@ pub const UT_LINESIZE: usize = 8;
pub const UT_NAMESIZE: usize = 8;
pub const UT_HOSTSIZE: usize = 16;
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
+
extern {
pub fn bind(socket: ::c_int, address: *const ::sockaddr,
address_len: socklen_t) -> ::c_int;
diff --git a/src/unix/notbsd/android/b64/aarch64.rs b/src/unix/notbsd/android/b64/aarch64.rs
index 89c505d06f2e9..5771340250bfd 100644
--- a/src/unix/notbsd/android/b64/aarch64.rs
+++ b/src/unix/notbsd/android/b64/aarch64.rs
@@ -54,3 +54,6 @@ pub const O_DIRECTORY: ::c_int = 0x4000;
pub const O_NOFOLLOW: ::c_int = 0x8000;
pub const SYS_gettid: ::c_long = 178;
+
+pub const SIGSTKSZ: ::size_t = 16384;
+pub const MINSIGSTKSZ: ::size_t = 5120;
diff --git a/src/unix/notbsd/android/b64/x86_64.rs b/src/unix/notbsd/android/b64/x86_64.rs
index 58d07e104dba4..7e824ccce8cec 100644
--- a/src/unix/notbsd/android/b64/x86_64.rs
+++ b/src/unix/notbsd/android/b64/x86_64.rs
@@ -48,3 +48,6 @@ pub const O_DIRECTORY: ::c_int = 0x10000;
pub const O_NOFOLLOW: ::c_int = 0x20000;
pub const SYS_gettid: ::c_long = 186;
+
+pub const SIGSTKSZ: ::size_t = 8192;
+pub const MINSIGSTKSZ: ::size_t = 2048;
diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs
index d917647a94668..95e0fa295bfeb 100644
--- a/src/unix/notbsd/android/mod.rs
+++ b/src/unix/notbsd/android/mod.rs
@@ -173,6 +173,8 @@ pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
pub const EPOLLONESHOT: ::c_int = 0x40000000;
+pub const EPOLLRDHUP: ::c_int = 0x00002000;
+pub const EPOLLWAKEUP: ::c_int = 0x20000000;
pub const EFD_CLOEXEC: ::c_int = 0x80000;
@@ -428,7 +430,7 @@ pub const SOL_NETROM: ::c_int = 259;
pub const SOL_ROSE: ::c_int = 260;
#[doc(hidden)]
-pub const AF_MAX: ::c_int = 39;
+pub const AF_MAX: ::c_int = 43;
#[doc(hidden)]
pub const PF_MAX: ::c_int = AF_MAX;
@@ -458,6 +460,7 @@ pub const O_NONBLOCK: ::c_int = 2048;
pub const O_SYNC: ::c_int = 0x101000;
pub const O_ASYNC: ::c_int = 0x2000;
pub const O_NDELAY: ::c_int = 0x800;
+pub const O_DSYNC: ::c_int = 4096;
pub const NI_MAXHOST: ::size_t = 1025;
@@ -585,8 +588,6 @@ pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543;
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/src/unix/notbsd/linux/mips/mod.rs b/src/unix/notbsd/linux/mips/mod.rs
index b2ad107caedf9..0354c1e13b778 100644
--- a/src/unix/notbsd/linux/mips/mod.rs
+++ b/src/unix/notbsd/linux/mips/mod.rs
@@ -27,8 +27,6 @@ s! {
}
}
-pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
-
pub const SFD_CLOEXEC: ::c_int = 0x080000;
pub const NCCS: usize = 32;
diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs
index 40dd63f255b69..670402e723c82 100644
--- a/src/unix/notbsd/linux/mod.rs
+++ b/src/unix/notbsd/linux/mod.rs
@@ -1013,7 +1013,6 @@ extern {
timeout: ::c_int,
sigmask: *const ::sigset_t) -> ::c_int;
pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int;
- pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
pub fn mkostemps(template: *mut ::c_char,
suffixlen: ::c_int,
@@ -1023,15 +1022,6 @@ extern {
timeout: *const ::timespec) -> ::c_int;
pub fn sigwaitinfo(set: *const sigset_t,
info: *mut siginfo_t) -> ::c_int;
- pub fn openpty(amaster: *mut ::c_int,
- aslave: *mut ::c_int,
- name: *mut ::c_char,
- termp: *const termios,
- winp: *const ::winsize) -> ::c_int;
- pub fn forkpty(amaster: *mut ::c_int,
- name: *mut ::c_char,
- termp: *const termios,
- winp: *const ::winsize) -> ::pid_t;
pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
pub fn getnameinfo(sa: *const ::sockaddr,
salen: ::socklen_t,
@@ -1064,8 +1054,6 @@ extern {
pub fn reboot(how_to: ::c_int) -> ::c_int;
pub fn setfsgid(gid: ::gid_t) -> ::c_int;
pub fn setfsuid(uid: ::uid_t) -> ::c_int;
- pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
- pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
// Not available now on Android
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
diff --git a/src/unix/notbsd/linux/musl/mod.rs b/src/unix/notbsd/linux/musl/mod.rs
index b365028b76aca..fd0317cde8c52 100644
--- a/src/unix/notbsd/linux/musl/mod.rs
+++ b/src/unix/notbsd/linux/musl/mod.rs
@@ -87,8 +87,6 @@ s! {
}
}
-pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
-
pub const SFD_CLOEXEC: ::c_int = 0x080000;
pub const NCCS: usize = 32;
diff --git a/src/unix/notbsd/linux/other/b32/mod.rs b/src/unix/notbsd/linux/other/b32/mod.rs
index 8b8b1d5ac2fd5..12852b7606454 100644
--- a/src/unix/notbsd/linux/other/b32/mod.rs
+++ b/src/unix/notbsd/linux/other/b32/mod.rs
@@ -225,7 +225,6 @@ pub const TIOCMBIS: ::c_ulong = 0x5416;
pub const TIOCMBIC: ::c_ulong = 0x5417;
pub const TIOCMSET: ::c_ulong = 0x5418;
pub const TIOCCONS: ::c_ulong = 0x541D;
-pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
pub const SFD_CLOEXEC: ::c_int = 0x080000;
diff --git a/src/unix/notbsd/linux/other/b64/aarch64.rs b/src/unix/notbsd/linux/other/b64/aarch64.rs
index 705ae52fba431..83439609f320e 100644
--- a/src/unix/notbsd/linux/other/b64/aarch64.rs
+++ b/src/unix/notbsd/linux/other/b64/aarch64.rs
@@ -288,8 +288,6 @@ pub const TIOCMBIC: ::c_ulong = 0x5417;
pub const TIOCMSET: ::c_ulong = 0x5418;
pub const TIOCCONS: ::c_ulong = 0x541D;
-pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
-
pub const SFD_CLOEXEC: ::c_int = 0x080000;
pub const NCCS: usize = 32;
diff --git a/src/unix/notbsd/linux/other/b64/powerpc64.rs b/src/unix/notbsd/linux/other/b64/powerpc64.rs
index 7ff498d5f2b56..192b722e1a8bc 100644
--- a/src/unix/notbsd/linux/other/b64/powerpc64.rs
+++ b/src/unix/notbsd/linux/other/b64/powerpc64.rs
@@ -286,8 +286,6 @@ pub const TIOCMBIC: ::c_ulong = 0x5417;
pub const TIOCMSET: ::c_ulong = 0x5418;
pub const TIOCCONS: ::c_ulong = 0x541D;
-pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
-
pub const SFD_CLOEXEC: ::c_int = 0x080000;
pub const NCCS: usize = 32;
diff --git a/src/unix/notbsd/linux/other/b64/x86_64.rs b/src/unix/notbsd/linux/other/b64/x86_64.rs
index b5bddb6209642..a14924bede2ef 100644
--- a/src/unix/notbsd/linux/other/b64/x86_64.rs
+++ b/src/unix/notbsd/linux/other/b64/x86_64.rs
@@ -389,8 +389,6 @@ pub const TIOCMBIC: ::c_ulong = 0x5417;
pub const TIOCMSET: ::c_ulong = 0x5418;
pub const TIOCCONS: ::c_ulong = 0x541D;
-pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
-
pub const SFD_CLOEXEC: ::c_int = 0x080000;
pub const NCCS: usize = 32;
diff --git a/src/unix/notbsd/linux/s390x.rs b/src/unix/notbsd/linux/s390x.rs
index 1c0cd56d6f14c..4c893d5ac5042 100644
--- a/src/unix/notbsd/linux/s390x.rs
+++ b/src/unix/notbsd/linux/s390x.rs
@@ -273,8 +273,6 @@ s! {
}
}
-pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
-
pub const SFD_CLOEXEC: ::c_int = 0x080000;
pub const NCCS: usize = 32;
diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs
index e10d28b304d70..7df3c845918c4 100644
--- a/src/unix/notbsd/mod.rs
+++ b/src/unix/notbsd/mod.rs
@@ -703,6 +703,7 @@ pub const CLONE_NEWUSER: ::c_int = 0x10000000;
pub const CLONE_NEWPID: ::c_int = 0x20000000;
pub const CLONE_NEWNET: ::c_int = 0x40000000;
pub const CLONE_IO: ::c_int = 0x80000000;
+pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
pub const WNOHANG: ::c_int = 0x00000001;
pub const WUNTRACED: ::c_int = 0x00000002;
@@ -1007,8 +1008,20 @@ extern {
pub fn brk(addr: *mut ::c_void) -> ::c_int;
pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
pub fn vfork() -> ::pid_t;
+ pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
+ pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
+ pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
pub fn wait4(pid: ::pid_t, status: *mut ::c_int, options: ::c_int,
rusage: *mut ::rusage) -> ::pid_t;
+ pub fn openpty(amaster: *mut ::c_int,
+ aslave: *mut ::c_int,
+ name: *mut ::c_char,
+ termp: *const termios,
+ winp: *const ::winsize) -> ::c_int;
+ pub fn forkpty(amaster: *mut ::c_int,
+ name: *mut ::c_char,
+ termp: *const termios,
+ winp: *const ::winsize) -> ::pid_t;
}
cfg_if! {
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index b77b3161b2191..6ff46b2c16103 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -179,7 +179,6 @@ fn main() {
cfg.header("sys/shm.h");
cfg.header("sys/user.h");
cfg.header("sys/fsuid.h");
- cfg.header("pty.h");
cfg.header("shadow.h");
cfg.header("linux/input.h");
if x86_64 {
@@ -200,6 +199,7 @@ fn main() {
cfg.header("sys/syscall.h");
cfg.header("sys/personality.h");
cfg.header("sys/swap.h");
+ cfg.header("pty.h");
if !uclibc {
cfg.header("sys/sysinfo.h");
}
@@ -337,6 +337,11 @@ fn main() {
// definition. Because it's tested on other Linux targets, skip it.
"input_mask" if musl => true,
+ // These structs have changed since unified headers in NDK r14b.
+ // `st_atime` and `st_atime_nsec` have changed sign.
+ // FIXME: unskip it for next major release
+ "stat" | "stat64" if android => true,
+
_ => false
}
});
@@ -534,6 +539,16 @@ fn main() {
// On Mac we don't use the default `close()`, instead using their $NOCANCEL variants.
"close" if apple => true,
+ // Definition of those functions as changed since unified headers from NDK r14b
+ // These changes imply some API breaking changes but are still ABI compatible.
+ // We can wait for the next major release to be compliant with the new API.
+ // FIXME: unskip these for next major release
+ "strerror_r" | "madvise" | "msync" | "mprotect" | "recvfrom" | "getpriority" |
+ "setpriority" | "personality" if android => true,
+ // In Android 64 bits, these functions have been fixed since unified headers.
+ // Ignore these until next major version.
+ "bind" | "writev" | "readv" | "sendmsg" | "recvmsg" if android && (aarch64 || x86_64) => true,
+
_ => false,
}
});
|
Not up-to-date with latest Android NDK
When trying to build the nix crate for target arm-linux-androideabi (nix-rust/nix#313), it fails with some undefined symbols that are present in the latest Android NDK headers (some seem to be added in Android API 21).
Since nearly all the symbols are merged in the android/mod.rs, and I didn't figured out how they are organised, I find it hard to list exhaustively the missing symbols.
So I just list the ones that are needed for the nix crate with a link to the corresponding header in the current ndk:
- `O_DSYNC` ([asm-generic/fcntl.h](https://android.googlesource.com/platform/prebuilts/ndk/+/dev/platform/sysroot/usr/include/asm-generic/fcntl.h))
- `openpty` ([pty.h](https://android.googlesource.com/platform/prebuilts/ndk/+/dev/platform/sysroot/usr/include/pty.h)) (forkpty is missing too)
- `CLONE_NEWCGROUP` ([linux/sched.h](https://android.googlesource.com/platform/prebuilts/ndk/+/dev/platform/sysroot/usr/include/linux/sched.h))
- `EPOLLRDHUP` and `EPOLLWAKEUP` ([sys/epoll.h](https://android.googlesource.com/platform/prebuilts/ndk/+/dev/platform/sysroot/usr/include/sys/epoll.h))
- `sethostname`, `setresuid` and `setresgid` ([unistd.h](https://android.googlesource.com/platform/prebuilts/ndk/+/dev/platform/sysroot/usr/include/unistd.h))
I could make a PR for these symbols but I think that we should make a full update to match the latest ndk and I do not feel comfortable enough to figure out what should be done and how it should be organised in this crate.
|
Thanks for the report! We take PRs at any point to add new constants and such and you can also just update the [associated `Dockerfile`](https://github.com/rust-lang/libc/blob/master/ci/docker/arm-linux-androideabi/Dockerfile) to the latest ndk to ensure that CI passes.
I'm working on adding these constants but I face a problem I prefer to ask you how to handle.
Before ndk r14b, it seems some headers were not correctly updated ([changelog](https://developer.android.com/ndk/downloads/revision_history.html) - Headers in M and N were actually headers for L) so even if in r13b (the rev the test suite is using) there are headers for api-24, they were actually for api-21 (lollipop).
Since r14b, they [unified headers](https://android.googlesource.com/platform/ndk.git/+/ndk-r14-release/docs/UnifiedHeaders.md) with one headers set for all the platforms with some `#ifdef` to select the correct definition based on the API level.
Therefore, I wonder how we should implement constants or functions that have different signature based on the API level. For example, the `strerror_r` is defined like this:
```
#if defined(__USE_GNU) && __ANDROID_API__ >= 23
char* strerror_r(int, char*, size_t) __RENAME(__gnu_strerror_r) __INTRODUCED_IN(23);
#else /* POSIX */
int strerror_r(int, char*, size_t);
#endif
```
Do we always use the most recent definitions and discard older ones ?
|
2017-06-29T21:46:28Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 596
|
rust-lang__libc-596
|
[
"595"
] |
a285387a9e8fb010d310193f87a98800c94b3084
|
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index c2d1f10e40638..8d794e7459072 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -405,7 +405,9 @@ extern {
pub fn lchown(path: *const c_char, uid: uid_t,
gid: gid_t) -> ::c_int;
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
- link_name = "close$UNIX2003")]
+ link_name = "close$NOCANCEL$UNIX2003")]
+ #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"),
+ link_name = "close$NOCANCEL")]
pub fn close(fd: ::c_int) -> ::c_int;
pub fn dup(fd: ::c_int) -> ::c_int;
pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int;
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 61a0407768b14..b08bcce0d6dc9 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -500,7 +500,7 @@ fn main() {
"backtrace" |
"sysinfo" | "newlocale" | "duplocale" | "freelocale" | "uselocale" |
"nl_langinfo_l" | "wcslen" | "wcstombs" if uclibc => true,
-
+
// Apparently res_init exists on Android, but isn't defined in a header:
// https://mail.gnome.org/archives/commits-list/2013-May/msg01329.html
"res_init" if android => true,
@@ -511,6 +511,9 @@ fn main() {
// https://github.com/rust-lang/libc/pull/585#discussion_r114561460
"res_init" if apple => true,
+ // On Mac we don't use the default `close()`, instead using their $NOCANCEL variants.
+ "close" if apple => true,
+
_ => false,
}
});
|
plain libc close(fd) is unreliable on MacOSX
Should probably switch to the methods reccomended here
lionheart/openradar-mirror#4506
**An alternative version available on Mac OS X, close$NOCANCEL$UNIX2003 (32-bit x86) and close$NOCANCEL (x86_64) is available.**
|
Oops, just saw its being used!
https://github.com/rust-lang/libc/blob/19f3be3638322e343f90c50ec8d30de9e4972940/src/unix/mod.rs
Line 407, so its all good.
Oops, looks like it reccomends the NOCANCEL variant, so reopening
Oh seems like a great thing to change! Do you know the version compatibility for this symbol? For us it just needs to be present on OSX 10.7+ to use it everywhere, if it's available on less OS-es we'll just have to tread more carefully.
Sorry I am no mac expert. Just working on a rust serial lib.
https://codereview.chromium.org/23455051/
According to this chromium bug it's at least available 3 years ago.
On Tue, May 16, 2017, 16:41 Alex Crichton <notifications@github.com> wrote:
> Oh seems like a great thing to change! Do you know the version
> compatibility for this symbol? For us it just needs to be present on OSX
> 10.7+ to use it everywhere, if it's available on less OS-es we'll just have
> to tread more carefully.
>
> —
> You are receiving this because you modified the open/close state.
> Reply to this email directly, view it on GitHub
> <https://github.com/rust-lang/libc/issues/595#issuecomment-301945022>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AA50lvaF31YQQjON_3aF84qTj4RvwPXFks5r6jRDgaJpZM4Nc1qa>
> .
>
--
Daniel Joyce
The meek shall inherit the Earth, for the brave will be among the stars.
@alexcrichton Is linking done as part of compilation or testing of `libc`? I can set the link name to anything and the build succeeds on my mac. But at least on my Mac that's running 10.9.5 the functions exist.
Nah unfortunately we don't have many OSX 10.7 machines to test on. Also to be clear it's still possible to update what `libc` itself uses without impacting rust-lang/rust. We'd just not use `libc::close` in that case. I'd just like to be aware of the verison compatibility of this symbol
@alexcrichton I think we're in the clear. I believe `$NOCANCEL` variants were added in 10.6 according to [this source](https://github.com/nanomsg/nanomsg/issues/148#issuecomment-24821448).
Awesome! In that case sounds like a PR would work marvelously here
@DanielJoyce Interested in taking the lead on this, otherwise I can get to this today.
Pretty busy today.
On Thu, May 18, 2017, 08:42 Susurrus <notifications@github.com> wrote:
> @DanielJoyce <https://github.com/danieljoyce> Interested in taking the
> lead on this, otherwise I can get to this today.
>
> —
> You are receiving this because you were mentioned.
>
>
> Reply to this email directly, view it on GitHub
> <https://github.com/rust-lang/libc/issues/595#issuecomment-302444672>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AA50lgR8t5V_J2ObUHRvmrI4Bx7PjwDXks5r7Gb5gaJpZM4Nc1qa>
> .
>
--
Daniel Joyce
The meek shall inherit the Earth, for the brave will be among the stars.
Then I'll go ahead and take care of this.
|
2017-05-18T17:10:47Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 538
|
rust-lang__libc-538
|
[
"536"
] |
5dd2f3917b3fa842c9c423850a9060dfcfdd916d
|
diff --git a/.travis.yml b/.travis.yml
index 3172a6fd69f9e..93236a8d0c6a2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -51,6 +51,12 @@ matrix:
- os: linux
env: TARGET=arm-linux-androideabi
rust: stable
+ - os: linux
+ env: TARGET=aarch64-linux-android
+ rust: stable
+ - os: linux
+ env: TARGET=i686-linux-android
+ rust: stable
- os: linux
env: TARGET=x86_64-unknown-linux-musl
rust: stable
diff --git a/ci/docker/arm-linux-androideabi/accept-licenses.sh b/ci/android-accept-licenses.sh
similarity index 100%
rename from ci/docker/arm-linux-androideabi/accept-licenses.sh
rename to ci/android-accept-licenses.sh
diff --git a/ci/docker/arm-linux-androideabi/install-ndk.sh b/ci/android-install-ndk.sh
similarity index 81%
rename from ci/docker/arm-linux-androideabi/install-ndk.sh
rename to ci/android-install-ndk.sh
index 566a3191848a3..75bcd20f2f77d 100644
--- a/ci/docker/arm-linux-androideabi/install-ndk.sh
+++ b/ci/android-install-ndk.sh
@@ -13,9 +13,24 @@ set -ex
curl -O https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
unzip -q android-ndk-r13b-linux-x86_64.zip
+
+case "$1" in
+ aarch64)
+ arch=arm64
+ ;;
+
+ i686)
+ arch=x86
+ ;;
+
+ *)
+ arch=$1
+ ;;
+esac;
+
android-ndk-r13b/build/tools/make_standalone_toolchain.py \
- --install-dir /android/ndk-arm \
- --arch arm \
+ --install-dir /android/ndk-$1 \
+ --arch $arch \
--api 24
rm -rf ./android-ndk-r13b-linux-x86_64.zip ./android-ndk-r13b
diff --git a/ci/docker/arm-linux-androideabi/install-sdk.sh b/ci/android-install-sdk.sh
similarity index 61%
rename from ci/docker/arm-linux-androideabi/install-sdk.sh
rename to ci/android-install-sdk.sh
index 3f20837fe061a..0762dcb45d0b7 100644
--- a/ci/docker/arm-linux-androideabi/install-sdk.sh
+++ b/ci/android-install-sdk.sh
@@ -19,15 +19,35 @@ set -ex
# which apparently magically accepts the licenses.
mkdir sdk
-curl https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz | \
- tar xzf - -C sdk --strip-components=1
+curl https://dl.google.com/android/repository/tools_r25.2.5-linux.zip -O
+unzip -d sdk tools_r25.2.5-linux.zip
-filter="platform-tools,android-21"
-filter="$filter,sys-img-armeabi-v7a-android-21"
+filter="platform-tools,android-24"
-./accept-licenses.sh "android - update sdk -a --no-ui --filter $filter"
+case "$1" in
+ arm | armv7)
+ abi=armeabi-v7a
+ ;;
+
+ aarch64)
+ abi=arm64-v8a
+ ;;
+
+ i686)
+ abi=x86
+ ;;
+
+ *)
+ echo "invalid arch: $1"
+ exit 1
+ ;;
+esac;
+
+filter="$filter,sys-img-$abi-android-24"
+
+./android-accept-licenses.sh "android - update sdk -a --no-ui --filter $filter"
echo "no" | android create avd \
- --name arm-21 \
- --target android-21 \
- --abi armeabi-v7a
+ --name $1 \
+ --target android-24 \
+ --abi $abi
diff --git a/ci/docker/aarch64-linux-android/Dockerfile b/ci/docker/aarch64-linux-android/Dockerfile
new file mode 100644
index 0000000000000..7ad84926bf82b
--- /dev/null
+++ b/ci/docker/aarch64-linux-android/Dockerfile
@@ -0,0 +1,32 @@
+FROM ubuntu:16.04
+
+RUN dpkg --add-architecture i386 && \
+ apt-get update && \
+ apt-get install -y --no-install-recommends \
+ file \
+ curl \
+ ca-certificates \
+ python \
+ unzip \
+ expect \
+ openjdk-9-jre \
+ libstdc++6:i386 \
+ libpulse0 \
+ gcc \
+ libc6-dev
+
+WORKDIR /android/
+COPY android* /android/
+
+ENV ANDROID_ARCH=aarch64
+ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools
+
+RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
+RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
+RUN mv /root/.android /tmp
+RUN chmod 777 -R /tmp/.android
+RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
+
+ENV PATH=$PATH:/rust/bin \
+ CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android-gcc \
+ HOME=/tmp
diff --git a/ci/docker/arm-linux-androideabi/Dockerfile b/ci/docker/arm-linux-androideabi/Dockerfile
index 1911fbd87970e..054941416dfb5 100644
--- a/ci/docker/arm-linux-androideabi/Dockerfile
+++ b/ci/docker/arm-linux-androideabi/Dockerfile
@@ -11,24 +11,22 @@ RUN dpkg --add-architecture i386 && \
expect \
openjdk-9-jre \
libstdc++6:i386 \
+ libpulse0 \
gcc \
libc6-dev
WORKDIR /android/
+COPY android* /android/
-COPY install-ndk.sh /android/
-RUN sh /android/install-ndk.sh
+ENV ANDROID_ARCH=arm
+ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools
-ENV PATH=$PATH:/android/ndk-arm/bin:/android/sdk/tools:/android/sdk/platform-tools
-
-COPY install-sdk.sh accept-licenses.sh /android/
-RUN sh /android/install-sdk.sh
+RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
+RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
+RUN mv /root/.android /tmp
+RUN chmod 777 -R /tmp/.android
+RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \
- ANDROID_EMULATOR_FORCE_32BIT=1 \
HOME=/tmp
-RUN chmod 755 /android/sdk/tools/*
-
-RUN cp -r /root/.android /tmp
-RUN chmod 777 -R /tmp/.android
diff --git a/ci/docker/i686-linux-android/Dockerfile b/ci/docker/i686-linux-android/Dockerfile
new file mode 100644
index 0000000000000..bee904379645f
--- /dev/null
+++ b/ci/docker/i686-linux-android/Dockerfile
@@ -0,0 +1,32 @@
+FROM ubuntu:16.04
+
+RUN dpkg --add-architecture i386 && \
+ apt-get update && \
+ apt-get install -y --no-install-recommends \
+ file \
+ curl \
+ ca-certificates \
+ python \
+ unzip \
+ expect \
+ openjdk-9-jre \
+ libstdc++6:i386 \
+ libpulse0 \
+ gcc \
+ libc6-dev
+
+WORKDIR /android/
+COPY android* /android/
+
+ENV ANDROID_ARCH=i686
+ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools
+
+RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
+RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
+RUN mv /root/.android /tmp
+RUN chmod 777 -R /tmp/.android
+RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
+
+ENV PATH=$PATH:/rust/bin \
+ CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android-gcc \
+ HOME=/tmp
diff --git a/ci/run-docker.sh b/ci/run-docker.sh
index a7702ae1dc512..1ac419a349c08 100644
--- a/ci/run-docker.sh
+++ b/ci/run-docker.sh
@@ -5,7 +5,8 @@ set -ex
run() {
echo $1
- docker build -t libc ci/docker/$1
+ # use -f so we can use ci/ as build context
+ docker build -t libc -f ci/docker/$1/Dockerfile ci/
mkdir -p target
docker run \
--user `id -u`:`id -g` \
diff --git a/ci/run.sh b/ci/run.sh
index d33af30fd91c7..1b6e0fb1d4549 100755
--- a/ci/run.sh
+++ b/ci/run.sh
@@ -105,11 +105,16 @@ case "$TARGET" in
esac
case "$TARGET" in
- arm-linux-androideabi)
- emulator @arm-21 -no-window &
+ arm-linux-androideabi | aarch64-linux-android | i686-linux-android)
+ # set SHELL so android can detect a 64bits system, see
+ # http://stackoverflow.com/a/41789144
+ # https://issues.jenkins-ci.org/browse/JENKINS-26930?focusedCommentId=230791&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-230791
+ export SHELL=/bin/dash
+ arch=$(echo $TARGET | cut -d- -f1)
+ emulator @$arch -no-window -no-accel &
adb wait-for-device
- adb push $CARGO_TARGET_DIR/$TARGET/debug/libc-test /data/libc-test
- adb shell /data/libc-test 2>&1 | tee /tmp/out
+ adb push $CARGO_TARGET_DIR/$TARGET/debug/libc-test /data/local/tmp/libc-test
+ adb shell /data/local/tmp/libc-test 2>&1 | tee /tmp/out
grep "^PASSED .* tests" /tmp/out
;;
diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs
index 2f7024f8276a0..826bd9288bd53 100644
--- a/src/unix/bsd/mod.rs
+++ b/src/unix/bsd/mod.rs
@@ -1,4 +1,4 @@
-use dox::mem;
+use dox::{mem, Option};
pub type c_char = i8;
pub type wchar_t = i32;
@@ -359,6 +359,75 @@ extern {
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")]
+ 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;
+ #[cfg_attr(target_os = "netbsd", link_name = "__globfree30")]
+ 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 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")]
+ 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")]
+ pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
+ 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(target_os = "netbsd", link_name = "__msync13")]
+ 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;
+ pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
+ 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_if! {
diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs
index 634805ca2ee70..c4b446769bf61 100644
--- a/src/unix/haiku/mod.rs
+++ b/src/unix/haiku/mod.rs
@@ -1,4 +1,4 @@
-use dox::mem;
+use dox::{mem, Option};
pub type rlim_t = ::uintptr_t;
pub type sa_family_t = u8;
@@ -760,6 +760,49 @@ extern {
abstime: *const ::timespec) -> ::c_int;
pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t,
options: ::c_int) -> ::c_int;
+
+ 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 globfree(pglob: *mut ::glob_t);
+
+ 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;
+
+ pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+
+ 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 msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+
+ 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;
+ pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
+ pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+
+ pub fn bind(socket: ::c_int, address: *const ::sockaddr,
+ address_len: ::socklen_t) -> ::c_int;
+
+ pub fn writev(fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int) -> ::ssize_t;
+ pub fn readv(fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int) -> ::ssize_t;
+
+ pub fn sendmsg(fd: ::c_int,
+ msg: *const ::msghdr,
+ flags: ::c_int) -> ::ssize_t;
+ pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
+ -> ::ssize_t;
}
cfg_if! {
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index 3030f80e095c7..9b39050e6cc17 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -274,10 +274,6 @@ extern {
link_name = "connect$UNIX2003")]
pub fn connect(socket: ::c_int, address: *const sockaddr,
len: socklen_t) -> ::c_int;
- #[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 = "listen$UNIX2003")]
pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int;
@@ -681,16 +677,6 @@ extern {
#[cfg_attr(target_os = "netbsd", link_name = "__mknod50")]
pub fn mknod(pathname: *const ::c_char, mode: ::mode_t,
dev: ::dev_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;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
@@ -710,14 +696,6 @@ extern {
link_name = "putenv$UNIX2003")]
#[cfg_attr(target_os = "netbsd", link_name = "__putenv50")]
pub fn putenv(string: *mut c_char) -> ::c_int;
- #[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 = "poll$UNIX2003")]
pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int;
@@ -751,58 +729,12 @@ extern {
-> ::c_int;
pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int;
pub fn fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int;
-}
-
-// TODO: get rid of this cfg(not(...))
-#[cfg(not(target_os = "android"))] // " if " -- appease style checker
-extern {
- #[cfg_attr(target_os = "macos", link_name = "glob$INODE64")]
- #[cfg_attr(target_os = "netbsd", link_name = "__glob30")]
- 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;
- #[cfg_attr(target_os = "netbsd", link_name = "__globfree30")]
- 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 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")]
- 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")]
- pub fn telldir(dirp: *mut ::DIR) -> c_long;
- pub fn getsid(pid: pid_t) -> pid_t;
- pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
- -> ::c_int;
pub fn readlink(path: *const c_char,
buf: *mut c_char,
bufsz: ::size_t)
-> ::ssize_t;
- #[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 sysconf(name: ::c_int) -> c_long;
- #[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 mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;
-
#[cfg_attr(target_os = "netbsd", link_name = "__sigemptyset14")]
pub fn sigemptyset(set: *mut sigset_t) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__sigaddset14")]
@@ -813,6 +745,16 @@ extern {
pub fn sigdelset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__sigismember14")]
pub fn sigismember(set: *const sigset_t, signum: ::c_int) -> ::c_int;
+
+ #[cfg_attr(target_os = "netbsd", link_name = "__timegm50")]
+ pub fn timegm(tm: *mut ::tm) -> time_t;
+
+ pub fn getsid(pid: pid_t) -> pid_t;
+
+ pub fn sysconf(name: ::c_int) -> ::c_long;
+
+ pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;
+
#[cfg_attr(all(target_os = "macos", target_arch = "x86_64"),
link_name = "pselect$1050")]
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
@@ -828,8 +770,6 @@ extern {
offset: ::off_t,
whence: ::c_int) -> ::c_int;
pub fn ftello(stream: *mut ::FILE) -> ::off_t;
- #[cfg_attr(target_os = "netbsd", link_name = "__timegm50")]
- pub fn timegm(tm: *mut ::tm) -> time_t;
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
link_name = "tcdrain$UNIX2003")]
pub fn tcdrain(fd: ::c_int) -> ::c_int;
@@ -847,11 +787,9 @@ extern {
pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int;
pub fn tcsendbreak(fd: ::c_int, duration: ::c_int) -> ::c_int;
pub fn mkstemp(template: *mut ::c_char) -> ::c_int;
- pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
pub fn mkdtemp(template: *mut ::c_char) -> *mut ::c_char;
+
pub fn tmpnam(ptr: *mut ::c_char) -> *mut ::c_char;
- pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
- pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
pub fn openlog(ident: *const ::c_char, logopt: ::c_int, facility: ::c_int);
pub fn closelog();
diff --git a/src/unix/notbsd/android/b32/arm.rs b/src/unix/notbsd/android/b32/arm.rs
new file mode 100644
index 0000000000000..1c9d033d17dba
--- /dev/null
+++ b/src/unix/notbsd/android/b32/arm.rs
@@ -0,0 +1,6 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+
+pub const O_DIRECT: ::c_int = 0x10000;
+pub const O_DIRECTORY: ::c_int = 0x4000;
+pub const O_NOFOLLOW: ::c_int = 0x8000;
diff --git a/src/unix/notbsd/android/b32.rs b/src/unix/notbsd/android/b32/mod.rs
similarity index 76%
rename from src/unix/notbsd/android/b32.rs
rename to src/unix/notbsd/android/b32/mod.rs
index bd69ccf37d571..9efcd61c726ec 100644
--- a/src/unix/notbsd/android/b32.rs
+++ b/src/unix/notbsd/android/b32/mod.rs
@@ -2,6 +2,9 @@ pub type c_long = i32;
pub type c_ulong = u32;
pub type mode_t = u16;
pub type off64_t = ::c_longlong;
+pub type sigset_t = ::c_ulong;
+pub type socklen_t = i32;
+pub type time64_t = i64;
s! {
pub struct sigaction {
@@ -11,6 +14,11 @@ s! {
pub sa_restorer: ::dox::Option<extern fn()>,
}
+ pub struct rlimit64 {
+ pub rlim_cur: u64,
+ pub rlim_max: u64,
+ }
+
pub struct stat {
pub st_dev: ::c_ulonglong,
__pad0: [::c_uchar; 4],
@@ -121,6 +129,15 @@ s! {
}
}
+pub const RTLD_GLOBAL: ::c_int = 2;
+pub const RTLD_NOW: ::c_int = 0;
+pub const RTLD_DEFAULT: *mut ::c_void = -1isize as *mut ::c_void;
+
+pub const PTRACE_GETFPREGS: ::c_int = 14;
+pub const PTRACE_SETFPREGS: ::c_int = 15;
+pub const PTRACE_GETREGS: ::c_int = 12;
+pub const PTRACE_SETREGS: ::c_int = 13;
+
pub const SYS_gettid: ::c_long = 224;
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
value: 0,
@@ -147,5 +164,33 @@ pub const UT_NAMESIZE: usize = 8;
pub const UT_HOSTSIZE: usize = 16;
extern {
+ pub fn bind(socket: ::c_int, address: *const ::sockaddr,
+ address_len: socklen_t) -> ::c_int;
+
+ pub fn writev(fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int) -> ::ssize_t;
+ pub fn readv(fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int) -> ::ssize_t;
+
+ pub fn sendmsg(fd: ::c_int,
+ msg: *const ::msghdr,
+ flags: ::c_int) -> ::ssize_t;
+ pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
+ -> ::ssize_t;
+
pub fn timegm64(tm: *const ::tm) -> ::time64_t;
}
+
+cfg_if! {
+ if #[cfg(target_arch = "x86")] {
+ mod x86;
+ pub use self::x86::*;
+ } else if #[cfg(target_arch = "arm")] {
+ mod arm;
+ pub use self::arm::*;
+ } else {
+ // Unknown target_arch
+ }
+}
diff --git a/src/unix/notbsd/android/b32/x86.rs b/src/unix/notbsd/android/b32/x86.rs
new file mode 100644
index 0000000000000..c4b8197de55bc
--- /dev/null
+++ b/src/unix/notbsd/android/b32/x86.rs
@@ -0,0 +1,6 @@
+pub type c_char = i8;
+pub type wchar_t = i32;
+
+pub const O_DIRECT: ::c_int = 0x4000;
+pub const O_DIRECTORY: ::c_int = 0x10000;
+pub const O_NOFOLLOW: ::c_int = 0x20000;
diff --git a/src/unix/notbsd/android/b64.rs b/src/unix/notbsd/android/b64/mod.rs
similarity index 75%
rename from src/unix/notbsd/android/b64.rs
rename to src/unix/notbsd/android/b64/mod.rs
index b35dde4216059..31a05d657c55e 100644
--- a/src/unix/notbsd/android/b64.rs
+++ b/src/unix/notbsd/android/b64/mod.rs
@@ -1,11 +1,18 @@
// The following definitions are correct for aarch64 and may be wrong for x86_64
+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 {
+ __val: [::c_ulong; 1],
+ }
+
pub struct sigaction {
pub sa_flags: ::c_uint,
pub sa_sigaction: ::sighandler_t,
@@ -13,6 +20,11 @@ s! {
_restorer: *mut ::c_void,
}
+ pub struct rlimit64 {
+ pub rlim_cur: ::c_ulonglong,
+ pub rlim_max: ::c_ulonglong,
+ }
+
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
@@ -131,6 +143,14 @@ 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,
@@ -156,6 +176,27 @@ pub const UT_LINESIZE: usize = 32;
pub const UT_NAMESIZE: usize = 32;
pub const UT_HOSTSIZE: usize = 256;
+// Some weirdness in Android
extern {
- pub fn timegm(tm: *const ::tm) -> ::time64_t;
+ // address_len should be socklen_t, but it is c_int!
+ pub fn bind(socket: ::c_int, address: *const ::sockaddr,
+ address_len: ::c_int) -> ::c_int;
+
+ // the return type should be ::ssize_t, but it is c_int!
+ pub fn writev(fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int) -> ::c_int;
+
+ // the return type should be ::ssize_t, but it is c_int!
+ pub fn readv(fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int) -> ::c_int;
+
+ // the return type should be ::ssize_t, but it is c_int!
+ pub fn sendmsg(fd: ::c_int,
+ msg: *const ::msghdr,
+ flags: ::c_int) -> ::c_int;
+
+ // 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;
}
diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs
index 3884a770786e1..57eda11e7e46b 100644
--- a/src/unix/notbsd/android/mod.rs
+++ b/src/unix/notbsd/android/mod.rs
@@ -2,22 +2,17 @@
use dox::mem;
-pub type c_char = u8;
pub type clock_t = ::c_long;
pub type time_t = ::c_long;
pub type suseconds_t = ::c_long;
-pub type wchar_t = u32;
pub type off_t = ::c_long;
pub type blkcnt_t = ::c_ulong;
pub type blksize_t = ::c_ulong;
pub type nlink_t = u32;
pub type useconds_t = u32;
-pub type socklen_t = i32;
pub type pthread_t = ::c_long;
pub type pthread_mutexattr_t = ::c_long;
pub type pthread_condattr_t = ::c_long;
-pub type sigset_t = ::c_ulong;
-pub type time64_t = i64; // N/A on android
pub type fsfilcnt_t = ::c_ulong;
pub type fsblkcnt_t = ::c_ulong;
pub type nfds_t = ::c_uint;
@@ -44,11 +39,6 @@ s! {
pub d_name: [::c_char; 256],
}
- pub struct rlimit64 {
- pub rlim_cur: u64,
- pub rlim_max: u64,
- }
-
pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_flags: ::c_int,
@@ -60,6 +50,7 @@ s! {
pub si_errno: ::c_int,
pub si_code: ::c_int,
pub _pad: [::c_int; 29],
+ _align: [usize; 0],
}
pub struct __fsid_t {
@@ -68,7 +59,7 @@ s! {
pub struct msghdr {
pub msg_name: *mut ::c_void,
- pub msg_namelen: ::c_int,
+ pub msg_namelen: ::socklen_t,
pub msg_iov: *mut ::iovec,
pub msg_iovlen: ::size_t,
pub msg_control: *mut ::c_void,
@@ -108,6 +99,8 @@ s! {
pub struct sem_t {
count: ::c_uint,
+ #[cfg(target_pointer_width = "64")]
+ __reserved: [::c_int; 3],
}
pub struct lastlog {
@@ -149,6 +142,8 @@ s! {
pub f_fsid: ::c_ulong,
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
+ #[cfg(target_pointer_width = "64")]
+ __f_reserved: [u32; 6],
}
}
@@ -447,9 +442,6 @@ pub const O_EXCL: ::c_int = 128;
pub const O_NOCTTY: ::c_int = 256;
pub const O_NONBLOCK: ::c_int = 2048;
pub const O_SYNC: ::c_int = 0x101000;
-pub const O_DIRECT: ::c_int = 0x10000;
-pub const O_DIRECTORY: ::c_int = 0x4000;
-pub const O_NOFOLLOW: ::c_int = 0x8000;
pub const O_ASYNC: ::c_int = 0x2000;
pub const O_NDELAY: ::c_int = 0x800;
@@ -517,10 +509,6 @@ pub const PTRACE_SETOPTIONS: ::c_int = 0x4200;
pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201;
pub const PTRACE_GETSIGINFO: ::c_int = 0x4202;
pub const PTRACE_SETSIGINFO: ::c_int = 0x4203;
-pub const PTRACE_GETFPREGS: ::c_int = 14;
-pub const PTRACE_SETFPREGS: ::c_int = 15;
-pub const PTRACE_GETREGS: ::c_int = 12;
-pub const PTRACE_SETREGS: ::c_int = 13;
pub const EFD_NONBLOCK: ::c_int = 0x800;
@@ -562,10 +550,7 @@ pub const TIOCMSET: ::c_int = 0x5418;
pub const FIONREAD: ::c_int = 0x541B;
pub const TIOCCONS: ::c_int = 0x541D;
-pub const RTLD_GLOBAL: ::c_int = 0x2;
pub const RTLD_NOLOAD: ::c_int = 0x4;
-pub const RTLD_NOW: ::c_int = 0;
-pub const RTLD_DEFAULT: *mut ::c_void = -1isize as *mut ::c_void;
pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
@@ -727,74 +712,6 @@ pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER);
pub const SIGEV_THREAD_ID: ::c_int = 4;
f! {
- pub fn sigemptyset(set: *mut sigset_t) -> ::c_int {
- *set = 0;
- return 0
- }
- pub fn sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int {
- *set |= signum as sigset_t;
- return 0
- }
- pub fn sigfillset(set: *mut sigset_t) -> ::c_int {
- *set = !0;
- return 0
- }
- pub fn sigdelset(set: *mut sigset_t, signum: ::c_int) -> ::c_int {
- *set &= !(signum as sigset_t);
- return 0
- }
- pub fn sigismember(set: *const sigset_t, signum: ::c_int) -> ::c_int {
- (*set & (signum as sigset_t)) as ::c_int
- }
- pub fn cfgetispeed(termios: *const ::termios) -> ::speed_t {
- (*termios).c_cflag & ::CBAUD
- }
- pub fn cfgetospeed(termios: *const ::termios) -> ::speed_t {
- (*termios).c_cflag & ::CBAUD
- }
- pub fn cfmakeraw(termios: *mut ::termios) -> () {
- (*termios).c_iflag &= !(::IGNBRK | ::BRKINT | ::PARMRK | ::ISTRIP |
- ::INLCR | ::IGNCR | ::ICRNL | ::IXON);
- (*termios).c_oflag &= !::OPOST;
- (*termios).c_lflag &= !(::ECHO | ::ECHONL | ::ICANON | ::ISIG |
- ::IEXTEN);
- (*termios).c_cflag &= !(::CSIZE | ::PARENB);
- (*termios).c_cflag |= ::CS8;
- ()
- }
- pub fn cfsetispeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int {
- let cbaud = ::CBAUD;
- (*termios).c_cflag = ((*termios).c_cflag & !cbaud) | (speed & cbaud);
- return 0
- }
- pub fn cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int {
- let cbaud = ::CBAUD;
- (*termios).c_cflag = ((*termios).c_cflag & !cbaud) | (speed & cbaud);
- return 0
- }
- pub fn cfsetspeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int {
- let cbaud = ::CBAUD;
- (*termios).c_cflag = ((*termios).c_cflag & !cbaud) | (speed & cbaud);
- return 0
- }
- pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int {
- ioctl(fd, ::TCGETS, termios)
- }
- pub fn tcsetattr(fd: ::c_int,
- optional_actions: ::c_int,
- termios: *const ::termios) -> ::c_int {
- ioctl(fd, optional_actions, termios)
- }
- pub fn tcflow(fd: ::c_int, action: ::c_int) -> ::c_int {
- ioctl(fd, ::TCXONC, action as *mut ::c_void)
- }
- pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int {
- ioctl(fd, ::TCFLSH, action as *mut ::c_void)
- }
- pub fn tcsendbreak(fd: ::c_int, duration: ::c_int) -> ::c_int {
- ioctl(fd, TCSBRKP, duration as *mut ::c_void)
- }
-
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
for slot in cpuset.__bits.iter_mut() {
*slot = 0;
@@ -834,15 +751,10 @@ extern {
pub fn madvise(addr: *const ::c_void, len: ::size_t, advice: ::c_int)
-> ::c_int;
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
- pub fn readlink(path: *const ::c_char,
- buf: *mut ::c_char,
- bufsz: ::size_t)
- -> ::c_int;
pub fn msync(addr: *const ::c_void, len: ::size_t,
flags: ::c_int) -> ::c_int;
pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int)
-> ::c_int;
- pub fn sysconf(name: ::c_int) -> ::c_long;
pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
flags: ::c_int, addr: *const ::sockaddr,
addrlen: *mut ::socklen_t) -> ::ssize_t;
diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs
index fd8fffe77c319..248ea50b411fc 100644
--- a/src/unix/notbsd/linux/mod.rs
+++ b/src/unix/notbsd/linux/mod.rs
@@ -1,6 +1,6 @@
//! Linux-specific definitions for linux-like values
-use dox::mem;
+use dox::{mem, Option};
pub type useconds_t = u32;
pub type dev_t = u64;
@@ -900,6 +900,49 @@ extern {
new_len: ::size_t,
flags: ::c_int,
...) -> *mut ::c_void;
+
+ 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 globfree(pglob: *mut ::glob_t);
+
+ 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;
+
+ pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+
+ 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 msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+
+ 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;
+ pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
+ pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+
+ pub fn bind(socket: ::c_int, address: *const ::sockaddr,
+ address_len: ::socklen_t) -> ::c_int;
+
+ pub fn writev(fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int) -> ::ssize_t;
+ pub fn readv(fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int) -> ::ssize_t;
+
+ pub fn sendmsg(fd: ::c_int,
+ msg: *const ::msghdr,
+ flags: ::c_int) -> ::ssize_t;
+ pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
+ -> ::ssize_t;
}
cfg_if! {
diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs
index 9f8d8e56f57f3..9f9e8cd08231d 100644
--- a/src/unix/notbsd/mod.rs
+++ b/src/unix/notbsd/mod.rs
@@ -120,7 +120,9 @@ s! {
pub dli_saddr: *mut ::c_void,
}
- #[cfg_attr(any(all(target_arch = "x86", not(target_env = "musl")),
+ #[cfg_attr(any(all(target_arch = "x86",
+ not(target_env = "musl"),
+ not(target_os = "android")),
target_arch = "x86_64"),
repr(packed))]
pub struct epoll_event {
diff --git a/src/unix/solaris/mod.rs b/src/unix/solaris/mod.rs
index 1800a4cb433c6..55ac0a276dbe9 100644
--- a/src/unix/solaris/mod.rs
+++ b/src/unix/solaris/mod.rs
@@ -1,4 +1,4 @@
-use dox::mem;
+use dox::{mem, Option};
pub type c_char = i8;
pub type c_long = i64;
@@ -1094,4 +1094,48 @@ extern {
abstime: *const ::timespec) -> ::c_int;
pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t,
options: ::c_int) -> ::c_int;
+
+ 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 globfree(pglob: *mut ::glob_t);
+
+ 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;
+
+ pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+
+ 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 msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+
+ 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;
+ pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
+ pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+
+ pub fn bind(socket: ::c_int, address: *const ::sockaddr,
+ address_len: ::socklen_t) -> ::c_int;
+
+ pub fn writev(fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int) -> ::ssize_t;
+ pub fn readv(fd: ::c_int,
+ iov: *const ::iovec,
+ iovcnt: ::c_int) -> ::ssize_t;
+
+ pub fn sendmsg(fd: ::c_int,
+ msg: *const ::msghdr,
+ flags: ::c_int) -> ::ssize_t;
+ pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
+ -> ::ssize_t;
}
|
diff --git a/libc-test/build.rs b/libc-test/build.rs
index a0390522574e9..4ebba509e19b0 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -6,6 +6,7 @@ use std::env;
fn main() {
let target = env::var("TARGET").unwrap();
+ let aarch64 = target.contains("aarch64");
let x86_64 = target.contains("x86_64");
let windows = target.contains("windows");
let mingw = target.contains("windows-gnu");
@@ -105,8 +106,12 @@ fn main() {
}
if android {
+ if !aarch64 {
+ // time64_t is not define for aarch64
+ // If included it will generate the error 'Your time_t is already 64-bit'
+ cfg.header("time64.h");
+ }
cfg.header("arpa/inet.h");
- cfg.header("time64.h");
cfg.header("xlocale.h");
cfg.header("utmp.h");
} else if !windows {
|
Add tests for others android platforms
The libc-test runs for arm-linux-android. It would be great if it were also run for aarch64-linux-android and i686-linux-android.
|
@alexcrichton I have a local git branch that add tests for these platforms. I had to update the android sdk from 24.4.1 to 25.2.5 (last version) to run aarch64 tests. Some tests are failing, I will try to fix them.
Would you accept such PR?
Should I have one container for each platform, or just one container? The container's size with the three platforms are about 15GB. Is it a problem?
I'd love to add more platforms! PRs are of course always welcome :)
And yeah for now let's stick to a container-per-platform, and size shouldn't be a problem (I think the current image is huge)
|
2017-02-24T20:18:36Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
rust-lang/libc
| 274
|
rust-lang__libc-274
|
[
"273"
] |
e2af62369866a41b553ca171c5471fd064feb998
|
diff --git a/Cargo.toml b/Cargo.toml
index 278adbaa47d12..3faf83f87cfda 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "libc"
-version = "0.2.10"
+version = "0.2.11"
authors = ["The Rust Project Developers"]
license = "MIT/Apache-2.0"
readme = "README.md"
|
diff --git a/libc-test/Cargo.lock b/libc-test/Cargo.lock
index d92849db192a4..e2b6664a90aa9 100644
--- a/libc-test/Cargo.lock
+++ b/libc-test/Cargo.lock
@@ -3,7 +3,7 @@ name = "libc-test"
version = "0.1.0"
dependencies = [
"ctest 0.1.0 (git+https://github.com/alexcrichton/ctest)",
- "libc 0.2.10",
+ "libc 0.2.11",
]
[[package]]
@@ -16,18 +16,18 @@ name = "ctest"
version = "0.1.0"
source = "git+https://github.com/alexcrichton/ctest#a6becb6d7fd23d9863cba86eac31d1ffc4082734"
dependencies = [
- "gcc 0.3.25 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gcc 0.3.28 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_syntax 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gcc"
-version = "0.3.25"
+version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "kernel32-sys"
-version = "0.2.1"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -41,24 +41,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libc"
-version = "0.2.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "libc"
-version = "0.2.10"
+version = "0.2.11"
[[package]]
name = "log"
-version = "0.3.5"
+version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
[[package]]
name = "rustc-serialize"
-version = "0.3.18"
+version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@@ -68,8 +60,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -79,7 +71,7 @@ name = "term"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
|
New Version
Could you please release a new version. I would like to use the changes made during the last half month.
|
2016-05-03T16:39:38Z
|
0.2
|
78d6dcb4b8d60c9ae0f2c59444613ecf5a2bf919
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.