Lines Matching full:timeout
36 struct timespec EndTime, Timeout; member
39 static void sigwrap_InitTimeout(SIGWRAP_TIMEOUT *pDst, const struct timespec *timeout) in sigwrap_InitTimeout() argument
41 pDst->Timeout = *timeout; in sigwrap_InitTimeout()
43 …if ((timeout->tv_sec == 0) && (timeout->tv_nsec == 0)) // If both value are zero … in sigwrap_InitTimeout()
55 …pDst->EndTime.tv_sec = Now.tv_sec + pDst->Timeout.tv_sec; // Check necessary in 2038… in sigwrap_InitTimeout()
56 pDst->EndTime.tv_nsec = Now.tv_nsec + pDst->Timeout.tv_nsec; in sigwrap_InitTimeout()
78 pTo->Timeout.tv_nsec = pTo->EndTime.tv_nsec - Now.tv_nsec; in sigwrap_CheckTimeout()
79 pTo->Timeout.tv_sec = pTo->EndTime.tv_sec - Now.tv_sec; in sigwrap_CheckTimeout()
81 if (pTo->Timeout.tv_sec == 0) in sigwrap_CheckTimeout()
83 if (pTo->Timeout.tv_nsec <= 0) in sigwrap_CheckTimeout()
86 else if (pTo->Timeout.tv_nsec < 0) in sigwrap_CheckTimeout()
88 pTo->Timeout.tv_nsec += OneSecondasNS; in sigwrap_CheckTimeout()
89 pTo->Timeout.tv_sec--; in sigwrap_CheckTimeout()
109 int sigwrap_epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout) in sigwrap_epoll_wait() argument
113 if (timeout != -1) in sigwrap_epoll_wait()
115 struct timespec Timeout; in sigwrap_epoll_wait() local
117 Timeout.tv_sec = timeout / 1000; in sigwrap_epoll_wait()
118 Timeout.tv_nsec = (timeout % 1000) * 1000000; // Convert msec to nsec in sigwrap_epoll_wait()
120 sigwrap_InitTimeout(&To, &Timeout); in sigwrap_epoll_wait()
125 int Result = epoll_wait(epfd, events, maxevents, timeout); in sigwrap_epoll_wait()
133 if (timeout == -1) in sigwrap_epoll_wait()
139 timeout = To.Timeout.tv_sec * 1000 + To.Timeout.tv_nsec / 1000000; in sigwrap_epoll_wait()
144 int sigwrap_epoll_pwait(int epfd, struct epoll_event *events, int maxevents, int timeout, const sig… in sigwrap_epoll_pwait() argument
148 if (timeout != -1) in sigwrap_epoll_pwait()
150 struct timespec Timeout; in sigwrap_epoll_pwait() local
152 Timeout.tv_sec = timeout / 1000; in sigwrap_epoll_pwait()
153 Timeout.tv_nsec = (timeout % 1000) * 1000000; // Convert msec to nsec in sigwrap_epoll_pwait()
155 sigwrap_InitTimeout(&To, &Timeout); in sigwrap_epoll_pwait()
160 int Result = epoll_pwait(epfd, events, maxevents, timeout, sigmask); in sigwrap_epoll_pwait()
168 if (timeout == -1) in sigwrap_epoll_pwait()
174 timeout = To.Timeout.tv_sec * 1000 + To.Timeout.tv_nsec / 1000000; in sigwrap_epoll_pwait()
194 int sigwrap_sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout) in sigwrap_sigtimedwait() argument
198 sigwrap_InitTimeout(&To, timeout); in sigwrap_sigtimedwait()
202 int Result = sigtimedwait(set, info, &To.Timeout); in sigwrap_sigtimedwait()
267 struct timespec Timeout; in sigwrap_usleep() local
269 Timeout.tv_sec = usec / 1000000; in sigwrap_usleep()
270 Timeout.tv_nsec = (usec % 1000000) * 1000; in sigwrap_usleep()
272 sigwrap_InitTimeout(&To, &Timeout); in sigwrap_usleep()
285 usec = To.Timeout.tv_sec * 1000000 + To.Timeout.tv_nsec / 1000; in sigwrap_usleep()
290 int sigwrap_poll(struct pollfd *fds, nfds_t nfds, int timeout) in sigwrap_poll() argument
294 if (timeout > 0) in sigwrap_poll()
296 struct timespec Timeout; in sigwrap_poll() local
298 Timeout.tv_sec = timeout / 1000; in sigwrap_poll()
299 Timeout.tv_nsec = (timeout % 1000) * 1000000; in sigwrap_poll()
301 sigwrap_InitTimeout(&To, &Timeout); in sigwrap_poll()
306 int Result = poll(fds, nfds, timeout); in sigwrap_poll()
314 if (timeout < 0) // Specifying a negative value in timeout means an infinite/no timeout. in sigwrap_poll()
316 else if (timeout == 0) in sigwrap_poll()
322 timeout = To.Timeout.tv_sec * 1000 + To.Timeout.tv_nsec / 1000000; in sigwrap_poll()
326 …rap_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout) in sigwrap_select() argument
330 int Result = select(nfds, readfds, writefds, exceptfds, timeout); in sigwrap_select()
341 …ect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, const struct timespec *timeout, in sigwrap_pselect() argument
346 if (timeout != NULL) in sigwrap_pselect()
348 sigwrap_InitTimeout(&To, timeout); in sigwrap_pselect()
349 timeout = &To.Timeout; in sigwrap_pselect()
354 int Result = pselect(nfds, readfds, writefds, exceptfds, timeout, sigmask); in sigwrap_pselect()
362 if (timeout == NULL) in sigwrap_pselect()