time_sys.c 601 B

12345678910111213141516171819202122232425262728
  1. /* Copyright (c) 2018-2019, The Tor Project, Inc. */
  2. /* See LICENSE for licensing information */
  3. /**
  4. * \file time_sys.c
  5. * \brief Subsystem object for monotime setup.
  6. **/
  7. #include "orconfig.h"
  8. #include "lib/subsys/subsys.h"
  9. #include "lib/time/time_sys.h"
  10. #include "lib/time/compat_time.h"
  11. static int
  12. subsys_time_initialize(void)
  13. {
  14. monotime_init();
  15. return 0;
  16. }
  17. const subsys_fns_t sys_time = {
  18. .name = "time",
  19. /* Monotonic time depends on logging, and a lot of other modules depend on
  20. * monotonic time. */
  21. .level = -80,
  22. .supported = true,
  23. .initialize = subsys_time_initialize,
  24. };