* getentropy clarifications
@ 2017-03-29 12:46 Nikos Mavrogiannopoulos
[not found] ` <1490791607.28079.8.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Nikos Mavrogiannopoulos @ 2017-03-29 12:46 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 92 bytes --]
Hi,
The attached patches clarify some parts of the getentropy() functions.
regards,
Nikos
[-- Attachment #2: 0001-getentropy-corrected-the-header-it-is-defined-under.patch --]
[-- Type: text/x-patch, Size: 1012 bytes --]
From be741e2dde51a060c4294780f5dad83e967955a2 Mon Sep 17 00:00:00 2001
From: Nikos Mavrogiannopoulos <nmav@redhat.com>
Date: Wed, 29 Mar 2017 14:43:14 +0200
Subject: [PATCH 1/2] getentropy: corrected the header it is defined under
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
---
man3/getentropy.3 | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/man3/getentropy.3 b/man3/getentropy.3
index 697f937..4cd4d61 100644
--- a/man3/getentropy.3
+++ b/man3/getentropy.3
@@ -26,7 +26,7 @@
.SH NAME
getentropy \- fill a buffer with random bytes
.SH SYNOPSIS
-.B #include <sys/random.h>
+.B #include <unistd.h>
.sp
.BI "int getentropy(void *" buffer ", size_t " length );
.SH DESCRIPTION
@@ -90,6 +90,10 @@ a cancellation point,
.BR getentropy ()
is not a cancellation point.
+In earlier versions of glibc this function was avaible under the
+.BR <sys/random.h>
+header.
+
A call to
.BR getentropy ()
may block if the system has just booted and the kernel has
--
2.9.3
[-- Attachment #3: 0002-getentropy-clarify-returns.patch --]
[-- Type: text/x-patch, Size: 787 bytes --]
From 112c3653fd293453504bffff35b60785c9f82c40 Mon Sep 17 00:00:00 2001
From: Nikos Mavrogiannopoulos <nmav@redhat.com>
Date: Wed, 29 Mar 2017 14:44:21 +0200
Subject: [PATCH 2/2] getentropy: clarify "returns"
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
---
man3/getentropy.3 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/man3/getentropy.3 b/man3/getentropy.3
index 4cd4d61..b341284 100644
--- a/man3/getentropy.3
+++ b/man3/getentropy.3
@@ -43,7 +43,7 @@ argument is 256.
A successful call to
.BR getentropy ()
-always returns the requested number of bytes of entropy.
+always returns zero and provides the requested number of bytes of entropy.
.SH RETURN VALUE
On success, this function returns zero,
On error, \-1 is returned, and
--
2.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: getentropy clarifications
[not found] ` <1490791607.28079.8.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2017-03-31 11:31 ` Florian Weimer
[not found] ` <87pogxlm2e.fsf-ZqZwdwZz9NfTBotR3TxKnbNAH6kLmebB@public.gmane.org>
2017-04-10 12:06 ` Michael Kerrisk (man-pages)
1 sibling, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2017-03-31 11:31 UTC (permalink / raw)
To: Nikos Mavrogiannopoulos
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
linux-man-u79uwXL29TY76Z2rM5mHXA
* Nikos Mavrogiannopoulos:
> +In earlier versions of glibc this function was avaible under the
> +.BR <sys/random.h>
> +header.
It's still available in <sys/random.h>, and the declaration there can
still be useful if you want to compile without feature test macros.
In addition, I don't think there ever was a released glibc version
where getentropy was declared in <sys/random.h>, but not in <unistd.h>
(with the relevant feature test macros).
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: getentropy clarifications
[not found] ` <1490791607.28079.8.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-03-31 11:31 ` Florian Weimer
@ 2017-04-10 12:06 ` Michael Kerrisk (man-pages)
1 sibling, 0 replies; 4+ messages in thread
From: Michael Kerrisk (man-pages) @ 2017-04-10 12:06 UTC (permalink / raw)
To: Nikos Mavrogiannopoulos
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
linux-man-u79uwXL29TY76Z2rM5mHXA
On 03/29/2017 02:46 PM, Nikos Mavrogiannopoulos wrote:
> Hi,
> The attached patches clarify some parts of the getentropy() functions.
Thanks, Nikos. Applied. I'll clarify things a little
in the light of Florian's comments.
Cheers,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: getentropy clarifications
[not found] ` <87pogxlm2e.fsf-ZqZwdwZz9NfTBotR3TxKnbNAH6kLmebB@public.gmane.org>
@ 2017-04-10 12:09 ` Michael Kerrisk (man-pages)
0 siblings, 0 replies; 4+ messages in thread
From: Michael Kerrisk (man-pages) @ 2017-04-10 12:09 UTC (permalink / raw)
To: Florian Weimer, Nikos Mavrogiannopoulos
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
linux-man-u79uwXL29TY76Z2rM5mHXA
On 03/31/2017 01:31 PM, Florian Weimer wrote:
> * Nikos Mavrogiannopoulos:
>
>> +In earlier versions of glibc this function was avaible under the
>> +.BR <sys/random.h>
>> +header.
>
> It's still available in <sys/random.h>, and the declaration there can
> still be useful if you want to compile without feature test macros.
>
> In addition, I don't think there ever was a released glibc version
> where getentropy was declared in <sys/random.h>, but not in <unistd.h>
> (with the relevant feature test macros).
Thanks, Florian. I tweaked the page to mention the FTM requirements
when using <unistd.h>, and modified the text in NOTES to read:
getentropy() is also declared in <sys/random.h>. (No feature test
macro need be defined to obtain the declaration from that header
file.)
Cheers,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-04-10 12:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-29 12:46 getentropy clarifications Nikos Mavrogiannopoulos
[not found] ` <1490791607.28079.8.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-03-31 11:31 ` Florian Weimer
[not found] ` <87pogxlm2e.fsf-ZqZwdwZz9NfTBotR3TxKnbNAH6kLmebB@public.gmane.org>
2017-04-10 12:09 ` Michael Kerrisk (man-pages)
2017-04-10 12:06 ` Michael Kerrisk (man-pages)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox