summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authordt <dt@FreeBSD.org>1999-06-29 19:57:07 +0000
committerdt <dt@FreeBSD.org>1999-06-29 19:57:07 +0000
commit44e9ba14adfa3ed4826faaa7dd9f439cfd234c4e (patch)
tree6ed05963e8dcac88456217575b8beecffb27a068 /lib/libpthread
parentfb5bf6fe15f899d239a19e8885bc8749a5de3c24 (diff)
downloadFreeBSD-src-44e9ba14adfa3ed4826faaa7dd9f439cfd234c4e.zip
FreeBSD-src-44e9ba14adfa3ed4826faaa7dd9f439cfd234c4e.tar.gz
Defer signals, so we will not wait for SIGCHLD after it was delivered.
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/thread/thr_wait4.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libpthread/thread/thr_wait4.c b/lib/libpthread/thread/thr_wait4.c
index dda8aee..a3cd31b 100644
--- a/lib/libpthread/thread/thr_wait4.c
+++ b/lib/libpthread/thread/thr_wait4.c
@@ -41,6 +41,8 @@ wait4(pid_t pid, int *istat, int options, struct rusage * rusage)
{
pid_t ret;
+ _thread_kern_sig_defer();
+
/* Perform a non-blocking wait4 syscall: */
while ((ret = _thread_sys_wait4(pid, istat, options | WNOHANG, rusage)) == 0 && (options & WNOHANG) == 0) {
/* Reset the interrupted operation flag: */
@@ -56,6 +58,9 @@ wait4(pid_t pid, int *istat, int options, struct rusage * rusage)
break;
}
}
+
+ _thread_kern_sig_undefer();
+
return (ret);
}
#endif
OpenPOWER on IntegriCloud