Skip to contentSkip to conversation

tools/nolibc: Use linux/wait.h rather than duplicating it

PATCH In review Mark Brown 3 participants 4 messages Oct 23, 2023 – Oct 29, 2023 Nolibc header file

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH v2 1/1 tools/nolibc: Use linux/wait.h rather than duplicating it

Linux defines a few custom flags for waitpid() which aren't currently provided by nolibc, make them available to nolibc based programs by just including linux/wait.h where they are defined instead of defining our own copy of the flags.

---
Changes in v2:
- Use linux/wait.h rather than defining things locally.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 tools/include/nolibc/types.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
tools/include/nolibc/types.h +1 -3
index 8cfc4c860fa4..ad0ddaa89e50 100644
@@ -12,6 +12,7 @@
 #include <linux/reboot.h> /* for LINUX_REBOOT_* */
 #include <linux/stat.h>
 #include <linux/time.h>
+#include <linux/wait.h>
 
 
 /* Only the generic macros and types may be defined here. The arch-specific
@@ -108,9 +109,6 @@
 #define WTERMSIG(status)    ((status) & 0x7f)
 #define WIFSIGNALED(status) ((status) - 1 < 0xff)
 
-/* waitpid() flags */
-#define WNOHANG      1
-
 /* standard exit() codes */
 #define EXIT_SUCCESS 0
 #define EXIT_FAILURE 1

---
base-commit: 6465e260f48790807eef06b583b38ca9789b6072
change-id: 20231020-nolibc-waitpid-flags-80ac075ab978

Best regards,

Signature · 1 line
Mark Brown <[email protected]>
Acked-by on v2 1/1
#1 lore raw

Thanks!

Oct 23, 2023 20:42:52 Mark Brown <[email protected]>:

Quoted 6 lines

Linux defines a few custom flags for waitpid() which aren't currently provided by nolibc, make them available to nolibc based programs by just including linux/wait.h where they are defined instead of defining our own copy of the flags.

I can apply it, but only next week.

Thomas

maintainer
#2 lore raw
Quoted 9 lines · Thomas Weißschuh

Thanks!

Oct 23, 2023 20:42:52 Mark Brown <[email protected]>:

Quoted 5 lines

Linux defines a few custom flags for waitpid() which aren't currently provided by nolibc, make them available to nolibc based programs by just including linux/wait.h where they are defined instead of defining our own copy of the flags.

Quoted 5 lines
Quoted 1 line

I can apply it, but only next week.

Yeah I'm fine as well, thanks Mark for this. I'm still too short on time these days but if I manage to upload it sooner, I'll let you know.

Thanks!
Willy

maintainer
#3 lore raw
In reply to Mark Brown
Quoted 10 lines · Mark Brown

Linux defines a few custom flags for waitpid() which aren't currently provided by nolibc, make them available to nolibc based programs by just including linux/wait.h where they are defined instead of defining our own copy of the flags.

---
Changes in v2:
- Use linux/wait.h rather than defining things locally.
- Link to v1: https://lore.kernel.org/r/[email protected]

Now merged into nolibc/next, thank you Mark!

Willy