CINXE.COM

drand48_r

<html> <head> <title>drand48_r</title> <META NAME="KEYWORDS" CONTENT="drand48_r"> </head> <body BGCOLOR="#ffffff" LINK="#0000ff" VLINK="#0000ff" ALINK="#0000ff" TEXT="#000000"> <center> <h1><b>drand48_r</b></h1></center> <PRE> <STRONG><A HREF="/man3/DRAND48_R">DRAND48_R(3)</A></STRONG> Linux Programmer's Manual <STRONG><A HREF="/man3/DRAND48_R">DRAND48_R(3)</A></STRONG> NAME drand48_r, erand48_r, lrand48_r, nrand48_r, mrand48_r, jrand48_r, srand48_r, seed48_r, lcong48_r - generate uniformly distributed pseudo- random numbers reentrantly SYNOPSIS #include &lt;stdlib.h&gt; int drand48_r(struct drand48_data *buffer, double *result); int erand48_r(unsigned short xsubi[3], struct drand48_data *buffer, double *result); int lrand48_r(struct drand48_data *buffer, long int *result); int nrand48_r(unsigned short int xsubi[3], struct drand48_data *buffer, long int *result); int mrand48_r(struct drand48_data *buffer,long int *result); int jrand48_r(unsigned short int xsubi[3], struct drand48_data *buffer, long int *result); int srand48_r(long int seedval, struct drand48_data *buffer); int seed48_r(unsigned short int seed16v[3], struct drand48_data *buffer); int lcong48_r(unsigned short int param[7], struct drand48_data *buffer); Feature Test Macro Requirements for glibc (see <STRONG><A HREF="/man7/feature_test_macros">feature_test_macros(7)</A></STRONG>): All functions shown above: /* Glibc since 2.19: */ _DEFAULT_SOURCE || /* Glibc versions &lt;= 2.19: */ _SVID_SOURCE || _BSD_SOURCE DESCRIPTION These functions are the reentrant analogs of the functions described in <STRONG><A HREF="/man3/drand48">drand48(3)</A></STRONG>. Instead of modifying the global random generator state, they use the supplied data buffer. Before the first use, this struct must be initialized, for example, by filling it with zeros, or by calling one of the functions srand48_r(), seed48_r(), or lcong48_r(). RETURN VALUE The return value is 0. ATTRIBUTES For an explanation of the terms used in this section, see at- <STRONG><A HREF="/man7/tributes">tributes(7)</A></STRONG>. +--------------------------+---------------+---------------------+ |Interface | Attribute | Value | +--------------------------+---------------+---------------------+ |drand48_r(), erand48_r(), | Thread safety | MT-Safe race:buffer | |lrand48_r(), nrand48_r(), | | | |mrand48_r(), jrand48_r(), | | | |srand48_r(), seed48_r(), | | | |lcong48_r() | | | +--------------------------+---------------+---------------------+ CONFORMING TO These functions are GNU extensions and are not portable. SEE ALSO <STRONG><A HREF="/man3/drand48">drand48(3)</A></STRONG>, <STRONG><A HREF="/man3/rand">rand(3)</A></STRONG>, <STRONG><A HREF="/man3/random">random(3)</A></STRONG> COLOPHON This page is part of release 5.05 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. GNU 2017-09-15 <STRONG><A HREF="/man3/DRAND48_R">DRAND48_R(3)</A></STRONG></PRE> <center> <h6>Man Pages Copyright Respective Owners. Site Copyright (C) 1994 - 2025 <a href="http://www.he.net">Hurricane Electric</a>. All Rights Reserved.</h6></center> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10