From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 79AAC1F601 for ; Fri, 2 Dec 2022 09:17:40 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="BqtQvxDY"; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E43F8385843E for ; Fri, 2 Dec 2022 09:17:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E43F8385843E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669972657; bh=sH9Ck67BeLHeUBaIIBC8iyM0cIEwhPS0bxiKBgYQnHs=; h=Date:To:Cc:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=BqtQvxDY7BNREg5zVmdplEFAGEbpqnnkqNJzv4OVN0uwtnrwaaDsE+UfyRy41alVz GJteTrl5lADjYnqTCj9P1aL8T7TsyK7e0aArN61nMT3Ab6WASVkNto7oA2W9ahp7ex 1l89nwGKR9+le32S+aNxj6HdRAsCZS+SLBf+SniE= Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 77221385B180 for ; Fri, 2 Dec 2022 09:17:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 77221385B180 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p12AV-0000Mp-3F; Fri, 02 Dec 2022 04:17:15 -0500 Received: from nat-inria-interne-52-gw-01-bso.bordeaux.inria.fr ([194.199.1.52] helo=begin) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p12AU-0005rv-Px; Fri, 02 Dec 2022 04:17:14 -0500 Received: from samy by begin with local (Exim 4.96) (envelope-from ) id 1p12AQ-0011YV-1W; Fri, 02 Dec 2022 10:17:10 +0100 Date: Fri, 2 Dec 2022 10:17:10 +0100 To: Sergey Bugaev 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 Message-ID: <20221202091710.qwrcmubhzxuf7qxq@begin> Mail-Followup-To: Sergey Bugaev , bug-hurd@gnu.org, libc-alpha@sourceware.org, gfleury@disroot.org, riccardo.mottola@libero.it, andrew.eggenberger@gmail.com References: <20221130003150.4mnx6xd2g53rox7a@begin> <20221202091351.74292-1-bugaevc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221202091351.74292-1-bugaevc@gmail.com> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Samuel Thibault via Libc-alpha Reply-To: Samuel Thibault Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" 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