Skip to content

Commit 7ff64b2

Browse files
Incorrect getrandom() system call for PowerPC Linux
Michael Ellerman pointed out that the system call for getrandom() on PowerPC Linux is incorrect. This bug was in the powerpc32 port, and was carried over to the powerpc64 port too.
1 parent b372910 commit 7ff64b2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/libstd/rand/os.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ mod imp {
3838
const NR_GETRANDOM: libc::c_long = 318;
3939
#[cfg(target_arch = "x86")]
4040
const NR_GETRANDOM: libc::c_long = 355;
41-
#[cfg(any(target_arch = "arm", target_arch = "powerpc",
42-
target_arch = "powerpc64", target_arch = "powerpc64le"))]
41+
#[cfg(target_arch = "arm")]
4342
const NR_GETRANDOM: libc::c_long = 384;
43+
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64",
44+
target_arch = "powerpc64le"))]
45+
const NR_GETRANDOM: libc::c_long = 359;
4446
#[cfg(target_arch = "aarch64")]
4547
const NR_GETRANDOM: libc::c_long = 278;
4648

0 commit comments

Comments
 (0)