---
name: "lcong48_r"
section: "3"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/drand48_r"
---

# lcong48\_r(3)

generate uniformly distributed pseudo-random numbers reentrantly

Part of [drand48\_r(3)](/drand48_r/3.md).

## 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

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <stdlib.h>
```

**int drand48\_r(struct drand48\_data \*restrict** *buffer***,**               **double \*restrict** *result***);** **int erand48\_r(unsigned short** *xsubi***\[3\]***,*               **struct drand48\_data \*restrict** *buffer***,**               **double \*restrict** *result***);**

**int lrand48\_r(struct drand48\_data \*restrict** *buffer***,**               **long \*restrict** *result***);** **int nrand48\_r(unsigned short** *xsubi\[3\]***,**               **struct drand48\_data \*restrict** *buffer***,**               **long \*restrict** *result***);**

**int mrand48\_r(struct drand48\_data \*restrict** *buffer***,**               **long \*restrict** *result***);** **int jrand48\_r(unsigned short** *xsubi\[3\]***,**               **struct drand48\_data \*restrict** *buffer***,**               **long \*restrict** *result***);**

**int srand48\_r(long int** *seedval***, struct drand48\_data \****buffer***);** **int seed48\_r(unsigned short** *seed16v\[3\]***, struct drand48\_data \****buffer***);** **int lcong48\_r(unsigned short** *param\[7\]***, struct drand48\_data \****buffer***);**

Feature Test Macro Requirements for glibc (see [**feature\_test\_macros**(7)](/feature_test_macros/7.md)):

All functions shown above:

```
    /* glibc >= 2.19: */ _DEFAULT_SOURCE
        || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
```

## DESCRIPTION

These functions are the reentrant analogs of the functions described in [**drand48**(3)](/drand48/3.md). 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 [**attributes**(7)](/attributes/7.md).

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **drand48\_r**(), **erand48\_r**(), **lrand48\_r**(), **nrand48\_r**(), **mrand48\_r**(), **jrand48\_r**(), **srand48\_r**(), **seed48\_r**(), **lcong48\_r**() | Thread safety | MT-Safe race:buffer |

## STANDARDS

GNU.

## SEE ALSO

[**drand48**(3)](/drand48/3.md), [**rand**(3)](/rand/3.md), [**random**(3)](/random/3.md)
