syscall wait4: add _WALL (POSTK_DEBUG_ARCH_DEP_44)

Needed by strace -f
This commit is contained in:
Dominique Martinet
2018-04-11 17:54:17 +09:00
parent 90a34f54c9
commit c52f7a5b49
2 changed files with 2 additions and 21 deletions

View File

@@ -142,9 +142,7 @@
#define WCONTINUED 0x00000008 #define WCONTINUED 0x00000008
#define WNOWAIT 0x01000000 /* Don't reap, just poll status. */ #define WNOWAIT 0x01000000 /* Don't reap, just poll status. */
#ifdef POSTK_DEBUG_ARCH_DEP_44 /* wait() add support __WALL */
#define __WALL 0x40000000 /* Wait on all children, regardless of type */ #define __WALL 0x40000000 /* Wait on all children, regardless of type */
#endif /* POSTK_DEBUG_ARCH_DEP_44 */
#define __WCLONE 0x80000000 #define __WCLONE 0x80000000
/* idtype */ /* idtype */

View File

@@ -669,21 +669,12 @@ do_wait(int pid, int *status, int options, void *rusage)
mcs_rwlock_writer_lock_noirq(&thread->proc->children_lock, &lock); mcs_rwlock_writer_lock_noirq(&thread->proc->children_lock, &lock);
list_for_each_entry_safe(child, next, &proc->children_list, siblings_list) { list_for_each_entry_safe(child, next, &proc->children_list, siblings_list) {
#ifdef POSTK_DEBUG_ARCH_DEP_44 /* wait() add support __WALL */
/* /*
if (!(options & __WALL)) { if (!(options & __WALL) &&
if (!(!!(options & __WCLONE) ^ (child->termsig == SIGCHLD))) { !(!!(options & __WCLONE) ^ (child->termsig == SIGCHLD))) {
continue;
}
}
*/
#else /* POSTK_DEBUG_ARCH_DEP_44 */
/*
if (!(!!(options & __WCLONE) ^ (child->termsig == SIGCHLD))) {
continue; continue;
} }
*/ */
#endif /* POSTK_DEBUG_ARCH_DEP_44 */
/* Find thread with pid == tid, this will be either the main thread /* Find thread with pid == tid, this will be either the main thread
* or the one we are looking for specifically when __WCLONE is passed */ * or the one we are looking for specifically when __WCLONE is passed */
@@ -882,11 +873,7 @@ SYSCALL_DECLARE(wait4)
int rc; int rc;
struct rusage usage; struct rusage usage;
#ifdef POSTK_DEBUG_ARCH_DEP_44 /* wait() add support __WALL */
if(options & ~(WNOHANG | WUNTRACED | WCONTINUED | __WCLONE | __WALL)){ if(options & ~(WNOHANG | WUNTRACED | WCONTINUED | __WCLONE | __WALL)){
#else /* POSTK_DEBUG_ARCH_DEP_44 */
if(options & ~(WNOHANG | WUNTRACED | WCONTINUED | __WCLONE)){
#endif /* POSTK_DEBUG_ARCH_DEP_44 */
dkprintf("wait4: unexpected options(%x).\n", options); dkprintf("wait4: unexpected options(%x).\n", options);
return -EINVAL; return -EINVAL;
} }
@@ -918,11 +905,7 @@ SYSCALL_DECLARE(waitid)
pid = -1; pid = -1;
else else
return -EINVAL; return -EINVAL;
#ifdef POSTK_DEBUG_ARCH_DEP_44 /* wait() add support __WALL */
if(options & ~(WEXITED | WSTOPPED | WCONTINUED | WNOHANG | WNOWAIT | __WCLONE | __WALL)){ if(options & ~(WEXITED | WSTOPPED | WCONTINUED | WNOHANG | WNOWAIT | __WCLONE | __WALL)){
#else /* POSTK_DEBUG_ARCH_DEP_44 */
if(options & ~(WEXITED | WSTOPPED | WCONTINUED | WNOHANG | WNOWAIT | __WCLONE)){
#endif /* POSTK_DEBUG_ARCH_DEP_44 */
dkprintf("wait4: unexpected options(%x).\n", options); dkprintf("wait4: unexpected options(%x).\n", options);
dkprintf("waitid: unexpected options(%x).\n", options); dkprintf("waitid: unexpected options(%x).\n", options);
return -EINVAL; return -EINVAL;