Defer signals, so we will not wait for SIGCHLD after it was delivered.

This commit is contained in:
Dmitrij Tejblum 1999-06-29 19:57:07 +00:00
parent ba965cf7cc
commit db06cf96d5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=48349
3 changed files with 15 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -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