]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/basic/random-util.h
random-util: allow RDRAND to be used in 32-bit x86 binaries
authorMike Gilbert <floppym@gentoo.org>
Thu, 8 Nov 2018 14:47:16 +0000 (09:47 -0500)
committerLennart Poettering <lennart@poettering.net>
Sat, 10 Nov 2018 13:56:53 +0000 (14:56 +0100)
commit33dbab6fde5423ce61b5544ca49afa13495477a8
treebe46001261b2f1786d0706589a36df5031296980
parente29a9fcb29a0509ccc30bcfe07ecf5dc2b4de9ea
random-util: allow RDRAND to be used in 32-bit x86 binaries

Rename rdrand64 to rdrand, and switch from uint64_t to unsigned long.
This produces code that will compile/assemble on both x86-64 and x86-32.

This could be useful when running a 32-bit copy of systemd on a modern
Intel processor.

RDRAND is inherently arch-specific, so relying on the compiler-defined
'long' type seems reasonable.
src/basic/random-util.c
src/basic/random-util.h
src/test/test-random-util.c