*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: getrandom | Section: 2 | Source: FreeBSD | File: getrandom.2.gz
GETRANDOM(2) FreeBSD System Calls Manual GETRANDOM(2) NAME getrandom - get random data LIBRARY Standard C Library (libc, -lc) SYNOPSIS #include <sys/random.h> ssize_t getrandom(void *buf, size_t buflen, unsigned int flags); DESCRIPTION getrandom() fills buf with up to buflen bytes of random data. The flags argument may include zero or more of the following: `GRND_NONBLOCK' Return EAGAIN instead of blocking, if the random(4) device has not yet been seeded. By default, getrandom() will block until the device is seeded. `GRND_RANDOM' This flag does nothing on FreeBSD. /dev/random and /dev/urandom are identical. `GRND_INSECURE' This flag is treated as an alternative name for GRND_NONBLOCK. It is provided solely for API compatibility with Linux. If the random(4) device has been seeded, reads of up to 256 bytes will always return as many bytes as requested and will not be interrupted by signals. RETURN VALUES Upon successful completion, the number of bytes which were actually read is returned. For requests larger than 256 bytes, this can be fewer bytes than were requested. Otherwise, -1 is returned and the global variable errno is set to indicate the error. ERRORS The getrandom() operation returns the following errors: [EAGAIN] The `GRND_NONBLOCK' (or `GRND_INSECURE') flag was set and the random(4) device was not yet seeded. [EFAULT] The buf parameter points to an invalid address. [EINTR] The sleep was interrupted by a signal. [EINVAL] An invalid flags was specified. [EINVAL] The requested buflen was larger than IOSIZE_MAX. SEE ALSO arc4random(3), getentropy(3), random(4) STANDARDS getrandom() is non-standard. It is present in Linux. HISTORY The getrandom() system call first appeared in FreeBSD 12.0. CAVEATS Unlike Linux, the GRND_INSECURE flag on FreeBSD does not produce any output before the random(4) device is seeded. FreeBSD 14.1-RELEASE-p8 January 12, 2020 FreeBSD 14.1-RELEASE-p8

Navigation Options