This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Why is getentropy marked with warn_unused_result?
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Florian Weimer <fw at deneb dot enyo dot de>
- Cc: Florian Bruhin <me at the-compiler dot org>, Paul Pluzhnikov <ppluzhnikov at google dot com>, GLIBC Devel <libc-alpha at sourceware dot org>, <libc-help at sourceware dot org>
- Date: Fri, 28 Jul 2017 00:12:20 +0000
- Subject: Re: Why is getentropy marked with warn_unused_result?
- Authentication-results: sourceware.org; auth=none
- References: <20170722211442.wmqbkjsw4t6rd4i3@hooch.localdomain> <CALoOobMps6BSAOfBdu1cxN9+MD-YsNPfzp1SZJ8oUJYt11t4uQ@mail.gmail.com> <877eyzij7z.fsf@mid.deneb.enyo.de> <20170723101616.mcs25wpj2lis4y2y@hooch.localdomain> <87lgnfh2lk.fsf@mid.deneb.enyo.de>
On Sun, 23 Jul 2017, Florian Weimer wrote:
> I'm still open to implementing emulation within glibc if problems like
> these convince the glibc community that this is necessary.
I don't object to a straightforward emulation that opens /dev/urandom with
O_CLOEXEC, does the read and closes the file, each time getentropy is
called (if __NR_getrandom is not defined, or if the getrandom syscall
returns an ENOSYS error). The argument for emulation in getentropy is
stronger than that for emulating the lower-level getrandom interface.
--
Joseph S. Myers
joseph@codesourcery.com