static void
tcache_key_initialize (void)
{
- if (__getrandom_nocancel (&tcache_key, sizeof(tcache_key), GRND_NONBLOCK)
+ /* We need to use the _nostatus version here, see BZ 29624. */
+ if (__getrandom_nocancel_nostatus (&tcache_key, sizeof(tcache_key),
+ GRND_NONBLOCK)
!= sizeof (tcache_key))
{
tcache_key = random_bits ();
__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)
#define __fcntl64_nocancel(...) \
__fcntl_nocancel (__VA_ARGS__)
+/* Non cancellable getrandom syscall that does not also set errno in case of
+ failure. */
static inline ssize_t
-__getrandom_nocancel (void *buf, size_t buflen, unsigned int flags)
+__getrandom_nocancel_nostatus (void *buf, size_t buflen, unsigned int flags)
{
int save_errno = errno;
ssize_t r = __getrandom (buf, buflen, flags);
return r;
}
+#define __getrandom_nocancel(buf, size, flags) \
+ __getrandom (buf, size, flags)
+
#define __poll_infinity_nocancel(fds, nfds) \
__poll (fds, nfds, -1)
static inline ssize_t
__getrandom_nocancel (void *buf, size_t buflen, unsigned int flags)
{
+ return INLINE_SYSCALL_CALL (getrandom, buf, buflen, flags);
+}
+
+/* Non cancellable getrandom syscall that does not also set errno in case of
+ failure. */
+static inline ssize_t
+__getrandom_nocancel_nostatus (void *buf, size_t buflen, unsigned int flags)
+{
return INTERNAL_SYSCALL_CALL (getrandom, buf, buflen, flags);
}