diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-11-02 18:09:44 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-11-05 09:22:02 -0500 |
commit | 207253df8d7c040840c7f4305534e6979bfc7bf7 (patch) | |
tree | 07e10f59d86a2ec72cd0b475ecf5e501a77ba997 /src/lib/time/time_sys.c | |
parent | cad61f0f6de48c6eab6e811a081f154b03de57b8 (diff) | |
download | tor-207253df8d7c040840c7f4305534e6979bfc7bf7.tar.gz tor-207253df8d7c040840c7f4305534e6979bfc7bf7.zip |
Move monotonic time setup into a subsystem
Diffstat (limited to 'src/lib/time/time_sys.c')
-rw-r--r-- | src/lib/time/time_sys.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/time/time_sys.c b/src/lib/time/time_sys.c new file mode 100644 index 0000000000..2303874f29 --- /dev/null +++ b/src/lib/time/time_sys.c @@ -0,0 +1,26 @@ +/* Copyright (c) 2018, The Tor Project, Inc. */ +/* See LICENSE for licensing information */ + +/** + * \file time_sys.c + * \brief Subsystem object for monotime setup. + **/ + +#include "orconfig.h" +#include "lib/subsys/subsys.h" +#include "lib/time/time_sys.h" +#include "lib/time/compat_time.h" + +static int +init_time_sys(void) +{ + monotime_init(); + return 0; +} + +const subsys_fns_t sys_time = { + .name = "time", + .level = -90, + .supported = true, + .initialize = init_time_sys, +}; |