Re: [PATCH v2] hurd: Make getrandom cache the server port

2022-12-02 Thread Samuel Thibault
Sergey Bugaev, le ven. 02 déc. 2022 16:18:33 +0300, a ecrit: > On Fri, Dec 2, 2022 at 12:17 PM Samuel Thibault > wrote: > > Sergey Bugaev, le ven. 02 déc. 2022 12:13:51 +0300, a ecrit: > > > Caveat: this new implementation does not respect the GRND_RANDOM flag > > > and always uses /dev/urandom t

Re: [PATCH v2] hurd: Make getrandom cache the server port

2022-12-02 Thread Sergey Bugaev
On Fri, Dec 2, 2022 at 12:17 PM Samuel Thibault wrote: > > Hello, > > Sergey Bugaev, le ven. 02 déc. 2022 12:13:51 +0300, a ecrit: > > Caveat: this new implementation does not respect the GRND_RANDOM flag > > and always uses /dev/urandom to read random data. > > It should be easy to fix that? > By

Re: [PATCH v2] hurd: Make getrandom cache the server port

2022-12-02 Thread Samuel Thibault
Hello, Sergey Bugaev, le ven. 02 déc. 2022 12:13:51 +0300, a ecrit: > Caveat: this new implementation does not respect the GRND_RANDOM flag > and always uses /dev/urandom to read random data. It should be easy to fix that? > +static file_t random_server, random_server_nonblock; By adding a seco

[PATCH v2] hurd: Make getrandom cache the server port

2022-12-02 Thread Sergey Bugaev
Previously, getrandom would, each time it's called, traverse the file system to find /dev/urandom, fetch some random data from it, then throw away that port. This is quite slow, while calls to getrandom are genrally expected to be fast. Additionally, this means that getrandom can not work when /de