From 0378f059440d4702203f9bc005894f7b53cad889 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Wed, 26 Mar 2025 21:20:54 -0600 Subject: Have libhw_generic be independent of libcr, rename libhw to libhw_cr --- libhw_cr/host_util.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 libhw_cr/host_util.c (limited to 'libhw_cr/host_util.c') diff --git a/libhw_cr/host_util.c b/libhw_cr/host_util.c new file mode 100644 index 0000000..958ed9c --- /dev/null +++ b/libhw_cr/host_util.c @@ -0,0 +1,21 @@ +/* libhw_cr/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