mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 16:37:19 +09:00
Plus, linux/random.h never defined getrandom(), hence remove the custom machinery for sys/random.h vs linux/random.h in favor of single HAVE_GETRANDOM.
29 lines
472 B
C
29 lines
472 B
C
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
#pragma once
|
|
|
|
#include "macro.h"
|
|
|
|
#if HAVE_GETRANDOM
|
|
# include <sys/random.h>
|
|
#else
|
|
# include <linux/random.h>
|
|
#endif
|
|
|
|
#ifndef GRND_NONBLOCK
|
|
# define GRND_NONBLOCK 0x0001
|
|
#else
|
|
assert_cc(GRND_NONBLOCK == 0x0001);
|
|
#endif
|
|
|
|
#ifndef GRND_RANDOM
|
|
# define GRND_RANDOM 0x0002
|
|
#else
|
|
assert_cc(GRND_RANDOM == 0x0002);
|
|
#endif
|
|
|
|
#ifndef GRND_INSECURE
|
|
# define GRND_INSECURE 0x0004
|
|
#else
|
|
assert_cc(GRND_INSECURE == 0x0004);
|
|
#endif
|