Skip to content
3 changes: 2 additions & 1 deletion ci/docker/i686-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ubuntu:23.10
#FROM ubuntu:23.10
FROM ubuntu:24.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc-multilib libc6-dev ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/x86_64-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:23.10
FROM ubuntu:24.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc libc6-dev ca-certificates linux-headers-generic
Expand Down
2 changes: 1 addition & 1 deletion libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3227,7 +3227,7 @@ fn test_neutrino(target: &str) {
false // keep me for smaller diffs when something is added above
});

cfg.skip_static(move |name| (name == "__dso_handle"));
cfg.skip_static(move |name| name == "__dso_handle");

cfg.generate("../src/lib.rs", "main.rs");
}
Expand Down
8 changes: 4 additions & 4 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ cfg_if! {
})*) => ($(
#[inline]
$(#[$attr])*
pub $($constness)* unsafe extern fn $i($($arg: $argty),*
pub $($constness)* unsafe extern "C" fn $i($($arg: $argty),*
) -> $ret {
$($body);*
}
Expand All @@ -206,7 +206,7 @@ cfg_if! {
})*) => ($(
#[inline]
$(#[$attr])*
pub $($constness)* extern fn $i($($arg: $argty),*
pub $($constness)* extern "C" fn $i($($arg: $argty),*
) -> $ret {
$($body);*
}
Expand Down Expand Up @@ -237,7 +237,7 @@ cfg_if! {
})*) => ($(
#[inline]
$(#[$attr])*
pub unsafe extern fn $i($($arg: $argty),*
pub unsafe extern "C" fn $i($($arg: $argty),*
) -> $ret {
$($body);*
}
Expand All @@ -252,7 +252,7 @@ cfg_if! {
})*) => ($(
#[inline]
$(#[$attr])*
pub extern fn $i($($arg: $argty),*
pub extern "C" fn $i($($arg: $argty),*
) -> $ret {
$($body);*
}
Expand Down
2 changes: 2 additions & 0 deletions src/unix/bsd/apple/b64/x86_64/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unpredictable_function_pointer_comparisons)]

pub type boolean_t = ::c_uint;
pub type mcontext_t = *mut __darwin_mcontext64;

Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/gnu/b32/arm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ s! {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
pub sa_restorer: ::Option<extern "C" fn()>,
}

pub struct statfs {
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/gnu/b32/csky/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ s! {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
pub sa_restorer: ::Option<extern "C" fn()>,
}

pub struct statfs {
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ s! {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
pub sa_restorer: ::Option<extern "C" fn()>,
}

pub struct statfs {
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/gnu/b32/mips/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ s! {
pub sa_flags: ::c_int,
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_restorer: ::Option<extern fn()>,
pub sa_restorer: ::Option<extern "C" fn()>,
_resv: [::c_int; 1],
}

Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b32/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! 32-bit specific definitions for linux-like values
#![allow(unpredictable_function_pointer_comparisons)]

use pthread_mutex_t;

Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/gnu/b32/powerpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ s! {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
pub sa_restorer: ::Option<extern "C" fn()>,
}

pub struct statfs {
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/gnu/b32/sparc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ s! {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
pub sa_restorer: ::Option<extern "C" fn()>,
}

pub struct statfs {
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/gnu/b32/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ s! {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
pub sa_restorer: ::Option<extern "C" fn()>,
}

pub struct statfs {
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ s! {
#[cfg(target_arch = "sparc64")]
__reserved0: ::c_int,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
pub sa_restorer: ::Option<extern "C" fn()>,
}

pub struct statfs {
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ s! {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
pub sa_restorer: ::Option<extern "C" fn()>,
}

pub struct stack_t {
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ s! {
pub sa_flags: ::c_int,
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_restorer: ::Option<extern fn()>,
pub sa_restorer: ::Option<extern "C" fn()>,
}

pub struct stack_t {
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ s! {
#[cfg(target_arch = "sparc64")]
__reserved0: ::c_int,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
pub sa_restorer: ::Option<extern "C" fn()>,
}

pub struct statfs {
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/gnu/b64/s390x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ s! {
pub sa_sigaction: ::sighandler_t,
__glibc_reserved0: ::c_int,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
pub sa_restorer: ::Option<extern "C" fn()>,
pub sa_mask: ::sigset_t,
}

Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ s! {
#[cfg(target_arch = "sparc64")]
__reserved0: ::c_int,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
pub sa_restorer: ::Option<extern "C" fn()>,
}

pub struct statfs {
Expand Down
3 changes: 2 additions & 1 deletion src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! x86_64-specific definitions for 64-bit linux-like values
#![allow(unpredictable_function_pointer_comparisons)]

pub type c_char = i8;
pub type wchar_t = i32;
Expand All @@ -16,7 +17,7 @@ s! {
#[cfg(target_arch = "sparc64")]
__reserved0: ::c_int,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
pub sa_restorer: ::Option<extern "C" fn()>,
}

pub struct statfs {
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ s! {
pub chunk_size: ::__u32,
pub headroom: ::__u32,
pub flags: ::__u32,
pub tx_metadata_len: ::__u32,
}

pub struct xdp_umem_reg_v1 {
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/musl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ s! {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
pub sa_restorer: ::Option<extern "C" fn()>,
}

pub struct statvfs {
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/uclibc/arm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ s! {
pub struct sigaction {
pub sa_sigaction: ::sighandler_t,
pub sa_flags: ::c_ulong,
pub sa_restorer: ::Option<extern fn()>,
pub sa_restorer: ::Option<extern "C" fn()>,
pub sa_mask: sigset_t,
}

Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/uclibc/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ s! {
pub struct sigaction {
pub sa_handler: ::sighandler_t,
pub sa_flags: ::c_ulong,
pub sa_restorer: ::Option<extern fn()>,
pub sa_restorer: ::Option<extern "C" fn()>,
pub sa_mask: ::sigset_t,
}

Expand Down
30 changes: 15 additions & 15 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,25 +346,25 @@ cfg_if! {
#[link(name = "m", cfg(not(target_feature = "crt-static")))]
#[link(name = "dl", cfg(not(target_feature = "crt-static")))]
#[link(name = "c", cfg(not(target_feature = "crt-static")))]
extern {}
extern "C" {}
} else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
#[cfg_attr(feature = "rustc-dep-of-std",
link(name = "c", kind = "static", modifiers = "-bundle",
cfg(target_feature = "crt-static")))]
#[cfg_attr(feature = "rustc-dep-of-std",
link(name = "c", cfg(not(target_feature = "crt-static"))))]
extern {}
extern "C" {}
} else if #[cfg(target_os = "emscripten")] {
#[link(name = "c")]
extern {}
extern "C" {}
} else if #[cfg(all(target_os = "android", feature = "rustc-dep-of-std"))] {
#[link(name = "c", kind = "static", modifiers = "-bundle",
cfg(target_feature = "crt-static"))]
#[link(name = "m", kind = "static", modifiers = "-bundle",
cfg(target_feature = "crt-static"))]
#[link(name = "m", cfg(not(target_feature = "crt-static")))]
#[link(name = "c", cfg(not(target_feature = "crt-static")))]
extern {}
extern "C" {}
} else if #[cfg(any(target_os = "macos",
target_os = "ios",
target_os = "tvos",
Expand All @@ -376,38 +376,38 @@ cfg_if! {
))] {
#[link(name = "c")]
#[link(name = "m")]
extern {}
extern "C" {}
} else if #[cfg(target_os = "haiku")] {
#[link(name = "root")]
#[link(name = "network")]
extern {}
extern "C" {}
} else if #[cfg(target_env = "newlib")] {
#[link(name = "c")]
#[link(name = "m")]
extern {}
extern "C" {}
} else if #[cfg(target_env = "illumos")] {
#[link(name = "c")]
#[link(name = "m")]
extern {}
extern "C" {}
} else if #[cfg(target_os = "redox")] {
#[cfg_attr(feature = "rustc-dep-of-std",
link(name = "c", kind = "static", modifiers = "-bundle",
cfg(target_feature = "crt-static")))]
#[cfg_attr(feature = "rustc-dep-of-std",
link(name = "c", cfg(not(target_feature = "crt-static"))))]
extern {}
extern "C" {}
} else if #[cfg(target_os = "aix")] {
#[link(name = "c")]
#[link(name = "m")]
#[link(name = "bsd")]
#[link(name = "pthread")]
extern {}
extern "C" {}
} else {
#[link(name = "c")]
#[link(name = "m")]
#[link(name = "rt")]
#[link(name = "pthread")]
extern {}
extern "C" {}
}
}

Expand Down Expand Up @@ -1444,7 +1444,7 @@ cfg_if! {

cfg_if! {
if #[cfg(not(target_os = "redox"))] {
extern {
extern "C" {
pub fn getsid(pid: pid_t) -> pid_t;
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
link_name = "pause$UNIX2003")]
Expand Down Expand Up @@ -1483,7 +1483,7 @@ cfg_if! {

cfg_if! {
if #[cfg(target_os = "nto")] {
extern {
extern "C" {
pub fn readlinkat(dirfd: ::c_int,
pathname: *const ::c_char,
buf: *mut ::c_char,
Expand All @@ -1504,7 +1504,7 @@ cfg_if! {
) -> ::c_int;
}
} else {
extern {
extern "C" {
pub fn readlinkat(dirfd: ::c_int,
pathname: *const ::c_char,
buf: *mut ::c_char,
Expand Down Expand Up @@ -1545,7 +1545,7 @@ cfg_if! {
target_os = "illumos",
target_os = "nto",
)))] {
extern {
extern "C" {
pub fn cfmakeraw(termios: *mut ::termios);
pub fn cfsetspeed(termios: *mut ::termios,
speed: ::speed_t) -> ::c_int;
Expand Down
Loading