From owner-svn-src-head@FreeBSD.ORG Thu Aug 29 16:42:27 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 835AB48F; Thu, 29 Aug 2013 16:42:27 +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 573502710; Thu, 29 Aug 2013 16:42:27 +0000 (UTC) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7TGgQ36016980 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 29 Aug 2013 12:42:27 -0400 Received: from [10.3.113.179] (ovpn-113-179.phx2.redhat.com [10.3.113.179]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r7TGgNKY023121; Thu, 29 Aug 2013 12:42:23 -0400 Message-ID: <521F79EF.5070402@redhat.com> Date: Thu, 29 Aug 2013 10:42:23 -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 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> <521F77D0.4010904@redhat.com> In-Reply-To: <521F77D0.4010904@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="PpD6qbvI4rWi4lM3kUox8WWUREXbIH3Hb" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Cc: svn-src-head@freebsd.org, libvir-list , "Daniel P. Berrange" , 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:42:27 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PpD6qbvI4rWi4lM3kUox8WWUREXbIH3Hb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/29/2013 10:33 AM, Eric Blake wrote: >> Since gnulib has a working random_r() function can we just make >> gnulib replace the boneheaded freebsd impl ? >=20 > 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(), an= d > 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. >=20 > 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(). >=20 > I'll play around with a patch. As it is, POSIX recommends the use of drand48() and friends for multithreaded apps, not random() (where lrand48() would match precisely with a RAND_MAX of 0x7fffffff); but that's because POSIX lacks random_r(). But since gnulib lacks [dl]rand48(), I still think libvirt is still better off sticking with random_r(), and just avoiding the red herring of a potentially unrelated RAND_MAX. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --PpD6qbvI4rWi4lM3kUox8WWUREXbIH3Hb 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/ iQEcBAEBCAAGBQJSH3nvAAoJEKeha0olJ0Nqi48H+gK44w2QBlPnfrQOe0GzHbGt Tl6q/YEIfXz0+/kAOIONh/TW21+oO2PuYl6sHsAoRDri88prFa1GCnFyH8ZBxYis tZiteHg6kDnNt7Q24pVebnXjoEgHDR40K7WOJqUj0gXPFKjXqixsALywC7XQduxg Kb5Xx5uDjidT8x2emeOXq7BkgiI6rGT3S3PHiZ03nXh26Zk7FhEZVIegVBq/MZud A6s0IamrAvH31k/cCqw8Gik6k3gxwjADzbKHLqJyJ+sIdrrLtA8ONt5GIy17+spy mgIw7rQkrg5AMaA6UBn4/JbOzOMfWvtfuSnOfT51xLaPG1QHbCI6r3oUGH76IwQ= =xAUs -----END PGP SIGNATURE----- --PpD6qbvI4rWi4lM3kUox8WWUREXbIH3Hb--