about summary refs log tree commit diff
path: root/sysdeps/generic
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2024-01-04 21:41:20 +0800
committerAndreas K. Hüttel <dilfridge@gentoo.org>2024-01-12 14:23:11 +0100
commit5a85786a9005722be7cb9e70f8874a5f1130daea (patch)
treea16f92ad1183613e1311a6a35bfc2c91ef3f4382 /sysdeps/generic
parentf2b65a44714e8fa13c7637cd9413169590795879 (diff)
downloadglibc-5a85786a9005722be7cb9e70f8874a5f1130daea.tar.gz
glibc-5a85786a9005722be7cb9e70f8874a5f1130daea.tar.xz
glibc-5a85786a9005722be7cb9e70f8874a5f1130daea.zip
Make __getrandom_nocancel set errno and add a _nostatus version
The __getrandom_nocancel function returns errors as negative values
instead of errno.  This is inconsistent with other _nocancel functions
and it breaks "TEMP_FAILURE_RETRY (__getrandom_nocancel (p, n, 0))" in
__arc4random_buf.  Use INLINE_SYSCALL_CALL instead of
INTERNAL_SYSCALL_CALL to fix this issue.

But __getrandom_nocancel has been avoiding from touching errno for a
reason, see BZ 29624.  So add a __getrandom_nocancel_nostatus function
and use it in tcache_key_initialize.

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Diffstat (limited to 'sysdeps/generic')
-rw-r--r--sysdeps/generic/not-cancel.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/generic/not-cancel.h b/sysdeps/generic/not-cancel.h
index d9a6cba443..2dd1064600 100644
--- a/sysdeps/generic/not-cancel.h
+++ b/sysdeps/generic/not-cancel.h
@@ -51,6 +51,8 @@
   __fcntl64 (fd, cmd, __VA_ARGS__)
 #define __getrandom_nocancel(buf, size, flags) \
   __getrandom (buf, size, flags)
+#define __getrandom_nocancel_nostatus(buf, size, flags) \
+  __getrandom (buf, size, flags)
 #define __poll_infinity_nocancel(fds, nfds) \
   __poll (fds, nfds, -1)