public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: Re: [PATCH 13/26] Linux: getrandom syscall number is always available
Date: Thu, 27 Feb 2020 23:20:00 -0000	[thread overview]
Message-ID: <67202227-51c3-8006-8bc1-04acdff1024f@linaro.org> (raw)
In-Reply-To: <ac0ba6febb01f1f794d2067d80906539f9a10b9d.1581279333.git.fweimer@redhat.com>



On 09/02/2020 17:20, Florian Weimer wrote:
> Due to the built-in tables, __NR_getrandom is always defined.

LGTM, thanks. 

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>

> ---
>  sysdeps/unix/sysv/linux/getentropy.c |  9 ---------
>  sysdeps/unix/sysv/linux/getrandom.c  | 13 -------------
>  2 files changed, 22 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/getentropy.c b/sysdeps/unix/sysv/linux/getentropy.c
> index 5d0b8d10c1..2f3a4e4692 100644
> --- a/sysdeps/unix/sysv/linux/getentropy.c
> +++ b/sysdeps/unix/sysv/linux/getentropy.c
> @@ -21,7 +21,6 @@
>  #include <errno.h>
>  #include <unistd.h>
>  
> -#ifdef __NR_getrandom
>  /* Write LENGTH bytes of randomness starting at BUFFER.  Return 0 on
>     success and -1 on failure.  */
>  int
> @@ -63,11 +62,3 @@ getentropy (void *buffer, size_t length)
>      }
>    return 0;
>  }
> -#else
> -int
> -getentropy (void *buffer, size_t length)
> -{
> -  __set_errno (ENOSYS);
> -  return -1;
> -}
> -#endif

Ok..

> 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 <unistd.h>
>  #include <sysdep-cancel.h>
>  
> -#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)
> 

  reply	other threads:[~2020-02-27 23:20 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-09 20:19 [PATCH 00/26] Linux cleanups enabled by built-in system call tables Florian Weimer
2020-02-09 20:19 ` [PATCH 01/26] Linux: Enhance glibcsyscalls.h to support listing system calls Florian Weimer
2020-02-27 22:14   ` Adhemerval Zanella
2020-05-11 10:10     ` Florian Weimer
2020-02-09 20:19 ` [PATCH 04/26] Linux: mlock2 syscall number is always available Florian Weimer
2020-02-27 23:06   ` Adhemerval Zanella
2020-02-09 20:19 ` [PATCH 02/26] Linux: renameat2 " Florian Weimer
2020-02-27 23:06   ` Adhemerval Zanella
2020-02-09 20:19 ` [PATCH 03/26] Linux: copy_file_range " Florian Weimer
2020-02-27 23:06   ` Adhemerval Zanella
2020-02-09 20:20 ` [PATCH 11/26] Linux: Clean up preadv2, pwritev2 system call names Florian Weimer
2020-02-27 23:19   ` Adhemerval Zanella
2020-02-09 20:20 ` [PATCH 12/26] Linux: Clean up preadv, pwritev " Florian Weimer
2020-02-27 23:19   ` Adhemerval Zanella
2020-02-09 20:20 ` [PATCH 07/26] Linux: sched_setaffinity syscall number is always available Florian Weimer
2020-02-27 23:06   ` Adhemerval Zanella
2020-02-09 20:20 ` [PATCH 15/26] Linux: pkey_mprotect " Florian Weimer
2020-02-27 23:31   ` Adhemerval Zanella
2020-02-09 20:20 ` [PATCH 08/26] Linux: sched_getaffinity " Florian Weimer
2020-02-27 23:06   ` Adhemerval Zanella
2020-02-09 20:20 ` [PATCH 14/26] Linux: rt_sigqueueinfo " Florian Weimer
2020-02-27 23:31   ` Adhemerval Zanella
2020-02-09 20:20 ` [PATCH 05/26] Linux: mq_* syscall numbers are " Florian Weimer
2020-02-27 23:06   ` Adhemerval Zanella
2020-02-09 20:20 ` [PATCH 13/26] Linux: getrandom syscall number is " Florian Weimer
2020-02-27 23:20   ` Adhemerval Zanella [this message]
2020-02-09 20:20 ` [PATCH 10/26] Linux: Clean up pread64/pwrite64 system call names Florian Weimer
2020-02-27 23:08   ` Adhemerval Zanella
2020-02-09 20:20 ` [PATCH 06/26] Linux: statx syscall number is always available Florian Weimer
2020-02-27 23:06   ` Adhemerval Zanella
2020-02-09 20:20 ` [PATCH 09/26] Linux: sigaltstack " Florian Weimer
2020-02-27 23:06   ` Adhemerval Zanella
2020-02-09 20:21 ` [PATCH 17/26] Linux: exit_group " Florian Weimer
2020-02-27 23:31   ` Adhemerval Zanella
2020-02-09 20:21 ` [PATCH 22/26] ia64: Do not define __NR_semtimedop in <sysdep.h> Florian Weimer
2020-02-27 23:46   ` Adhemerval Zanella
2020-02-09 20:21 ` [PATCH 24/26] Linux: epoll_pwait syscall number is always available Florian Weimer
2020-02-27 23:47   ` Adhemerval Zanella
2020-02-09 20:21 ` [PATCH 20/26] Linux: set_robust_list " Florian Weimer
2020-02-27 23:46   ` Adhemerval Zanella
2020-02-09 20:21 ` [PATCH 23/26] x86_64: Do not define __NR_semtimedop in <sysdep.h> Florian Weimer
2020-02-27 23:46   ` Adhemerval Zanella
2020-02-09 20:21 ` [PATCH 21/26] Linux: open_by_handle_at syscall number is always available Florian Weimer
2020-02-27 23:46   ` Adhemerval Zanella
2020-02-09 20:21 ` [PATCH 19/26] Linux: pciconfig_iobase syscall number is always available on alpha Florian Weimer
2020-02-27 23:31   ` Adhemerval Zanella
2020-02-09 20:21 ` [PATCH 25/26] m68k: getpagesize syscall number is always available Florian Weimer
2020-02-27 23:47   ` Adhemerval Zanella
2020-02-09 20:21 ` [PATCH 18/26] Linux: getdents64 syscall number is always available on MIPS Florian Weimer
2020-02-27 23:31   ` Adhemerval Zanella
2020-02-09 20:21 ` [PATCH 16/26] Linux: set_tid_address syscall number is always available Florian Weimer
2020-02-27 23:31   ` Adhemerval Zanella
2020-02-09 20:21 ` [PATCH 26/26] microblaze: vfork " Florian Weimer
2020-02-27 23:47   ` Adhemerval Zanella
2020-02-10 23:25 ` [PATCH 00/26] Linux cleanups enabled by built-in system call tables Lukasz Majewski
2020-02-10 23:56   ` Joseph Myers
2020-02-11  7:47   ` Florian Weimer
2020-02-11 11:07     ` Florian Weimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=67202227-51c3-8006-8bc1-04acdff1024f@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).