]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/posix-process: Import `sigset.h` from libuksignal
authorMichalis Pappas <michalis@unikraft.io>
Thu, 28 Dec 2023 11:42:17 +0000 (12:42 +0100)
committerUnikraft Bot <monkey@unikraft.io>
Wed, 26 Mar 2025 08:05:34 +0000 (08:05 +0000)
Migrate `sigset.h` from libuksignal verbatim.

Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Ioan-Teodor Teugea <ioan_teodor.teugea@stud.acs.upb.ro>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Andrei Tatar <andrei@unikraft.io>
Approved-by: Andrei Tatar <andrei@unikraft.io>
GitHub-Closes: #1248

lib/posix-process/signal/sigset.h [new file with mode: 0644]
lib/uksignal/sigset.h [deleted file]

diff --git a/lib/posix-process/signal/sigset.h b/lib/posix-process/signal/sigset.h
new file mode 100644 (file)
index 0000000..6978601
--- /dev/null
@@ -0,0 +1,65 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Authors:  Mihai Pogonaru <pogonarumihai@gmail.com>
+ *                  Teodora Serbanescu <teo.serbanescu16@gmail.com>
+ *                  Felipe Huici <felipe.huici@neclab.eu>
+ *                  Bernard Rizzo <b.rizzo@student.uliege.be>
+ *
+ * Copyright (c) 2021, University Politehnica of Bucharest.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holder nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+#ifndef __UK_PROCESS_SIGSET_H__
+#define __UK_PROCESS_SIGSET_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* TODO: do we have gnu statement expression?  */
+/* internal use */
+#if !HAVE_LIBC
+
+#define uk_sigemptyset(ptr)    (*(ptr) = 0)
+#define uk_sigfillset(ptr)  (*(ptr) = ~((__sigset_t) 0))
+#define uk_sigaddset(ptr, signo) (*(ptr) |= (1 << ((signo) - 1)))
+#define uk_sigdelset(ptr, signo) (*(ptr) &= ~(1 << ((signo) - 1)))
+#define uk_sigcopyset(ptr1, ptr2) (*(ptr1) = *(ptr2))
+#define uk_sigandset(ptr1, ptr2)  (*(ptr1) &= *(ptr2))
+#define uk_sigorset(ptr1, ptr2)          (*(ptr1) |= *(ptr2))
+#define uk_sigreverseset(ptr)    (*(ptr) = ~(*(ptr)))
+#define uk_sigismember(ptr, signo) (*(ptr) & (1 << ((signo) - 1)))
+#define uk_sigisempty(ptr) (*(ptr) == 0)
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __UK_PROCESS_SIGSET_H__ */
diff --git a/lib/uksignal/sigset.h b/lib/uksignal/sigset.h
deleted file mode 100644 (file)
index da108bf..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause */
-/*
- * Authors:  Mihai Pogonaru <pogonarumihai@gmail.com>
- *                  Teodora Serbanescu <teo.serbanescu16@gmail.com>
- *                  Felipe Huici <felipe.huici@neclab.eu>
- *                  Bernard Rizzo <b.rizzo@student.uliege.be>
- *
- * Copyright (c) 2021, University Politehnica of Bucharest.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holder nor the names of its
- *    contributors may be used to endorse or promote products derived from
- *    this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef __UK_SIGSET_H__
-#define __UK_SIGSET_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* TODO: do we have gnu statement expression?  */
-/* internal use */
-#if !HAVE_LIBC
-
-#define uk_sigemptyset(ptr)    (*(ptr) = 0)
-#define uk_sigfillset(ptr)  (*(ptr) = ~((__sigset_t) 0))
-#define uk_sigaddset(ptr, signo) (*(ptr) |= (1 << ((signo) - 1)))
-#define uk_sigdelset(ptr, signo) (*(ptr) &= ~(1 << ((signo) - 1)))
-#define uk_sigcopyset(ptr1, ptr2) (*(ptr1) = *(ptr2))
-#define uk_sigandset(ptr1, ptr2)  (*(ptr1) &= *(ptr2))
-#define uk_sigorset(ptr1, ptr2)          (*(ptr1) |= *(ptr2))
-#define uk_sigreverseset(ptr)    (*(ptr) = ~(*(ptr)))
-#define uk_sigismember(ptr, signo) (*(ptr) & (1 << ((signo) - 1)))
-#define uk_sigisempty(ptr) (*(ptr) == 0)
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __UK_SIGSET_H__ */