From 658b5848a827876cc8a5e518749f78429a9970d7 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 3 Mar 2020 12:15:38 +0100 Subject: Linux: getrandom syscall number is always available Due to the built-in tables, __NR_getrandom is always defined. Reviewed-by: Adhemerval Zanella --- sysdeps/unix/sysv/linux/getrandom.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'sysdeps/unix/sysv/linux/getrandom.c') diff --git a/sysdeps/unix/sysv/linux/getrandom.c b/sysdeps/unix/sysv/linux/getrandom.c index 309beadf72..63b8d36bf4 100644 --- a/sysdeps/unix/sysv/linux/getrandom.c +++ b/sysdeps/unix/sysv/linux/getrandom.c @@ -21,7 +21,6 @@ #include #include -#ifdef __NR_getrandom /* Write up to LENGTH bytes of randomness starting at BUFFER. Return the number of bytes written, or -1 on error. */ ssize_t @@ -29,17 +28,5 @@ __getrandom (void *buffer, size_t length, unsigned int flags) { return SYSCALL_CANCEL (getrandom, buffer, length, flags); } -#else -/* Always provide a definition, even if the kernel headers lack the - system call number. */ -ssize_t -__getrandom (void *buffer, size_t length, unsigned int flags) -{ - /* Ideally, we would add a cancellation point here, but we currently - cannot do so inside libc. */ - __set_errno (ENOSYS); - return -1; -} -#endif libc_hidden_def (__getrandom) weak_alias (__getrandom, getrandom) -- cgit v1.2.3-70-g09d2