---
name: "libressl-RAND_load_file"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-RAND_load_file"
---

# libressl-RAND\_load\_file(3)

PRNG seed file

## NAME

**RAND\_file\_name**, **RAND\_load\_file**, **RAND\_write\_file** – PRNG seed file

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/rand.h\>**

*const* *char* *\**\

**RAND\_file\_name**(*char \*buf*, *size\_t num*);

*int*\

**RAND\_load\_file**(*const char \*filename*, *long max\_bytes*);

*int*\

**RAND\_write\_file**(*const char \*filename*);

## DESCRIPTION

**RAND\_file\_name**() returns a default path for the random seed file. *buf* points to a buffer of size *num* in which to store the filename. If *num* is too small for the path name, an error occurs.

**RAND\_load\_file**() used to allow for the state of the random number generator to be controlled by external sources. It is kept for ABI compatibility but is no longer functional, and should not be used in new programs.

**RAND\_write\_file**() writes a number of random bytes (currently 1024) to file *filename*.

## RETURN VALUES

**RAND\_load\_file**() returns *max\_bytes*, or a bogus positive value if *max\_bytes* is -1.

**RAND\_write\_file**() returns the number of bytes written, or a number less than or equal to 1 if an error occurs.

**RAND\_file\_name**() returns a pointer to *buf* on success or NULL on error.

## HISTORY

**RAND\_load\_file**(), **RAND\_write\_file**(), and **RAND\_file\_name**() first appeared in SSLeay 0.5.1 and have been available since OpenBSD 2.4.
