From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15540 invoked by alias); 13 Aug 2018 20:07:36 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 15515 invoked by uid 89); 13 Aug 2018 20:07:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:942 X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 13 Aug 2018 20:07:34 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 28AF240241C0; Mon, 13 Aug 2018 20:07:33 +0000 (UTC) Received: from laptop.zalov.cz (ovpn-116-43.ams2.redhat.com [10.36.116.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B61E310EE77E; Mon, 13 Aug 2018 20:07:32 +0000 (UTC) Received: from laptop.zalov.cz (localhost [127.0.0.1]) by laptop.zalov.cz (8.15.2/8.15.2) with ESMTP id w7DK7SK7023756; Mon, 13 Aug 2018 22:07:29 +0200 Received: (from jakub@localhost) by laptop.zalov.cz (8.15.2/8.15.2/Submit) id w7DK7QE2023753; Mon, 13 Aug 2018 22:07:26 +0200 Date: Mon, 13 Aug 2018 20:07:00 -0000 From: Jakub Jelinek To: Janne Blomqvist Cc: Fortran List , GCC Patches Subject: Re: [PATCH] Use getentropy() for seeding PRNG Message-ID: <20180813200725.GG20910@laptop.zalov.cz> Reply-To: Jakub Jelinek References: <20180803131903.24303-1-blomqvist.janne@gmail.com> <20180803132827.GO17988@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-SW-Source: 2018-08/txt/msg00057.txt.bz2 On Mon, Aug 13, 2018 at 01:12:12PM +0300, Janne Blomqvist wrote: > PING LGTM. > > diff --git a/libgfortran/intrinsics/random.c b/libgfortran/intrinsics/ > > random.c > > index 234c5ff95fd..229fa6995c0 100644 > > --- a/libgfortran/intrinsics/random.c > > +++ b/libgfortran/intrinsics/random.c > > @@ -310,11 +310,10 @@ getosrandom (void *buf, size_t buflen) > > rand_s (&b[i]); > > return buflen; > > #else > > - /* > > - TODO: When glibc adds a wrapper for the getrandom() system call > > - on Linux, one could use that. > > - > > - TODO: One could use getentropy() on OpenBSD. */ > > +#ifdef HAVE_GETENTROPY > > + if (getentropy (buf, buflen) == 0) > > + return 0; > > +#endif > > int flags = O_RDONLY; > > #ifdef O_CLOEXEC > > flags |= O_CLOEXEC; > > > > > > > > Just to be sure, I regtested this slightly modified patch as well. Ok for > > trunk? > > > > -- > > Janne Blomqvist > > Jakub