lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <e578baa7116bb09f406a2beaea8298f7bbb22d6c.1685387484.git.falcon@tinylab.org>
Date:   Tue, 30 May 2023 03:51:48 +0800
From:   Zhangjin Wu <falcon@...ylab.org>
To:     w@....eu
Cc:     arnd@...db.de, falcon@...ylab.org, linux-kernel@...r.kernel.org,
        linux-kselftest@...r.kernel.org, linux-riscv@...ts.infradead.org,
        thomas@...ch.de
Subject: [PATCH v2 05/13] tools/nolibc: add more wait status related types

More wait status related types are added for the coming waitid syscall
based wait4() support.

Resue the ones from <linux/wait.h>, add the missing ones from sys/wait.h
and bits/waitstatus.h of glibc.

Signed-off-by: Zhangjin Wu <falcon@...ylab.org>
---
 tools/include/nolibc/types.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h
index f96e28bff4ba..698d859fc6e2 100644
--- a/tools/include/nolibc/types.h
+++ b/tools/include/nolibc/types.h
@@ -10,6 +10,7 @@
 #include "std.h"
 #include <linux/time.h>
 #include <linux/stat.h>
+#include <linux/wait.h>
 
 
 /* Only the generic macros and types may be defined here. The arch-specific
@@ -91,9 +92,13 @@
 #define WIFEXITED(status)   (((status) & 0x7f) == 0)
 #define WTERMSIG(status)    ((status) & 0x7f)
 #define WIFSIGNALED(status) ((status) - 1 < 0xff)
+#define WIFSTOPPED(status)  (((status) & 0xff) == 0x7f)
 
-/* waitpid() flags */
-#define WNOHANG      1
+/* Macros for constructing status values.  */
+#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
+#define W_STOPCODE(sig)      ((sig) << 8 | 0x7f)
+#define W_CONTINUED          0xffff
+#define WCOREFLAG            0x80
 
 /* standard exit() codes */
 #define EXIT_SUCCESS 0
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ