From d583d77111d6dac7996c44d5193ece1c3b682f87 Mon Sep 17 00:00:00 2001 From: christos Date: Wed, 6 Apr 2016 03:51:26 +0000 Subject: [PATCH] Implement WIFCONTINUED using the linux value instead of the FreeBSD one... --- sys/kern/kern_exit.c | 8 ++++---- sys/sys/wait.h | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 35bdf729c357..72754ea314c3 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_exit.c,v 1.255 2016/04/05 14:07:31 christos Exp $ */ +/* $NetBSD: kern_exit.c,v 1.256 2016/04/06 03:51:26 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.255 2016/04/05 14:07:31 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.256 2016/04/06 03:51:26 christos Exp $"); #include "opt_ktrace.h" #include "opt_dtrace.h" @@ -685,7 +685,8 @@ do_sys_waitid(idtype_t idtype, id_t id, int *pid, int *status, int options, } } else { /* Child state must have been SSTOP. */ - *status = W_STOPCODE(child->p_xsig); + *status = child->p_xsig == SIGCONT ? W_CONTCODE() : + W_STOPCODE(child->p_xsig); mutex_exit(proc_lock); } return 0; @@ -1032,7 +1033,6 @@ find_stopped_child(struct proc *parent, idtype_t idtype, id_t id, int options, break; } } - /* XXX: WCONTINUED? */ if (child != NULL || error != 0 || ((options & WNOHANG) != 0 && dead == NULL)) { diff --git a/sys/sys/wait.h b/sys/sys/wait.h index 639afc47d332..61bd309606dd 100644 --- a/sys/sys/wait.h +++ b/sys/sys/wait.h @@ -1,4 +1,4 @@ -/* $NetBSD: wait.h,v 1.29 2016/04/02 21:09:43 christos Exp $ */ +/* $NetBSD: wait.h,v 1.30 2016/04/06 03:51:26 christos Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993, 1994 @@ -57,7 +57,9 @@ #define _WSTATUS(x) (_W_INT(x) & 0177) #define _WSTOPPED 0177 /* _WSTATUS if process is stopped */ +#define _WCONTINUED 0xffffU #define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED) +#define WIFCONTINUED(x) (_W_INT(x) == _WCONTINUED) #define WSTOPSIG(x) ((int)(((unsigned int)_W_INT(x)) >> 8) & 0xff) #define WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0) #define WTERMSIG(x) (_WSTATUS(x)) @@ -69,6 +71,7 @@ #define W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) #define W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED) +#define W_CONTCODE() (_WCONTINUED) #endif /*