mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
parent
257b3b6775
commit
bed531b604
@ -374,18 +374,22 @@ extern "C" __attribute__((weak))
|
||||
int pselect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
|
||||
const struct timespec *timeout, const sigset_t *sigmask)
|
||||
{
|
||||
struct timeval tv;
|
||||
struct timeval tv { 0, 0 };
|
||||
struct timeval *tv_ptr = nullptr;
|
||||
sigset_t origmask;
|
||||
int nready;
|
||||
|
||||
if (timeout) {
|
||||
tv.tv_usec = timeout->tv_nsec / 1000;
|
||||
tv.tv_sec = timeout->tv_sec;
|
||||
tv_ptr = &tv;
|
||||
}
|
||||
|
||||
if (sigmask)
|
||||
sigprocmask(SIG_SETMASK, sigmask, &origmask);
|
||||
nready = select(nfds, readfds, writefds, exceptfds, &tv);
|
||||
|
||||
nready = select(nfds, readfds, writefds, exceptfds, tv_ptr);
|
||||
|
||||
if (sigmask)
|
||||
sigprocmask(SIG_SETMASK, &origmask, NULL);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user