From 6c114930eef133293856189a93f7ca7ca3751268 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Tue, 29 Oct 2024 20:20:07 -0600 Subject: wip host_alarmclock --- libhw/host_sigrt.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 libhw/host_sigrt.c (limited to 'libhw/host_sigrt.c') diff --git a/libhw/host_sigrt.c b/libhw/host_sigrt.c new file mode 100644 index 0000000..66041fc --- /dev/null +++ b/libhw/host_sigrt.c @@ -0,0 +1,21 @@ +/* libhw/host_sigrt.c - Manage glibc realtime signals + * + * Copyright (C) 2024 Luke T. Shumaker + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +#include /* for error(3gnu) */ +#include /* for SIGRTMIN, SIGRTMAX */ + +#include "host_sigrt.h" + +int host_alloc_sigrt(void) { + static int next = 0; + + if (!next) + next = SIGRTMIN; + int ret = next++; + if (ret > SIGRTMAX) + error(1, 0, "SIGRTMAX exceeded"); + return ret; +} -- cgit v1.2.3-2-g168b