Skip to content

musl: enable getrandom on all musl platforms #4346

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

Merged
merged 1 commit into from
Mar 22, 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
4 changes: 0 additions & 4 deletions src/unix/linux_like/linux/musl/b32/arm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,3 @@ pub const SYS_process_mrelease: c_long = 448;
pub const SYS_futex_waitv: c_long = 449;
pub const SYS_set_mempolicy_home_node: c_long = 450;
pub const SYS_mseal: c_long = 462;

extern "C" {
pub fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t;
}
4 changes: 0 additions & 4 deletions src/unix/linux_like/linux/musl/b32/powerpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,3 @@ pub const SYS_process_mrelease: c_long = 448;
pub const SYS_futex_waitv: c_long = 449;
pub const SYS_set_mempolicy_home_node: c_long = 450;
pub const SYS_mseal: c_long = 462;

extern "C" {
pub fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t;
}
4 changes: 0 additions & 4 deletions src/unix/linux_like/linux/musl/b32/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,3 @@ pub const CS: c_int = 13;
pub const EFL: c_int = 14;
pub const UESP: c_int = 15;
pub const SS: c_int = 16;

extern "C" {
pub fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t;
}
4 changes: 0 additions & 4 deletions src/unix/linux_like/linux/musl/b64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;

extern "C" {
pub fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t;
}

cfg_if! {
if #[cfg(target_arch = "aarch64")] {
mod aarch64;
Expand Down
3 changes: 3 additions & 0 deletions src/unix/linux_like/linux/musl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,9 @@ extern "C" {
pub fn dirname(path: *mut c_char) -> *mut c_char;
pub fn basename(path: *mut c_char) -> *mut c_char;

// Addded in `musl` 1.1.20
pub fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t;

// Added in `musl` 1.1.24
pub fn posix_spawn_file_actions_addchdir_np(
actions: *mut crate::posix_spawn_file_actions_t,
Expand Down
Loading