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.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -1535,7 +1535,8 @@ SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *, · 1534 unmodified lines | ||
| 1535 | 1535 | enum pid_type type; |
| 1536 | 1536 | long ret; |
| 1537 | 1537 | |
| 1538 | − if (options & ~(WNOHANG|WNOWAIT|WEXITED|WSTOPPED|WCONTINUED)) | |
| 1538 | + if (options & ~(WNOHANG|WNOWAIT|WEXITED|WSTOPPED|WCONTINUED| | |
| 1539 | + __WNOTHREAD|__WCLONE|__WALL)) | |
| 1539 | 1540 | return -EINVAL; |
| 1540 | 1541 | if (!(options & (WEXITED|WSTOPPED|WCONTINUED))) |
| 1541 | 1542 | return -EINVAL; |