From 26361be59c08917c47718bcd4114b8028aaf7810 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Tue, 29 Oct 2024 21:03:04 -0600 Subject: libhw: Tidy --- libhw/host_util.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 libhw/host_util.c (limited to 'libhw/host_util.c') diff --git a/libhw/host_util.c b/libhw/host_util.c new file mode 100644 index 0000000..b862e39 --- /dev/null +++ b/libhw/host_util.c @@ -0,0 +1,21 @@ +/* libhw/host_util.c - Utilities for GNU/Linux hosts + * + * Copyright (C) 2024 Luke T. Shumaker + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +#include /* for error(3gnu) */ +#include /* for SIGRTMIN, SIGRTMAX */ + +#include "host_util.h" + +int host_sigrt_alloc(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