about summary refs log tree commit diff
path: root/sysdeps/mach
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2019-12-13 10:10:59 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-12-13 11:11:54 +0100
commit8eaf34eda256ba3647ed6e7ed5c7c9aa19955d17 (patch)
tree7e57b78b0a5afa580234ca80ed886de02b766886 /sysdeps/mach
parentf7649d5780aa4682393b9daedd653e4d9c12784c (diff)
downloadglibc-8eaf34eda256ba3647ed6e7ed5c7c9aa19955d17.tar.gz
glibc-8eaf34eda256ba3647ed6e7ed5c7c9aa19955d17.tar.xz
glibc-8eaf34eda256ba3647ed6e7ed5c7c9aa19955d17.zip
hurd: Fix local PLT
* include/sys/random.h (__getrandom): Add hidden prototype.
* stdlib/getrandom.c (getrandom): Rename to hidden definition __getrandom.
Add weak alias.
* sysdeps/mach/hurd/getrandom.c (getrandom): Likewise.
* sysdeps/unix/sysv/linux/getrandom.c (getrandom): Likewise.
* sysdeps/mach/hurd/getentropy.c (getentropy): Use __getrandom instead of
getrandom.
Diffstat (limited to 'sysdeps/mach')
-rw-r--r--sysdeps/mach/hurd/getentropy.c2
-rw-r--r--sysdeps/mach/hurd/getrandom.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/sysdeps/mach/hurd/getentropy.c b/sysdeps/mach/hurd/getentropy.c
index d55eec8984..06175d90ce 100644
--- a/sysdeps/mach/hurd/getentropy.c
+++ b/sysdeps/mach/hurd/getentropy.c
@@ -41,7 +41,7 @@ getentropy (void *buffer, size_t length)
   while (buffer < end)
     {
       /* NB: No cancellation point.  */
-      ssize_t bytes = getrandom (buffer, end - buffer, 0);
+      ssize_t bytes = __getrandom (buffer, end - buffer, 0);
       if (bytes < 0)
         {
           if (errno == EINTR)
diff --git a/sysdeps/mach/hurd/getrandom.c b/sysdeps/mach/hurd/getrandom.c
index 0147aeef3a..8bf42aa40d 100644
--- a/sysdeps/mach/hurd/getrandom.c
+++ b/sysdeps/mach/hurd/getrandom.c
@@ -24,7 +24,7 @@
 /* Write up to LENGTH bytes of randomness starting at BUFFER.
    Return the number of bytes written, or -1 on error.  */
 ssize_t
-getrandom (void *buffer, size_t length, unsigned int flags)
+__getrandom (void *buffer, size_t length, unsigned int flags)
 {
   const char *random_source = "/dev/urandom";
   size_t amount_read;
@@ -41,3 +41,6 @@ getrandom (void *buffer, size_t length, unsigned int flags)
   __close_nocancel_nostatus(fd);
   return amount_read;
 }
+
+libc_hidden_def (__getrandom)
+weak_alias (__getrandom, getrandom)