LinuxKPI: Add get_random_u64() function

Sponsored by:	Serenity Cyber Security, LLC
Reviewed by:	manu, bz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42816

(cherry picked from commit 7f88d742e578c4cef4e26ce10b9a936e58237964)
This commit is contained in:
Vladimir Kondratyev 2023-12-24 11:20:00 +03:00
parent 96e464b8d5
commit c535e8ae7f

View file

@ -87,6 +87,15 @@ get_random_long(void)
return (val);
}
static inline uint64_t
get_random_u64(void)
{
uint64_t val;
get_random_bytes(&val, sizeof(val));
return (val);
}
static __inline uint32_t
prandom_u32(void)
{