提交 0a949ebd 编写于 作者: R Rich Felker

don't fail with EINTR in sigtimedwait

POSIX allows either behavior, but sigwait is not allowed to fail with
EINTR, so the retry loop would have to be in one or the other anyway.
上级 0558683d
#include <signal.h>
#include <errno.h>
#include "syscall.h"
int sigtimedwait(const sigset_t *mask, siginfo_t *si, const struct timespec *timeout)
{
long k_timeout[2];
if (timeout) {
k_timeout[0] = timeout->tv_sec;
k_timeout[1] = timeout->tv_nsec;
}
return syscall4(__NR_rt_sigtimedwait, (long)mask, (long)si, timeout ? (long)k_timeout : 0, SYSCALL_SIGSET_SIZE);
int ret;
do {
ret = syscall4(__NR_rt_sigtimedwait, (long)mask, (long)si, (long)timeout, SYSCALL_SIGSET_SIZE);
} while (ret<0 && errno==EINTR);
return ret;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册