123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- typedef __suseconds_t suseconds_t;
- __BEGIN_DECLS
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
- }
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
- }
- struct timezone
- {
- int tz_minuteswest;
- int tz_dsttime;
- };
- typedef struct timezone *__restrict __timezone_ptr_t;
- typedef void *__restrict __timezone_ptr_t;
- extern int gettimeofday (struct timeval *__restrict __tv,
- __timezone_ptr_t __tz) __THROW __nonnull ((1));
- libc_hidden_proto(gettimeofday)
- extern int settimeofday (const struct timeval *__tv,
- const struct timezone *__tz)
- __THROW __nonnull ((1));
- libc_hidden_proto(settimeofday)
- extern int adjtime (const struct timeval *__delta,
- struct timeval *__olddelta) __THROW;
- enum __itimer_which
- {
-
- ITIMER_REAL = 0,
-
- ITIMER_VIRTUAL = 1,
-
- ITIMER_PROF = 2
- };
- struct itimerval
- {
-
- struct timeval it_interval;
-
- struct timeval it_value;
- };
- typedef enum __itimer_which __itimer_which_t;
- typedef int __itimer_which_t;
- extern int getitimer (__itimer_which_t __which,
- struct itimerval *__value) __THROW;
- extern int setitimer (__itimer_which_t __which,
- const struct itimerval *__restrict __new,
- struct itimerval *__restrict __old) __THROW;
- libc_hidden_proto(setitimer)
- extern int utimes (const char *__file, const struct timeval __tvp[2])
- __THROW __nonnull ((1));
- libc_hidden_proto(utimes)
- extern int lutimes (const char *__file, const struct timeval __tvp[2])
- __THROW __nonnull ((1));
- extern int futimes (int __fd, const struct timeval __tvp[2]) __THROW;
- extern int futimesat (int __fd, const char *__file,
- const struct timeval __tvp[2]) __THROW;
- (((a)->tv_sec == (b)->tv_sec) ? \
- ((a)->tv_usec CMP (b)->tv_usec) : \
- ((a)->tv_sec CMP (b)->tv_sec))
- # define timeradd(a, b, result) \
- do { \
- (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
- (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
- if ((result)->tv_usec >= 1000000) \
- { \
- ++(result)->tv_sec; \
- (result)->tv_usec -= 1000000; \
- } \
- } while (0)
- do { \
- (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
- (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
- if ((result)->tv_usec < 0) { \
- --(result)->tv_sec; \
- (result)->tv_usec += 1000000; \
- } \
- } while (0)
- __END_DECLS
|