Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.2] Backports #4266

Merged
merged 13 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@ task:
env:
HOME: /tmp # cargo cache needs it
TARGET: x86_64-unknown-freebsd
# FIXME(freebsd): FreeBSD has a segfault when `RUST_BACKTRACE` is set
# https://github.com/rust-lang/rust/issues/132185
RUST_BACKTRACE: "0"
matrix:
- name: nightly freebsd-13 i686
# Test i686 FreeBSD in 32-bit emulation on a 64-bit host.
env:
TARGET: i686-unknown-freebsd
freebsd_instance:
image_family: freebsd-13-3
image_family: freebsd-13-4
- name: nightly freebsd-13 x86_64
freebsd_instance:
image_family: freebsd-13-3
image_family: freebsd-13-4
- name: nightly freebsd-14 x86_64
freebsd_instance:
image: freebsd-14-1-release-amd64-ufs
image: freebsd-14-2-release-amd64-ufs
- name: nightly freebsd-15 x86_64
freebsd_instance:
image_family: freebsd-15-0-snap
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ jobs:
- i686-unknown-linux-musl
- loongarch64-unknown-linux-gnu
- loongarch64-unknown-linux-musl
- powerpc-unknown-linux-gnu
# FIXME(ppc): SIGILL running tests, see
# https://github.com/rust-lang/libc/pull/4254#issuecomment-2636288713
# - powerpc-unknown-linux-gnu
- powerpc64-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
Expand Down
3 changes: 3 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2140,6 +2140,9 @@ fn test_android(target: &str) {
// Added in API level 26, but some tests use level 24.
"endgrent" => true,

// Added in API level 26, but some tests use level 24.
"getdomainname" | "setdomainname" => true,

// FIXME: bad function pointers:
"isalnum" | "isalpha" | "iscntrl" | "isdigit" | "isgraph" | "islower" | "isprint"
| "ispunct" | "isspace" | "isupper" | "isxdigit" | "isblank" | "tolower"
Expand Down
2 changes: 2 additions & 0 deletions libc-test/semver/android.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3324,6 +3324,7 @@ getaddrinfo
getchar
getchar_unlocked
getcwd
getdomainname
getegid
getenv
geteuid
Expand Down Expand Up @@ -3720,6 +3721,7 @@ sendmsg
sendto
servent
setbuf
setdomainname
setegid
setenv
seteuid
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/linux-musl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ AIO_ALLDONE
AIO_CANCELED
AIO_NOTCANCELED
BOOT_TIME
CLONE_NEWTIME
DEAD_PROCESS
EMPTY
Elf32_Chdr
Expand Down
8 changes: 4 additions & 4 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ cfg_if! {
)*) => ($(
#[inline]
$(#[$attr])*
pub $($constness)* unsafe extern fn $i($($arg: $argty),*) -> $ret
pub $($constness)* unsafe extern "C" fn $i($($arg: $argty),*) -> $ret
$body
)*)
}
Expand All @@ -257,7 +257,7 @@ cfg_if! {
)*) => ($(
#[inline]
$(#[$attr])*
pub $($constness)* extern fn $i($($arg: $argty),*) -> $ret
pub $($constness)* extern "C" fn $i($($arg: $argty),*) -> $ret
$body
)*)
}
Expand Down Expand Up @@ -285,7 +285,7 @@ cfg_if! {
)*) => ($(
#[inline]
$(#[$attr])*
pub unsafe extern fn $i($($arg: $argty),*) -> $ret
pub unsafe extern "C" fn $i($($arg: $argty),*) -> $ret
$body
)*)
}
Expand All @@ -299,7 +299,7 @@ cfg_if! {
)*) => ($(
#[inline]
$(#[$attr])*
pub extern fn $i($($arg: $argty),*) -> $ret
pub extern "C" fn $i($($arg: $argty),*) -> $ret
$body
)*)
}
Expand Down
3 changes: 2 additions & 1 deletion src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ s! {
pub st_blksize: crate::blksize_t,
pub st_flags: crate::fflags_t,
pub st_gen: u64,
pub st_spare: [u64; 10],
pub st_filerev: u64,
pub st_spare: [u64; 9],
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/unix/hurd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ pub type nl_item = c_int;
pub type iconv_t = *mut c_void;

#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos64_t {} // FIXME: fill this out with a struct
pub enum fpos64_t {} // FIXME(hurd): fill this out with a struct
impl Copy for fpos64_t {}
impl Clone for fpos64_t {
fn clone(&self) -> fpos64_t {
Expand Down Expand Up @@ -814,7 +814,7 @@ s! {
pub ifa_flags: c_uint,
pub ifa_addr: *mut crate::sockaddr,
pub ifa_netmask: *mut crate::sockaddr,
pub ifa_ifu: *mut crate::sockaddr, // FIXME This should be a union
pub ifa_ifu: *mut crate::sockaddr, // FIXME(union) This should be a union
pub ifa_data: *mut c_void,
}

Expand Down Expand Up @@ -1092,7 +1092,7 @@ cfg_if! {
.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)
// FIXME(debug): .field("ut_host", &self.ut_host)
.field("ut_exit", &self.ut_exit)
.field("ut_session", &self.ut_session)
.field("ut_tv", &self.ut_tv)
Expand Down
9 changes: 6 additions & 3 deletions src/unix/linux_like/android/b32/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,11 @@ pub const SYS_modify_ldt: c_long = 123;
pub const SYS_adjtimex: c_long = 124;
pub const SYS_mprotect: c_long = 125;
pub const SYS_sigprocmask: c_long = 126;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_create_module: c_long = 127;
pub const SYS_init_module: c_long = 128;
pub const SYS_delete_module: c_long = 129;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_get_kernel_syms: c_long = 130;
pub const SYS_quotactl: c_long = 131;
pub const SYS_getpgid: c_long = 132;
Expand All @@ -281,11 +283,11 @@ pub const SYS_personality: c_long = 136;
pub const SYS_afs_syscall: c_long = 137;
pub const SYS_setfsuid: c_long = 138;
pub const SYS_setfsgid: c_long = 139;
// FIXME: SYS__llseek is in the NDK sources but for some reason is
// FIXME(android): SYS__llseek is in the NDK sources but for some reason is
// not available in the tests
// pub const SYS__llseek: c_long = 140;
pub const SYS_getdents: c_long = 141;
// FIXME: SYS__newselect is in the NDK sources but for some reason is
// FIXME(android): SYS__newselect is in the NDK sources but for some reason is
// not available in the tests
// pub const SYS__newselect: c_long = 142;
pub const SYS_flock: c_long = 143;
Expand All @@ -294,7 +296,7 @@ pub const SYS_readv: c_long = 145;
pub const SYS_writev: c_long = 146;
pub const SYS_getsid: c_long = 147;
pub const SYS_fdatasync: c_long = 148;
// FIXME: SYS__llseek is in the NDK sources but for some reason is
// FIXME(android): SYS__llseek is in the NDK sources but for some reason is
// not available in the tests
// pub const SYS__sysctl: c_long = 149;
pub const SYS_mlock: c_long = 150;
Expand All @@ -314,6 +316,7 @@ pub const SYS_mremap: c_long = 163;
pub const SYS_setresuid: c_long = 164;
pub const SYS_getresuid: c_long = 165;
pub const SYS_vm86: c_long = 166;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_query_module: c_long = 167;
pub const SYS_poll: c_long = 168;
pub const SYS_nfsservctl: c_long = 169;
Expand Down
6 changes: 3 additions & 3 deletions src/unix/linux_like/android/b64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ cfg_if! {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("pthread_mutex_t")
.field("value", &self.value)
// FIXME: .field("__reserved", &self.__reserved)
// FIXME(debug): .field("__reserved", &self.__reserved)
.finish()
}
}
Expand Down Expand Up @@ -190,7 +190,7 @@ cfg_if! {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("pthread_cond_t")
.field("value", &self.value)
// FIXME: .field("__reserved", &self.__reserved)
// FIXME(debug): .field("__reserved", &self.__reserved)
.finish()
}
}
Expand Down Expand Up @@ -227,7 +227,7 @@ cfg_if! {
.field("pendingReaders", &self.pendingReaders)
.field("pendingWriters", &self.pendingWriters)
.field("attr", &self.attr)
// FIXME: .field("__reserved", &self.__reserved)
// FIXME(debug): .field("__reserved", &self.__reserved)
.finish()
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/unix/linux_like/android/b64/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ cfg_if! {
.field("mxcsr", &self.mxcsr)
.field("mxcr_mask", &self.mxcr_mask)
.field("st_space", &self.st_space)
// FIXME: .field("xmm_space", &self.xmm_space)
// FIXME(debug): .field("xmm_space", &self.xmm_space)
// Ignore padding field
.finish()
}
Expand Down Expand Up @@ -545,7 +545,7 @@ pub const SYS_munlockall: c_long = 152;
pub const SYS_vhangup: c_long = 153;
pub const SYS_modify_ldt: c_long = 154;
pub const SYS_pivot_root: c_long = 155;
// FIXME: SYS__sysctl is in the NDK sources but for some reason is
// FIXME(android): SYS__sysctl is in the NDK sources but for some reason is
// not available in the tests
// pub const SYS__sysctl: c_long = 156;
pub const SYS_prctl: c_long = 157;
Expand All @@ -565,10 +565,13 @@ pub const SYS_sethostname: c_long = 170;
pub const SYS_setdomainname: c_long = 171;
pub const SYS_iopl: c_long = 172;
pub const SYS_ioperm: c_long = 173;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_create_module: c_long = 174;
pub const SYS_init_module: c_long = 175;
pub const SYS_delete_module: c_long = 176;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_get_kernel_syms: c_long = 177;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_query_module: c_long = 178;
pub const SYS_quotactl: c_long = 179;
pub const SYS_nfsservctl: c_long = 180;
Expand Down
8 changes: 4 additions & 4 deletions src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ cfg_if! {
.field("d_off", &self.d_off)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
// FIXME: .field("d_name", &self.d_name)
// FIXME(debug): .field("d_name", &self.d_name)
.finish()
}
}
Expand Down Expand Up @@ -737,7 +737,7 @@ cfg_if! {
.field("d_off", &self.d_off)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
// FIXME: .field("d_name", &self.d_name)
// FIXME(debug): .field("d_name", &self.d_name)
.finish()
}
}
Expand Down Expand Up @@ -809,7 +809,7 @@ cfg_if! {
f.debug_struct("lastlog")
.field("ll_time", &self.ll_time)
.field("ll_line", &self.ll_line)
// FIXME: .field("ll_host", &self.ll_host)
// FIXME(debug): .field("ll_host", &self.ll_host)
.finish()
}
}
Expand Down Expand Up @@ -860,7 +860,7 @@ cfg_if! {
.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)
// FIXME(debug): .field("ut_host", &self.ut_host)
.field("ut_exit", &self.ut_exit)
.field("ut_session", &self.ut_session)
.field("ut_tv", &self.ut_tv)
Expand Down
10 changes: 4 additions & 6 deletions src/unix/linux_like/emscripten/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub type statvfs64 = crate::statvfs;
pub type dirent64 = crate::dirent;

#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos64_t {} // FIXME: fill this out with a struct
pub enum fpos64_t {} // FIXME(emscripten): fill this out with a struct
impl Copy for fpos64_t {}
impl Clone for fpos64_t {
fn clone(&self) -> fpos64_t {
Expand Down Expand Up @@ -412,7 +412,7 @@ cfg_if! {
.field("d_off", &self.d_off)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
// FIXME: .field("d_name", &self.d_name)
// FIXME(debug): .field("d_name", &self.d_name)
.finish()
}
}
Expand Down Expand Up @@ -465,7 +465,7 @@ cfg_if! {
.field("totalhigh", &self.totalhigh)
.field("freehigh", &self.freehigh)
.field("mem_unit", &self.mem_unit)
// FIXME: .field("__reserved", &self.__reserved)
// FIXME(debug): .field("__reserved", &self.__reserved)
.finish()
}
}
Expand Down Expand Up @@ -525,7 +525,7 @@ cfg_if! {
impl fmt::Debug for pthread_cond_t {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("pthread_cond_t")
// FIXME: .field("size", &self.size)
// FIXME(debug): .field("size", &self.size)
.finish()
}
}
Expand Down Expand Up @@ -1574,8 +1574,6 @@ extern "C" {
pub fn mkstemps(template: *mut c_char, suffixlen: c_int) -> c_int;
pub fn nl_langinfo(item: crate::nl_item) -> *mut c_char;

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 sendmmsg(
sockfd: c_int,
msgvec: *mut crate::mmsghdr,
Expand Down
3 changes: 3 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,11 @@ pub const SYS_cacheflush: c_long = 123;
pub const SYS_adjtimex_time32: c_long = 124;
pub const SYS_mprotect: c_long = 125;
pub const SYS_sigprocmask: c_long = 126;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_create_module: c_long = 127;
pub const SYS_init_module: c_long = 128;
pub const SYS_delete_module: c_long = 129;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_get_kernel_syms: c_long = 130;
pub const SYS_quotactl: c_long = 131;
pub const SYS_getpgid: c_long = 132;
Expand Down Expand Up @@ -587,6 +589,7 @@ pub const SYS_mremap: c_long = 163;
pub const SYS_setresuid16: c_long = 164;
pub const SYS_getresuid16: c_long = 165;
pub const SYS_getpagesize: c_long = 166;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_query_module: c_long = 167;
pub const SYS_poll: c_long = 168;
pub const SYS_nfsservctl: c_long = 169;
Expand Down
3 changes: 3 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/mips/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,11 @@ pub const SYS_modify_ldt: c_long = 4000 + 123;
pub const SYS_adjtimex: c_long = 4000 + 124;
pub const SYS_mprotect: c_long = 4000 + 125;
pub const SYS_sigprocmask: c_long = 4000 + 126;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_create_module: c_long = 4000 + 127;
pub const SYS_init_module: c_long = 4000 + 128;
pub const SYS_delete_module: c_long = 4000 + 129;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_get_kernel_syms: c_long = 4000 + 130;
pub const SYS_quotactl: c_long = 4000 + 131;
pub const SYS_getpgid: c_long = 4000 + 132;
Expand Down Expand Up @@ -348,6 +350,7 @@ pub const SYS_socket: c_long = 4000 + 183;
pub const SYS_socketpair: c_long = 4000 + 184;
pub const SYS_setresuid: c_long = 4000 + 185;
pub const SYS_getresuid: c_long = 4000 + 186;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_query_module: c_long = 4000 + 187;
pub const SYS_poll: c_long = 4000 + 188;
pub const SYS_nfsservctl: c_long = 4000 + 189;
Expand Down
3 changes: 3 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/powerpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,11 @@ pub const SYS_modify_ldt: c_long = 123;
pub const SYS_adjtimex: c_long = 124;
pub const SYS_mprotect: c_long = 125;
pub const SYS_sigprocmask: c_long = 126;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_create_module: c_long = 127;
pub const SYS_init_module: c_long = 128;
pub const SYS_delete_module: c_long = 129;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_get_kernel_syms: c_long = 130;
pub const SYS_quotactl: c_long = 131;
pub const SYS_getpgid: c_long = 132;
Expand Down Expand Up @@ -594,6 +596,7 @@ pub const SYS_nanosleep: c_long = 162;
pub const SYS_mremap: c_long = 163;
pub const SYS_setresuid: c_long = 164;
pub const SYS_getresuid: c_long = 165;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_query_module: c_long = 166;
pub const SYS_poll: c_long = 167;
pub const SYS_nfsservctl: c_long = 168;
Expand Down
Loading
Loading