random - fill a buffer with random data
#include <libcgc.h> int random(void *buf, size_t count, size_t *rnd_bytes)
random system call populates the buffer referenced by
with up to count bytes of random data. If
count is zero,
returns 0 and optionally sets
*rnd_bytes to zero.
count is greater than
SSIZE_MAX, the result is unspecified.
random function is invoked through system call number 7.
On success, zero is returned and if
rnd_bytes is not
number of bytes copied into
buf is returned in
On error, an error code is returned, the contents of
are undefined, and the value of
*rnd_bytes is left unmodified.
rnd_bytespoints to an invalid address.