/* This file is part of the Project Athena Zephyr Notification System. * It contains the ZCheckIfNotice/select loop used for waiting for * a notice, with a timeout. * Copyright (c) 1991 by the Massachusetts Institute of Technology. * For copying and distribution information, see the file #ifndef ZEPHYR_USES_KERBEROS static int gettimeofday(struct timeval* tv, struct timezone* tz){ long long ns100; /*time since 1 Jan 1601 in 100ns units */ GetSystemTimeAsFileTime( &(_now.ft) ); tv->tv_usec=(long)((_now.ns100 / 10LL) % 1000000LL ); tv->tv_sec= (long)((_now.ns100-(116444736000000000LL))/10000000LL); Code_t Z_WaitForNotice (notice, pred, arg, timeout) int (*pred) __P((ZNotice_t *, void *)); retval = ZCheckIfNotice (notice, (struct sockaddr_in *) 0, pred, if (retval != ZERR_NONOTICE) gettimeofday (&t0, (struct timezone *)NULL); i = select (fd + 1, &fdmask, (fd_set *) 0, (fd_set *) 0, &tv); if (i < 0 && errno != EINTR) retval = ZCheckIfNotice (notice, (struct sockaddr_in *) 0, pred, if (retval != ZERR_NONOTICE) /* includes ZERR_NONE */ gettimeofday (&tv, (struct timezone *) NULL); tv.tv_usec = t0.tv_usec - tv.tv_usec; tv.tv_sec = t0.tv_sec - tv.tv_sec - 1; tv.tv_sec = t0.tv_sec - tv.tv_sec;