From 9de2f9ad0a12f0c048e9c9e573f77f35288f0c43 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 31 May 2020 18:47:12 +0200 Subject: 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'. --- lib/getrandom.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') 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 -- cgit v1.2.1