From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15927 invoked by alias); 21 Jul 2013 19:55:26 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 12743 invoked by uid 48); 21 Jul 2013 19:53:24 -0000 From: "paolo.carlini at oracle dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/57920] [c++11] Linux: std::random_device reads too much from /dev/urandom Date: Sun, 21 Jul 2013 19:55:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.7.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: paolo.carlini at oracle dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-07/txt/msg00954.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57920 --- Comment #1 from Paolo Carlini --- Note that in 4.8.x and mainline for modern x86 and x86_64 targets we don't use /dev/urandom at all, we use __x86_rdrand. In general, the idea is that more targets should use hardware support for random numbers and /dev/urandom become just a fall back. I'm not sure changing fread to read it's worth the trouble, and the change, since we are not talking about a regression, would not go in 4.7.x branch anyway. Are you on x86 / x86_64 or something else?