public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: Re: [PATCH] arc4random: fix getrandom fallback to /dev/urandom
Date: Wed, 3 Apr 2024 14:48:12 -0300	[thread overview]
Message-ID: <57bf1728-de5d-4ee5-9d79-ea49ad66a40c@linaro.org> (raw)
In-Reply-To: <87zfuagxih.fsf@oldenburg.str.redhat.com>



On 03/04/24 14:35, Florian Weimer wrote:
> * Anthony Iliopoulos:
> 
>> diff --git a/stdlib/arc4random.c b/stdlib/arc4random.c
>> index 3ae8fc130234..9b6a6ee85150 100644
>> --- a/stdlib/arc4random.c
>> +++ b/stdlib/arc4random.c
>> @@ -42,7 +42,7 @@ __arc4random_buf (void *p, size_t n)
>>  
>>    for (;;)
>>      {
>> -      l = TEMP_FAILURE_RETRY (__getrandom_nocancel (p, n, 0));
>> +      l = TEMP_FAILURE_RETRY (__getrandom_nocancel_nostatus (p, n, 0));
>>        if (l > 0)
>>  	{
>>  	  if ((size_t) l == n)
> 
> TEMP_FAILURE_RETRY is incompatible with __getrandom_nocancel_nostatus.
> You need to check for -EINTR and try again.

It does work, it will return -ENOSYS in this case.

  reply	other threads:[~2024-04-03 17:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03 16:55 Anthony Iliopoulos
2024-04-03 17:26 ` Adhemerval Zanella Netto
2024-04-03 17:35 ` Florian Weimer
2024-04-03 17:48   ` Adhemerval Zanella Netto [this message]
2024-04-03 17:50     ` Adhemerval Zanella Netto

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

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

  git send-email \
    --in-reply-to=57bf1728-de5d-4ee5-9d79-ea49ad66a40c@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.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).