util-linux/include/randutils.h
Karel Zak faeb1b64b3 include: add missing license lines
The header files are usually based on code from lib/. This commit
copies relevant license headers from lib/ to include/ to keep
things consistent. The very generic things (e.g. MBR definitions)
are always public domain.

Fixes: https://github.com/util-linux/util-linux/issues/2010
Signed-off-by: Karel Zak <kzak@redhat.com>
2023-01-12 15:33:09 +01:00

20 lines
451 B
C

/*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef UTIL_LINUX_RANDUTILS
#define UTIL_LINUX_RANDUTILS
#ifdef HAVE_SRANDOM
#define srand(x) srandom(x)
#define rand() random()
#endif
/* rand() based */
extern int rand_get_number(int low_n, int high_n);
/* /dev/urandom based with fallback to rand() */
extern int random_get_fd(void);
extern int ul_random_get_bytes(void *buf, size_t nbytes);
extern const char *random_tell_source(void);
#endif