diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | lib/unistd.in.h | 18 | ||||
-rw-r--r-- | m4/unistd_h.m4 | 6 | ||||
-rw-r--r-- | modules/unistd | 2 |
4 files changed, 13 insertions, 24 deletions
@@ -1,5 +1,16 @@ 2020-05-30 Bruno Haible <bruno@clisp.org> + unistd: Remove conflicting declaration of getrandom(). + * lib/unistd.in.h (getrandom): Remove declaration. + * m4/unistd_h.m4 (gl_UNISTD_H): Don't test whether getrandom is + declared. + (gl_UNISTD_H_DEFAULTS): Don't initialize GNULIB_GETRANDOM, + HAVE_GETRANDOM. + * modules/unistd (Makefile.am): Don't substitute GNULIB_GETRANDOM, + HAVE_GETRANDOM. + +2020-05-30 Bruno Haible <bruno@clisp.org> + getrandom: Add tests. * tests/test-getrandom.c: New file. * modules/getrandom-tests: New file. diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 4a0d6655af..906f806c3e 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -1030,24 +1030,6 @@ _GL_WARN_ON_USE (getpass, "getpass is unportable - " #endif -#if @GNULIB_GETRANDOM@ -/* Fill a buffer with random bytes. */ -# if !@HAVE_GETRANDOM@ -_GL_FUNCDECL_SYS (getrandom, int, (void *buffer, size_t length, - unsigned int flags)); -# endif -_GL_CXXALIAS_SYS (getrandom, int, (void *buffer, size_t length, - unsigned int flags)); -_GL_CXXALIASWARN (getrandom); -#elif defined GNULIB_POSIXCHECK -# undef getrandom -# if HAVE_RAW_DECL_GETRANDOM -_GL_WARN_ON_USE (getrandom, "getrandom is unportable - " - "use gnulib module getrandom for portability"); -# endif -#endif - - #if @GNULIB_GETUSERSHELL@ /* Return the next valid login shell on the system, or NULL when the end of the list has been reached. */ diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4 index 1f39d53e1f..a3b4633f68 100644 --- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -1,4 +1,4 @@ -# unistd_h.m4 serial 78 +# unistd_h.m4 serial 79 dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -44,7 +44,7 @@ AC_DEFUN([gl_UNISTD_H], ]], [access chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getentropy getgroups gethostname getlogin getlogin_r getpagesize getpass - getrandom getusershell setusershell endusershell + getusershell setusershell endusershell group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite readlink readlinkat rmdir sethostname sleep symlink symlinkat truncate ttyname_r unlink unlinkat usleep]) @@ -90,7 +90,6 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_GETOPT_POSIX=0; AC_SUBST([GNULIB_GETOPT_POSIX]) GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) GNULIB_GETPASS=0; AC_SUBST([GNULIB_GETPASS]) - GNULIB_GETRANDOM=0; AC_SUBST([GNULIB_GETRANDOM]) GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) GNULIB_GROUP_MEMBER=0; AC_SUBST([GNULIB_GROUP_MEMBER]) GNULIB_ISATTY=0; AC_SUBST([GNULIB_ISATTY]) @@ -137,7 +136,6 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN]) HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) HAVE_GETPASS=1; AC_SUBST([HAVE_GETPASS]) - HAVE_GETRANDOM=1; AC_SUBST([HAVE_GETRANDOM]) HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER]) HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN]) HAVE_LINK=1; AC_SUBST([HAVE_LINK]) diff --git a/modules/unistd b/modules/unistd index dc32ce056e..f075b78029 100644 --- a/modules/unistd +++ b/modules/unistd @@ -63,7 +63,6 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's/@''GNULIB_GETOPT_POSIX''@/$(GNULIB_GETOPT_POSIX)/g' \ -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \ -e 's/@''GNULIB_GETPASS''@/$(GNULIB_GETPASS)/g' \ - -e 's/@''GNULIB_GETRANDOM''@/$(GNULIB_GETRANDOM)/g' \ -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \ -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \ -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \ @@ -110,7 +109,6 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ -e 's|@''HAVE_GETPASS''@|$(HAVE_GETPASS)|g' \ - -e 's|@''HAVE_GETRANDOM''@|$(HAVE_GETRANDOM)|g' \ -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ |