diff options
author | Bruno Haible <bruno@clisp.org> | 2020-05-31 18:47:12 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-05-31 18:47:12 +0200 |
commit | 9de2f9ad0a12f0c048e9c9e573f77f35288f0c43 (patch) | |
tree | f91d6a21a805d80dc6c9616e29328a1786c71769 /lib | |
parent | 8175e3ddda29a03d5e0aec4a1774339414996565 (diff) | |
download | gnulib-9de2f9ad0a12f0c048e9c9e573f77f35288f0c43.tar.gz |
getrandom: Doc and test tweaks.
* lib/getrandom.c (getrandom): Mention that it never returns 0, and that
it sets errno when failing.
* tests/test-getrandom.c (main): Disable the high-quality check on those
platforms on which it fails.
* doc/glibc-functions/getrandom.texi: Add Minix, AIX, HP-UX, IRIX,
Cygwin to the list of platforms that don't have the function. Add a note
about the quality of the result.
* doc/glibc-headers/sys_random.texi: Don't mention the 'getrandom'
declaration; this is fixed by module 'getrandom'.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/getrandom.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/getrandom.c b/lib/getrandom.c index ad49cae896..f0b3f53500 100644 --- a/lib/getrandom.c +++ b/lib/getrandom.c @@ -98,7 +98,8 @@ initialize (void) #endif /* Set BUFFER (of size LENGTH) to random bytes under the control of FLAGS. - Return the number of bytes written, or -1 on error. */ + Return the number of bytes written (> 0). + Upon error, return -1 and set errno. */ ssize_t getrandom (void *buffer, size_t length, unsigned int flags) #undef getrandom |