compat_time.h 607 B

1234567891011121314151617181920212223242526
  1. /* Copyright (c) 2003-2004, Roger Dingledine
  2. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  3. * Copyright (c) 2007-2016, The Tor Project, Inc. */
  4. /* See LICENSE for licensing information */
  5. #ifndef TOR_COMPAT_TIME_H
  6. #define TOR_COMPAT_TIME_H
  7. #include "orconfig.h"
  8. #if !defined(HAVE_GETTIMEOFDAY) && !defined(HAVE_STRUCT_TIMEVAL_TV_SEC)
  9. /** Implementation of timeval for platforms that don't have it. */
  10. struct timeval {
  11. time_t tv_sec;
  12. unsigned int tv_usec;
  13. };
  14. #endif
  15. void tor_gettimeofday(struct timeval *timeval);
  16. #ifdef TOR_UNIT_TESTS
  17. void tor_sleep_msec(int msec);
  18. #endif
  19. #endif