aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/not-cancel.h2
-rw-r--r--sysdeps/mach/hurd/not-cancel.h7
-rw-r--r--sysdeps/unix/sysv/linux/not-cancel.h8
3 files changed, 16 insertions, 1 deletions
diff --git a/sysdeps/generic/not-cancel.h b/sysdeps/generic/not-cancel.h
index d9a6cba..2dd1064 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)
diff --git a/sysdeps/mach/hurd/not-cancel.h b/sysdeps/mach/hurd/not-cancel.h
index 411f579..69fb3c0 100644
--- a/sysdeps/mach/hurd/not-cancel.h
+++ b/sysdeps/mach/hurd/not-cancel.h
@@ -76,8 +76,10 @@ __typeof (__fcntl) __fcntl_nocancel;
#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);
@@ -86,6 +88,9 @@ __getrandom_nocancel (void *buf, size_t buflen, unsigned int flags)
return r;
}
+#define __getrandom_nocancel(buf, size, flags) \
+ __getrandom (buf, size, flags)
+
#define __poll_infinity_nocancel(fds, nfds) \
__poll (fds, nfds, -1)
diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h
index 50483d9..2a7585b 100644
--- a/sysdeps/unix/sysv/linux/not-cancel.h
+++ b/sysdeps/unix/sysv/linux/not-cancel.h
@@ -86,6 +86,14 @@ __writev_nocancel_nostatus (int fd, const struct iovec *iov, int iovcnt)
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);
}