summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/lib/rand.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-25 23:53:51 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-25 23:53:51 +0000
commit7cd588a445d70d8cc7ed0cbae36be001ee56cae1 (patch)
treeba3f127fd4e82273e291fe7765a5a2d15c5c5d8b /util/libreboot-utils/lib/rand.c
parent7284da14615b04fff1587ec73ad979c9fea8a13b (diff)
rmalloc
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils/lib/rand.c')
-rw-r--r--util/libreboot-utils/lib/rand.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/util/libreboot-utils/lib/rand.c b/util/libreboot-utils/lib/rand.c
index 29a756ed..6fb25d9d 100644
--- a/util/libreboot-utils/lib/rand.c
+++ b/util/libreboot-utils/lib/rand.c
@@ -71,6 +71,16 @@
#define ELOTTERY ECANCELED
+void *
+rmalloc(size_t *rval)
+{
+ if (if_err(rval == NULL, EFAULT))
+ return NULL;
+
+ rset(rval, sizeof(*rval));
+ return mkrstr(*rval %= BUFSIZ);
+}
+
int
win_lottery(void)
{