]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
riscv: linux: Add support for getrandom vDSO
authorXi Ruoyao <xry111@xry111.site>
Thu, 19 Jun 2025 16:25:32 +0000 (00:25 +0800)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 23 Jun 2025 14:48:15 +0000 (11:48 -0300)
Linux kernel >= 6.16 has getrandom() in vDSO for RISC-V.  Enable the use
of it in Glibc so it would benefit the programs using the Glibc high
quality random number functions.

Link: https://git.kernel.org/torvalds/c/ee0d03053e70
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
sysdeps/unix/sysv/linux/riscv/sysdep.h

index ee015dfeb65b5131d1786a897aecddc5382953b1..05e0e0523d3f744cd7ec1341afc5126746bc80e8 100644 (file)
 #  define HAVE_CLOCK_GETRES64_VSYSCALL "__vdso_clock_getres"
 #  define HAVE_CLOCK_GETTIME64_VSYSCALL        "__vdso_clock_gettime"
 #  define HAVE_GETTIMEOFDAY_VSYSCALL   "__vdso_gettimeofday"
+#  define HAVE_GETRANDOM_VSYSCALL      "__vdso_getrandom"
 # else
 #  define VDSO_NAME    "LINUX_5.4"
 #  define VDSO_HASH    61765876
 
-/* RV32 does not support the gettime VDSO syscalls.  */
+/* RV32 does not support the gettime and getrandom VDSO syscalls.  */
 # endif
 # define HAVE_CLONE3_WRAPPER           1