The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
Loading...
Searching...
No Matches
random.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
sys/types.h
>
4
5
/**
6
* @file sys/random.h
7
* @brief random bytes from the kernel's generator (getrandom).
8
*/
9
10
#define GRND_NONBLOCK 0x0001
// do not wait for the generator to be seeded
11
#define GRND_RANDOM 0x0002
// the same as without (as /dev/random)
12
#define GRND_INSECURE 0x0004
// do not wait; the bytes may be weak early at boot
13
14
/**
15
* fill buf with length random bytes. waits until the kernel's generator is
16
* seeded (early at boot only), unless GRND_NONBLOCK or GRND_INSECURE.
17
* @return the bytes given (a long request can stop early at a signal), or
18
* -1 with errno EAGAIN, EINTR, EINVAL or EFAULT.
19
*/
20
ssize_t
getrandom
(
void
*buf,
size_t
length,
unsigned
int
flags
);
flags
uint8_t flags
Definition
idt.c:3
getrandom
ssize_t getrandom(void *buf, size_t length, unsigned int flags)
fill buf with length random bytes.
types.h
basic system types.
ssize_t
__PTRDIFF_TYPE__ ssize_t
Definition
types.h:15
src
libc
include
sys
random.h
Generated by
1.18.0