Skip to content
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Bumped `r-efi` dependency to v7 ([#869])
- Removed `wasm-bindgen-test` dev dependency ([#870])
- Use `libc::getrandom` on Redox instead of reading `/dev/urandom` ([#871])

[0.4.4]: https://github.com/rust-random/getrandom/compare/v0.4.3...master
[#861]: https://github.com/rust-random/getrandom/pull/861
[#868]: https://github.com/rust-random/getrandom/pull/868
[#869]: https://github.com/rust-random/getrandom/pull/869
[#870]: https://github.com/rust-random/getrandom/pull/870
[#871]: https://github.com/rust-random/getrandom/pull/871

## [0.4.3] - 2026-06-17
### Added
Expand Down
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ libc = { version = "0.2.176", default-features = false }
[target.'cfg(target_os = "solaris")'.dependencies]
libc = { version = "0.2.176", default-features = false }

# redox
[target.'cfg(target_os = "redox")'.dependencies]
libc = { version = "0.2.190", default-features = false }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to update the other libc versions now? Or in a later PR?

I don't think it really matters too much if they are in sync.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to keep the old versions. It's technically more "correct" (since the other targets do not rely on features in new libc releases) and reduces amount of busywork.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that cargo is unable to select a smaller libc version if one of targets requires a higher one, so this change effectively bumps minimum version of libc for all targets.


# use_file
[target.'cfg(any(target_os = "haiku", target_os = "redox", target_os = "nto", target_os = "aix"))'.dependencies]
[target.'cfg(any(target_os = "haiku", target_os = "nto", target_os = "aix"))'.dependencies]
libc = { version = "0.2.176", default-features = false }

# vxworks
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn get_random_u128() -> Result<u128, getrandom::Error> {
| Solaris | `*‑solaris` | [`getrandom`][11] with `GRND_RANDOM`
| illumos | `*‑illumos` | [`getrandom`][12]
| Fuchsia OS | `*‑fuchsia` | [`cprng_draw`]
| Redox | `*‑redox` | `/dev/urandom`
| Redox | `*‑redox` | `getrandom`
| Haiku | `*‑haiku` | `/dev/urandom` (identical to `/dev/random`)
| Hermit | `*-hermit` | [`sys_read_entropy`]
| Hurd | `*-hurd-*` | [`getrandom`][17]
Expand Down
2 changes: 1 addition & 1 deletion src/backends.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ cfg_if! {
pub use esp_idf::*;
} else if #[cfg(any(
target_os = "haiku",
target_os = "redox",
target_os = "nto",
target_os = "aix",
))] {
Expand Down Expand Up @@ -114,6 +113,7 @@ cfg_if! {
target_os = "illumos",
target_os = "cygwin",
target_os = "nuttx",
target_os = "redox",
// Check for target_arch = "arm" to only include the 3DS. Does not
// include the Nintendo Switch (which is target_arch = "aarch64").
all(target_os = "horizon", target_arch = "arm"),
Expand Down
1 change: 0 additions & 1 deletion src/backends/use_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pub(super) mod utils;
/// For all platforms, we use `/dev/urandom` rather than `/dev/random`.
/// For more information see the linked man pages in lib.rs.
/// - On Linux, "/dev/urandom is preferred and sufficient in all use cases".
/// - On Redox, only /dev/urandom is provided.
/// - On AIX, /dev/urandom will "provide cryptographically secure output".
/// - On Haiku and QNX Neutrino they are identical.
const FILE_PATH: &CStr = c"/dev/urandom";
Expand Down
Loading