aboutsummaryrefslogtreecommitdiff
path: root/src/lib/time/time_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/time/time_sys.c')
-rw-r--r--src/lib/time/time_sys.c29
1 files changed, 29 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..1c1bc4cd18
--- /dev/null
+++ b/src/lib/time/time_sys.c
@@ -0,0 +1,29 @@
+/* Copyright (c) 2018-2020, 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
+subsys_time_initialize(void)
+{
+ monotime_init();
+ return 0;
+}
+
+const subsys_fns_t sys_time = {
+ .name = "time",
+ SUBSYS_DECLARE_LOCATION(),
+ /* Monotonic time depends on logging, and a lot of other modules depend on
+ * monotonic time. */
+ .level = -80,
+ .supported = true,
+ .initialize = subsys_time_initialize,
+};