unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Samuel Thibault via Libc-alpha <libc-alpha@sourceware.org>
To: Sergey Bugaev <bugaevc@gmail.com>
Cc: bug-hurd@gnu.org, libc-alpha@sourceware.org, gfleury@disroot.org,
	riccardo.mottola@libero.it, andrew.eggenberger@gmail.com
Subject: Re: [PATCH v2] hurd: Make getrandom cache the server port
Date: Fri, 2 Dec 2022 10:17:10 +0100	[thread overview]
Message-ID: <20221202091710.qwrcmubhzxuf7qxq@begin> (raw)
In-Reply-To: <20221202091351.74292-1-bugaevc@gmail.com>

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 second series of file_t

> -  if (flags & GRND_RANDOM)
> -    random_source = "/dev/random";
> +  cached_server = (flags & GRND_NONBLOCK) ? &random_server_nonblock
> +                                          : &random_server;

and multiplexing here.

Thanks for your work on this,
Samuel

  reply	other threads:[~2022-12-02  9:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221130003150.4mnx6xd2g53rox7a@begin>
2022-12-02  9:13 ` [PATCH v2] hurd: Make getrandom cache the server port Sergey Bugaev via Libc-alpha
2022-12-02  9:17   ` Samuel Thibault via Libc-alpha [this message]
2022-12-02 13:18     ` Sergey Bugaev via Libc-alpha
2022-12-02 13:55       ` Samuel Thibault via Libc-alpha
2022-12-02 13:55       ` [PATCH v3] " Sergey Bugaev via Libc-alpha
2022-12-02 14:04         ` Sergey Bugaev via Libc-alpha
2022-12-02 22:46         ` Samuel Thibault via Libc-alpha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221202091710.qwrcmubhzxuf7qxq@begin \
    --to=libc-alpha@sourceware.org \
    --cc=andrew.eggenberger@gmail.com \
    --cc=bug-hurd@gnu.org \
    --cc=bugaevc@gmail.com \
    --cc=gfleury@disroot.org \
    --cc=riccardo.mottola@libero.it \
    --cc=samuel.thibault@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).