Skip to contentSkip to conversation

wait: allow sys_waitid() to accept __WNOTHREAD/__WCLONE/__WALL

PATCH New [email protected] 1 participant 1 message May 23, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 33/84 wait: allow sys_waitid() to accept __WNOTHREAD/__WCLONE/__WALL

From: Oleg Nesterov <[email protected]>
Subject: wait: allow sys_waitid() to accept __WNOTHREAD/__WCLONE/__WALL

I see no reason why waitid() can't support other linux-specific flags allowed in sys_wait4().

In particular this change can help if we reconsider the previous change ("wait/ptrace: assume __WALL if the child is traced") which adds the "automagical" __WALL for debugger.

Cc Dmitry Vyukov <[email protected]>
Cc Denys Vlasenko <[email protected]>
Cc Jan Kratochvil <[email protected]>
Cc "Michael Kerrisk (man-pages)" <[email protected]>
Cc Pedro Alves <[email protected]>
Cc Roland McGrath <[email protected]>
Cc Linus Torvalds <[email protected]>

---

 kernel/exit.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/exit.c renamed from kernel/exit.c~wait-allow-sys_waitid-to-accept-__wnothread-__wclone-__wall +2 -1
diff -puN kernel/exit.c~wait-allow-sys_waitid-to-accept-__wnothread-__wclone-__wall kernel/exit.c
@@ -1535,7 +1535,8 @@ SYSCALL_DEFINE5(waitid, int, which, pid_
 	enum pid_type type;
 	long ret;
 
-	if (options & ~(WNOHANG|WNOWAIT|WEXITED|WSTOPPED|WCONTINUED))
+	if (options & ~(WNOHANG|WNOWAIT|WEXITED|WSTOPPED|WCONTINUED|
+			__WNOTHREAD|__WCLONE|__WALL))
 		return -EINVAL;
 	if (!(options & (WEXITED|WSTOPPED|WCONTINUED)))
 		return -EINVAL;

_