1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

According to SUSv3, sigwait is different with sigwaitinfo, sigwait

returns error code in return value, not in errno.
This commit is contained in:
David Xu 2004-06-07 13:35:02 +00:00
parent 0e11f0a93b
commit 36939a0a5c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=130192

View File

@ -746,12 +746,18 @@ sigwait(struct thread *td, struct sigwait_args *uap)
int error;
error = copyin(uap->set, &set, sizeof(set));
if (error)
return (error);
if (error) {
td->td_retval[0] = error;
return (0);
}
error = kern_sigtimedwait(td, set, &info, NULL);
if (error)
if (error) {
if (error == ERESTART)
return (error);
td->td_retval[0] = error;
return (0);
}
error = copyout(&info.si_signo, uap->sig, sizeof(info.si_signo));
/* Repost if we got an error. */
@ -760,7 +766,8 @@ sigwait(struct thread *td, struct sigwait_args *uap)
tdsignal(td, info.si_signo, SIGTARGET_TD);
PROC_UNLOCK(td->td_proc);
}
return (error);
td->td_retval[0] = error;
return (0);
}
/*
* MPSAFE