bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] getentropy, getrandom: new modules


From: Bruno Haible
Subject: Re: [PATCH] getentropy, getrandom: new modules
Date: Sat, 30 May 2020 16:23:19 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-177-generic; KDE/5.18.0; x86_64; ; )

On platforms which do have a <sys/random.h> that does not declare
getrandom() - such as Mac OS X 10.5 or HP-UX 11, gnulib should not override
the system's <sys/random.h>, but augment it. Otherwise we hide system
functions that the user may want to use.

Also, the getrandom() declaration lacks an 'extern "C"' marker in C++ mode.

Also, in getrandom.m4, we must make sure that the initialization of the
variable HAVE_GETRANDOM precedes the HAVE_GETRANDOM=0 statement.

So, let's use the standard idioms.


2020-05-30  Bruno Haible  <bruno@clisp.org>

        sys_random: Add C++ tests.
        * tests/test-sys_random-c++.cc: New file.
        * modules/sys_random-c++-tests: New file.
        * modules/sys_random-tests (Depends-on): Depend on it.

        sys_random: Add tests.
        * tests/test-sys_random.c: New file.
        * modules/sys_random-tests: New file.

        sys_random: New module.
        * lib/sys_random.in.h: Use the common idioms for overridable header
        files.
        * m4/sys_random_h.m4: New file.
        * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Require gl_SYS_RANDOM_H_DEFAULTS.
        * modules/sys_random: New file.
        * modules/getrandom (Files): Remove lib/sys_random.in.h.
        (Depends-on): Add sys_random.
        (configure.ac): Use gl_SYS_RANDOM_MODULE_INDICATOR, not
        gl_UNISTD_MODULE_INDICATOR.
        (Makefile.am): Don't generate sys/random.h here.
        * doc/glibc-headers/sys_random.texi: New file.
        * doc/gnulib.texi: Include it.

Attachment: 0001-sys_random-New-module.patch
Description: Text Data

Attachment: 0002-sys_random-Add-tests.patch
Description: Text Data

Attachment: 0003-sys_random-Add-C-tests.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]