This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Add getrandom implementation [BZ #17252]
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: Joseph Myers <joseph at codesourcery dot com>, Florian Weimer <fweimer at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 10 Jun 2016 15:00:32 -0700
- Subject: Re: [PATCH] Add getrandom implementation [BZ #17252]
- Authentication-results: sourceware.org; auth=none
- References: <20160610210303 dot 6CE3E40141175 at oldenburg dot str dot redhat dot com> <alpine dot DEB dot 2 dot 20 dot 1606102115300 dot 20503 at digraph dot polyomino dot org dot uk>
On 06/10/2016 02:30 PM, Joseph Myers wrote:
Are we sure we want to keep file descriptors open that the application
can't use? Is it not valid for applications to close all open file
Yes, it's valid.
How about if we use a simpler implementation instead, one that opens,
reads, and closes /dev/whatever each time getrandom is called? That
would be a bit slower slower but would avoid this problem and probably
Performance should not the overriding goal here, as anybody who wants
lots of random numbers efficiently shouldn't be using getrandom,
regardless of whether it is a syscall.