Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Feb 2001 20:23:45 -0800
From:      Kris Kennaway <kris@obsecurity.org>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        Nick Sayer <nsayer@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: ports/astro/xglobe/files patch-random
Message-ID:  <20010224202345.A15392@mollari.cthul.hu>
In-Reply-To: <Pine.NEB.3.96L.1010224225440.85229W-100000@fledge.watson.org>; from rwatson@FreeBSD.org on Sat, Feb 24, 2001 at 10:55:24PM -0500
References:  <200102250306.f1P36eY37040@freefall.freebsd.org> <Pine.NEB.3.96L.1010224225440.85229W-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--tThc/1wpZn/ma/RB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Feb 24, 2001 at 10:55:24PM -0500, Robert Watson wrote:
> Hmm.  I thought there was a BUGS section in rand(3), but apparently not --
> I must be thinking of some other operating system.  We need to add one,
> and I'm surprised there isn't one already.

How about this also:

Index: stdlib/rand.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /mnt/ncvs/src/lib/libc/stdlib/rand.c,v
retrieving revision 1.2
diff -u -r1.2 rand.c
--- stdlib/rand.c	1999/05/24 23:30:12	1.2
+++ stdlib/rand.c	2001/02/25 04:13:07
@@ -50,6 +50,8 @@
 	return ((*ctx =3D *ctx * 1103515245 + 12345) % ((u_long)RAND_MAX + 1));
 }
=20
+__warn_references(rand_r,
+	"warning: rand_r() does not produce high-quality random numbers and shoul=
d not generally be used");
=20
 int
 rand_r(unsigned int *ctx)
@@ -61,6 +63,9 @@
=20
=20
 static u_long next =3D 1;
+
+__warn_references(rand,
+	"warning: rand() does not produce high-quality random numbers and should =
not generally be used");
=20
 int
 rand()

Kris
--tThc/1wpZn/ma/RB
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (FreeBSD)
Comment: For info see http://www.gnupg.org

iD8DBQE6mIjQWry0BWjoQKURAvflAJ4qNngLSD/w2mxpB4ZcO313nZqK6wCfe6NB
tP/M4il8X8dAsA6iWh2+HBo=
=UlhU
-----END PGP SIGNATURE-----

--tThc/1wpZn/ma/RB--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010224202345.A15392>