Make __getrandom_nocancel set errno and add a _nostatus version
commit5a85786a9005722be7cb9e70f8874a5f1130daea
authorXi Ruoyao <xry111@xry111.site>
Thu, 4 Jan 2024 13:41:20 +0000 (4 21:41 +0800)
committerAndreas K. Hüttel <dilfridge@gentoo.org>
Fri, 12 Jan 2024 13:23:11 +0000 (12 14:23 +0100)
treea16f92ad1183613e1311a6a35bfc2c91ef3f4382
parentf2b65a44714e8fa13c7637cd9413169590795879
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>
malloc/malloc.c
sysdeps/generic/not-cancel.h
sysdeps/mach/hurd/not-cancel.h
sysdeps/unix/sysv/linux/not-cancel.h