libowfat/io/io_waituntil.c
leitner 97043d279f make io_waituntil actually take an "until", not a "how long"
fix io_timeouted to ignore fds where no timeout has been set
2003-10-02 23:30:53 +00:00

17 lines
369 B
C

#include <unistd.h>
#include <sys/time.h>
#include <poll.h>
#include <errno.h>
#include "io_internal.h"
#include "safemult.h"
void io_waituntil(tai6464 t) {
uint64 x,y;
tai6464 now,diff;
taia_now(&now);
taia_sub(&diff,&t,&now);
if (!umult64(diff.sec.x,1000,&x) || (y=x+diff.nano/10000000)<x)
y=-1; /* overflow; wait indefinitely */
io_waituntil2(y);
}