From b47ca7881db8807e7601bcdecb9b61294a186810 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Wed, 2 Oct 2024 18:38:26 +0200 Subject: use POSIX-2024 getentropy --- ulid.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ulid.c') diff --git a/ulid.c b/ulid.c index dde7add..06d2eb6 100644 --- a/ulid.c +++ b/ulid.c @@ -7,12 +7,11 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -#include - #include #include #include #include +#include void ulidgen_r(char ulid[27]) @@ -53,7 +52,7 @@ ulidgen_r(char ulid[27]) } unsigned char rnd[16]; /* use 16 bytes for easier encoding */ - if (getrandom(rnd, sizeof rnd, 0) < 0) + if (getentropy(rnd, sizeof rnd) < 0) abort(); for (int i = 0; i < 16; i++) -- cgit 1.4.1