summaryrefslogtreecommitdiff
path: root/include/bits/wait.h
diff options
context:
space:
mode:
authorKacper <kacper@mail.openlinux.dev>2025-12-07 22:22:16 +0100
committerKacper <kacper@mail.openlinux.dev>2025-12-07 22:22:16 +0100
commit8f9e448b2ef6db7cd905540c21f3c5b190e7a1e7 (patch)
treeae0285dd15042d1e9236a5ce2e60daf65acbdca0 /include/bits/wait.h
parentfc00c656c96528112d05cf0edf8631bd5eaea446 (diff)
Add bin/true and bin/false implementations
- Added assembly implementations for `true` and `false` commands. - Updated Kbuild files to include new binaries. - Removed unused libraries and headers. - Cleaned up makefile and unused code.
Diffstat (limited to 'include/bits/wait.h')
-rw-r--r--include/bits/wait.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/bits/wait.h b/include/bits/wait.h
new file mode 100644
index 00000000..5e346276
--- /dev/null
+++ b/include/bits/wait.h
@@ -0,0 +1,22 @@
+#ifndef __BITS_WAIT_H
+#define __BITS_WAIT_H
+
+#ifndef __BITS_WAIT_H_
+#error "Internal header — include the public API header instead."
+#else
+#undef __BITS_WAIT_H_
+#endif
+
+#define WNOHANG 0x00000001
+#define WUNTRACED 0x00000002
+
+#define WEXITSTATUS(__status) (((__status) & 0xff00) >> 8)
+#define WCOREDUMP(__status) ((__status) & 0x80)
+#define WTERMSIG(__status) ((__status) & 0x7f)
+#define WSTOPSIG(__status) WEXITSTATUS(__status)
+#define WIFEXITED(__status) (WTERMSIG(__status) == 0)
+#define WIFSTOPPED(__status) (((__status) & 0xff) == 0x7f)
+#define WIFSIGNALED(__status) (((__status) & 0xffff) - 1U < 0xffu)
+#define WSTOPSIG(__status) WEXITSTATUS(__status)
+
+#endif