summaryrefslogtreecommitdiff
path: root/usr/src/man/man3c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/man/man3c')
-rw-r--r--usr/src/man/man3c/Makefile11
-rw-r--r--usr/src/man/man3c/THIRDPARTYLICENSE.arc4random30
-rw-r--r--usr/src/man/man3c/THIRDPARTYLICENSE.arc4random.descrip1
-rw-r--r--usr/src/man/man3c/THIRDPARTYLICENSE.getentropy16
-rw-r--r--usr/src/man/man3c/THIRDPARTYLICENSE.getentropy.descrip1
-rw-r--r--usr/src/man/man3c/arc4random.3c106
-rw-r--r--usr/src/man/man3c/bstring.3c28
-rw-r--r--usr/src/man/man3c/drand48.3c10
-rw-r--r--usr/src/man/man3c/getentropy.3c65
-rw-r--r--usr/src/man/man3c/rand.3c10
-rw-r--r--usr/src/man/man3c/random.3c17
11 files changed, 263 insertions, 32 deletions
diff --git a/usr/src/man/man3c/Makefile b/usr/src/man/man3c/Makefile
index 88e1741bc2..9e88c23bec 100644
--- a/usr/src/man/man3c/Makefile
+++ b/usr/src/man/man3c/Makefile
@@ -14,7 +14,7 @@
# Copyright 2013 Nexenta Systems, Inc. All rights reserved.
# Copyright 2013, OmniTI Computer Consulting, Inc. All rights reserved.
# Copyright 2014 Garrett D'Amore <garrett@damore.org>
-# Copyright (c) 2014, Joyent, Inc. All rights reserved.
+# Copyright (c) 2015, Joyent, Inc. All rights reserved.
#
include $(SRC)/Makefile.master
@@ -40,6 +40,7 @@ MANFILES= __fbufsize.3c \
aiocancel.3c \
aioread.3c \
aiowait.3c \
+ arc4random.3c \
assert.3c \
atexit.3c \
atomic_add.3c \
@@ -155,6 +156,7 @@ MANFILES= __fbufsize.3c \
getcwd.3c \
getdate.3c \
getdtablesize.3c \
+ getentropy.3c \
getenv.3c \
getexecname.3c \
getgrnam.3c \
@@ -567,6 +569,8 @@ MANLINKS= FD_CLR.3c \
atoi.3c \
atol.3c \
atoll.3c \
+ arc4random_buf.3c \
+ arc4random_uniform.3c \
atomic_add_16.3c \
atomic_add_16_nv.3c \
atomic_add_32.3c \
@@ -743,6 +747,7 @@ MANLINKS= FD_CLR.3c \
etext.3c \
euccol.3c \
eucscol.3c \
+ explicit_bzero.3c \
extended_to_decimal.3c \
fconvert.3c \
fcvt.3c \
@@ -1354,6 +1359,9 @@ llabs.3c := LINKSRC = abs.3c
aiowrite.3c := LINKSRC = aioread.3c
+arc4random_buf.3c := LINKSRC = arc4random.3c
+arc4random_uniform.3c := LINKSRC = arc4random.3c
+
atomic_add_16.3c := LINKSRC = atomic_add.3c
atomic_add_16_nv.3c := LINKSRC = atomic_add.3c
atomic_add_32.3c := LINKSRC = atomic_add.3c
@@ -1470,6 +1478,7 @@ atomic_swap_ushort.3c := LINKSRC = atomic_swap.3c
bcmp.3c := LINKSRC = bstring.3c
bcopy.3c := LINKSRC = bstring.3c
bzero.3c := LINKSRC = bstring.3c
+explicit_bzero.3c := LINKSRC = bstring.3c
btowc_l.3c := LINKSRC = btowc.3c
diff --git a/usr/src/man/man3c/THIRDPARTYLICENSE.arc4random b/usr/src/man/man3c/THIRDPARTYLICENSE.arc4random
new file mode 100644
index 0000000000..e220e853cd
--- /dev/null
+++ b/usr/src/man/man3c/THIRDPARTYLICENSE.arc4random
@@ -0,0 +1,30 @@
+.\" $OpenBSD: arc4random.3,v 1.35 2014/11/25 16:45:24 millert Exp $
+.\"
+.\" Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by Niels Provos.
+.\" 4. The name of the author may not be used to endorse or promote products
+.\" derived from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
diff --git a/usr/src/man/man3c/THIRDPARTYLICENSE.arc4random.descrip b/usr/src/man/man3c/THIRDPARTYLICENSE.arc4random.descrip
new file mode 100644
index 0000000000..067aa2c7ef
--- /dev/null
+++ b/usr/src/man/man3c/THIRDPARTYLICENSE.arc4random.descrip
@@ -0,0 +1 @@
+ARC4RANDOM MANUAL PAGE
diff --git a/usr/src/man/man3c/THIRDPARTYLICENSE.getentropy b/usr/src/man/man3c/THIRDPARTYLICENSE.getentropy
new file mode 100644
index 0000000000..64bec32b8a
--- /dev/null
+++ b/usr/src/man/man3c/THIRDPARTYLICENSE.getentropy
@@ -0,0 +1,16 @@
+.\" $OpenBSD: getentropy.2,v 1.7 2014/12/10 19:19:00 schwarze Exp $
+.\"
+.\" Copyright (c) 2014 Theo de Raadt
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
diff --git a/usr/src/man/man3c/THIRDPARTYLICENSE.getentropy.descrip b/usr/src/man/man3c/THIRDPARTYLICENSE.getentropy.descrip
new file mode 100644
index 0000000000..7eef632426
--- /dev/null
+++ b/usr/src/man/man3c/THIRDPARTYLICENSE.getentropy.descrip
@@ -0,0 +1 @@
+GETENTROPY MANUAL PAGE
diff --git a/usr/src/man/man3c/arc4random.3c b/usr/src/man/man3c/arc4random.3c
new file mode 100644
index 0000000000..317fd31769
--- /dev/null
+++ b/usr/src/man/man3c/arc4random.3c
@@ -0,0 +1,106 @@
+.\" $OpenBSD: arc4random.3,v 1.35 2014/11/25 16:45:24 millert Exp $
+.\"
+.\" Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by Niels Provos.
+.\" 4. The name of the author may not be used to endorse or promote products
+.\" derived from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" Manual page, using -mandoc macros
+.\"
+.Dd "Dec 31, 2014"
+.Dt ARC4RANDOM 3C
+.Os
+.Sh NAME
+.Nm arc4random ,
+.Nm arc4random_buf ,
+.Nm arc4random_uniform
+.Nd random number generator
+.Sh SYNOPSIS
+.In stdlib.h
+.Ft uint32_t
+.Fn arc4random "void"
+.Ft void
+.Fn arc4random_buf "void *buf" "size_t nbytes"
+.Ft uint32_t
+.Fn arc4random_uniform "uint32_t upper_bound"
+.Sh DESCRIPTION
+This family of functions provides higher quality data than those
+described in
+.Xr rand 3C ,
+.Xr random 3C ,
+and
+.Xr rand48 3C .
+.Pp
+Use of these functions is encouraged for almost all random number
+consumption because the other interfaces are deficient in either
+quality, portability, standardization, or availability.
+These functions can be called in almost all coding environments,
+including
+.Xr pthreads 5
+and
+.Xr chroot 2 .
+.Pp
+High quality 32-bit pseudo-random numbers are generated very quickly.
+On each call, a cryptographic pseudo-random number generator is used
+to generate a new result.
+One data pool is used for all consumers in a process, so that consumption
+under program flow can act as additional stirring.
+The subsystem is re-seeded from the kernel random number subsystem using
+.Xr getentropy 2
+on a regular basis, and also upon
+.Xr fork 2 .
+.Pp
+The
+.Fn arc4random
+function returns a single 32-bit value.
+.Pp
+.Fn arc4random_buf
+fills the region
+.Fa buf
+of length
+.Fa nbytes
+with random data.
+.Pp
+.Fn arc4random_uniform
+will return a single 32-bit value, uniformly distributed but less than
+.Fa upper_bound .
+This is recommended over constructions like
+.Dq Li arc4random() % upper_bound
+as it avoids "modulo bias" when the upper bound is not a power of two.
+In the worst case, this function may consume multiple iterations
+to ensure uniformity; see the source code to understand the problem
+and solution.
+.Sh RETURN VALUES
+These functions are always successful, and no return value is
+reserved to indicate an error.
+.Sh INTERFACE STABILITY
+.Sy Committed
+.Sh MT-LEVEL
+.Sy MT-Safe
+.Sh SEE ALSO
+.Xr rand 3C ,
+.Xr rand48 3C ,
+.Xr random 3C
diff --git a/usr/src/man/man3c/bstring.3c b/usr/src/man/man3c/bstring.3c
index f65f221ac5..873c64fe80 100644
--- a/usr/src/man/man3c/bstring.3c
+++ b/usr/src/man/man3c/bstring.3c
@@ -1,11 +1,12 @@
'\" te
.\" Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright (c) 2015, Joyent, Inc.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH BSTRING 3C "Apr 15, 2002"
+.TH BSTRING 3C "Dec 31, 2014"
.SH NAME
-bstring, bcopy, bcmp, bzero \- memory operations
+bstring, bcopy, bcmp, bzero, explicit_bzero \- memory operations
.SH SYNOPSIS
.LP
.nf
@@ -24,8 +25,12 @@ bstring, bcopy, bcmp, bzero \- memory operations
\fBvoid\fR \fBbzero\fR(\fBvoid *\fR\fIs\fR, \fBsize_t\fR \fIn\fR);
.fi
+.LP
+.nf
+\fBvoid\fR \fBexplicit_bzero\fR(\fBvoid *\fR\fIs\fR, \fBsize_t\fR \fIn\fR);
+.fi
+
.SH DESCRIPTION
-.sp
.LP
The \fBbcopy()\fR, \fBbcmp()\fR, and \fBbzero()\fR functions operate as
efficiently as possible on memory areas (arrays of bytes bounded by a count,
@@ -46,13 +51,15 @@ always returns 0 when \fIn\fR is 0.
.LP
The \fBbzero()\fR function sets the first \fIn\fR bytes in memory area \fIs\fR
to 0.
-.SH WARNINGS
.sp
.LP
-The \fBbcopy()\fR function takes parameters backwards from \fBmemcmp()\fR. See
-\fBmemory\fR(3C).
+The \fBexplicit_bzero()\fR function behaves the same as \fBbzero()\fR, except it
+should not be removed by the compiler's optimization passes.
+.SH WARNINGS
+.LP
+The \fBbcopy()\fR and \fBexplicit_bzero()\fR functions take parameters backwards
+from \fBmemcmp()\fR. See \fBmemory\fR(3C).
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -64,12 +71,15 @@ c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
-Interface Stability Standard
+Interface Stability See NOTES
_
MT-Level MT-Safe
.TE
.SH SEE ALSO
-.sp
.LP
\fBmemory\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
+.SH NOTES
+.LP
+\fBbcopy\fR(), \fBbcmp\fR(), and \fBbzero\fR() are \fBSTANDARD\fR.
+\fBexplicit_bzero\fR() is \fBCOMMITTED\fR.
diff --git a/usr/src/man/man3c/drand48.3c b/usr/src/man/man3c/drand48.3c
index 36b820a864..92d303b1d4 100644
--- a/usr/src/man/man3c/drand48.3c
+++ b/usr/src/man/man3c/drand48.3c
@@ -4,7 +4,7 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH DRAND48 3C "Jul 24, 2002"
+.TH DRAND48 3C "Feb 11, 2015"
.SH NAME
drand48, erand48, lrand48, nrand48, mrand48, jrand48, srand48, seed48, lcong48
\- generate uniformly distributed pseudo-random numbers
@@ -57,7 +57,6 @@ drand48, erand48, lrand48, nrand48, mrand48, jrand48, srand48, seed48, lcong48
.fi
.SH DESCRIPTION
-.sp
.LP
This family of functions generates pseudo-random numbers using the well-known
linear congruential algorithm and 48-bit integer arithmetic.
@@ -150,9 +149,11 @@ the multiplier \fIa\fR, and \fIparam\fR[6] specifies the 16-bit addend \fIc\fR.
After \fBlcong48()\fR has been called, a subsequent call to either
\fBsrand48()\fR or \fBseed48()\fR will restore the ``standard'' multiplier and
addend values, \fIa\fR and \fIc\fR, specified above.
-.SH ATTRIBUTES
.sp
.LP
+For a more powerful random number generator, see \fBarc4random\fR(3C).
+.SH ATTRIBUTES
+.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -169,6 +170,5 @@ MT-Level Safe
.TE
.SH SEE ALSO
-.sp
.LP
-\fBrand\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
+\fBarc4random\fR(3C), \fBrand\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man3c/getentropy.3c b/usr/src/man/man3c/getentropy.3c
new file mode 100644
index 0000000000..c149521c73
--- /dev/null
+++ b/usr/src/man/man3c/getentropy.3c
@@ -0,0 +1,65 @@
+.\" $OpenBSD: getentropy.2,v 1.7 2014/12/10 19:19:00 schwarze Exp $
+.\"
+.\" Copyright (c) 2014 Theo de Raadt
+.\" Copyright (c) 2015 Joyent, Inc.
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd "Dec 31, 2014"
+.Dt GETENTROPY 3C
+.Os
+.Sh NAME
+.Nm getentropy
+.Nd get entropy
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn getentropy "void *buf" "size_t buflen"
+.Sh DESCRIPTION
+.Nm
+fills a buffer with high-quality entropy, which can be used
+as input for process-context pseudorandom generators like
+.Xr arc4random 3C .
+.Pp
+The maximum buffer size permitted is 256 bytes.
+If
+.Va buflen
+exceeds this, an error of
+.Er EIO
+will be indicated.
+.Pp
+.Nm
+is not intended for regular code; please use the
+.Xr arc4random 3C
+family of functions instead.
+.Sh RETURN VALUES
+.Rv -std
+.Sh ERRORS
+.Fn getentropy
+will succeed unless:
+.Bl -tag -width Er
+.It Er EFAULT
+The
+.Fa buf
+parameter points to an
+invalid address.
+.It Er EIO
+Too many bytes requested, or some other fatal error occurred.
+.El
+.Sh INTERFACE STABILITY
+.Sy Comitted
+.Sh MT-LEVEL
+.Sy Async-Signal-Safe
+.Sh SEE ALSO
+.Xr arc4random 3C
+.Xr attributes 5
diff --git a/usr/src/man/man3c/rand.3c b/usr/src/man/man3c/rand.3c
index 4fc6754c3b..8d66a8d2df 100644
--- a/usr/src/man/man3c/rand.3c
+++ b/usr/src/man/man3c/rand.3c
@@ -3,7 +3,7 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH RAND 3C "May 19, 2004"
+.TH RAND 3C "Feb 11, 2015"
.SH NAME
rand, srand, rand_r \- simple random-number generator
.SH SYNOPSIS
@@ -25,7 +25,6 @@ rand, srand, rand_r \- simple random-number generator
.fi
.SH DESCRIPTION
-.sp
.LP
The \fBrand()\fR function uses a multiplicative congruential random-number
generator with period 2^32 that returns successive pseudo-random numbers in the
@@ -55,9 +54,8 @@ call \fBrand_r()\fR with a pointer to the same seed object. The \fBrand_r()\fR
function allows a thread to generate a private pseudo-random stream by having
the seed object be private to the thread.
.SH USAGE
-.sp
.LP
-The spectral properties of \fBrand()\fR are limited. The \fBdrand48\fR(3C)
+The spectral properties of \fBrand()\fR are limited. The \fBarc4random\fR(3C)
function provides a better, more elaborate random-number generator.
.sp
.LP
@@ -65,7 +63,6 @@ When compiling multithreaded applications, the \fB_REENTRANT\fR flag must be
defined on the compile line. This flag should be used only in multithreaded
applications.
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -83,6 +80,5 @@ MT-Level Safe
.TE
.SH SEE ALSO
-.sp
.LP
-\fBdrand48\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
+\fBarc4random\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man3c/random.3c b/usr/src/man/man3c/random.3c
index 6381bb498d..88edfcabee 100644
--- a/usr/src/man/man3c/random.3c
+++ b/usr/src/man/man3c/random.3c
@@ -32,7 +32,6 @@ random, srandom, initstate, setstate \- pseudorandom number functions
.fi
.SH DESCRIPTION
-.sp
.LP
The \fBrandom()\fR function uses a nonlinear additive feedback random-number
generator employing a default state array size of 31 long integers to return
@@ -100,9 +99,11 @@ state arrays. The array defined by the \fIstate\fR argument is used for further
random-number generation until \fBinitstate()\fR is called or \fBsetstate()\fR
is called again. The \fBsetstate()\fR function returns a pointer to the
previous state array.
-.SH RETURN VALUES
.sp
.LP
+For a more powerful random number generator, see \fBarc4random\fR(3C).
+.SH RETURN VALUES
+.LP
The \fBrandom()\fR function returns the generated pseudo-random number.
.sp
.LP
@@ -112,11 +113,9 @@ The \fBsrandom()\fR function returns no value.
Upon successful completion, \fBinitstate()\fR and \fBsetstate()\fR return a
pointer to the previous state array. Otherwise, a null pointer is returned.
.SH ERRORS
-.sp
.LP
No errors are defined.
.SH USAGE
-.sp
.LP
After initialization, a state array can be restarted at a different point in
one of two ways:
@@ -175,7 +174,6 @@ main() {
.in -2
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -193,11 +191,10 @@ MT-Level See \fBNOTES\fR below.
.TE
.SH SEE ALSO
-.sp
.LP
-\fBdrand48\fR(3C), \fBrand\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
+\fBarc4random\fR(3C), \fBdrand48\fR(3C), \fBrand\fR(3C), \fBattributes\fR(5),
+\fBstandards\fR(5)
.SH NOTES
-.sp
.LP
The \fBrandom()\fR and \fBsrandom()\fR functions are unsafe in multithreaded
applications.
@@ -210,5 +207,5 @@ For \fBinitstate()\fR and \fBsetstate()\fR, the \fIstate\fR argument must be
aligned on an \fBint\fR boundary.
.sp
.LP
-Newer and better performing random number generators such as \fBaddrans()\fR
-and \fBlcrans()\fR are available with the SUNWspro package.
+\fBarc4random\fR(3C) is a newer and better performing random number generator.
+Use it instead.