From owner-svn-src-head@FreeBSD.ORG Thu Aug 29 16:36:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 08352C8; Thu, 29 Aug 2013 16:36:22 +0000 (UTC) (envelope-from eblake@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx1.freebsd.org (Postfix) with ESMTP id DB23326A1; Thu, 29 Aug 2013 16:36:21 +0000 (UTC) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7TGaLXw014661 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 29 Aug 2013 12:36:21 -0400 Received: from [10.3.113.179] (ovpn-113-179.phx2.redhat.com [10.3.113.179]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r7TGXLo0005224; Thu, 29 Aug 2013 12:33:21 -0400 Message-ID: <521F77D0.4010904@redhat.com> Date: Thu, 29 Aug 2013 10:33:20 -0600 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 MIME-Version: 1.0 To: "Daniel P. Berrange" Subject: Re: [libvirt] FreeBSD, no gcc present libvirt build issue References: <521F63F4.4020406@redhat.com> <521F6C0F.9060007@redhat.com> <521F6E54.1070104@redhat.com> <20130829160349.GV14547@redhat.com> In-Reply-To: <20130829160349.GV14547@redhat.com> X-Enigmail-Version: 1.5.2 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ni3INlrofdMhmrmoTwFt9g3Utxtb7w4LQ" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Cc: svn-src-head@freebsd.org, libvir-list , Jason Helfman X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2013 16:36:22 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ni3INlrofdMhmrmoTwFt9g3Utxtb7w4LQ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/29/2013 10:03 AM, Daniel P. Berrange wrote: >> I think I can fix libvirt to work around the boneheaded decision; >> basically, since we cannot trust the full range of random_r to be even= ly >> distributed, I will have to tweak libvirt's call to truncate every cal= l >> to random_r to a subset of bits that are more likely to be evenly >> distributed (maybe by shifting off the most- and least-significant bit= s >> returned, and only using 28 instead of 31 bits of randomness per call)= =2E >> But I would MUCH rather prefer that FreeBSD revisit their decision, a= nd >> guarantee that random output be evenly distributed across the full 31 >> bits to begin with. >=20 > Since gnulib has a working random_r() function can we just make > gnulib replace the boneheaded freebsd impl ? Huh - the glibc man pages state that random_r returns RAND_MAX bits. random_r is a glibc extension: POSIX only requires rand(), rand_r(), and random(); but even with random(), POSIX has no requirements that it be related to RAND_MAX - so the fact that glibc equates random()/random_r() with RAND_MAX is also a glibc extension. I guess that means we should't be worrying about RAND_MAX in the first place, as it is tied to the (potentially algorithmically weaker) rand(), and need not have any bearing on the fact that we already use gnulib's random_r(). I'll play around with a patch. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ni3INlrofdMhmrmoTwFt9g3Utxtb7w4LQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSH3fQAAoJEKeha0olJ0Nq8X8IAIcSWDLm4y7ogEUjrx6mTr/f 0rRUs50m58BQYtH0OXqelBDs5ShphhM60+8LpJ5kn9UICu++9/EPzETAyGytaYcy 6is3LKfBaY4w7RYqCsLowqe5zy+Dni1DyAZ9JWd0ZMIaj+mty9PDEpoii91l8Cru uInNbGz1YEwV5T0xURroLSMfjGIEPMAjFTvYxWnmQLLwXRBJcjc2yq2t9b4xvaub CubnXItenau2acXD7ajRvSO3RpWa46C07+MWu96amTqSxG9JGSHDnpWFKLeWtB5p yKZq4rUcTT+sjNhvIyrT+YgJDauFnS3RJ/er4M8yzkfM5NX4pUfQGjvUksKMatk= =EfEB -----END PGP SIGNATURE----- --ni3INlrofdMhmrmoTwFt9g3Utxtb7w4LQ--