Simplify UDP vs. TCP handling in service_announce_services
[project/mdnsd.git] / util.c
diff --git a/util.c b/util.c
index f0517b4..63f1612 100644 (file)
--- a/util.c
+++ b/util.c
@@ -27,6 +27,7 @@
 #include <signal.h>
 
 #include <libubox/uloop.h>
+#include <libubox/utils.h>
 
 #include "dns.h"
 #include "util.h"
@@ -73,3 +74,10 @@ void get_hostname(void)
        snprintf(mdns_hostname, sizeof(mdns_hostname), "%s", utsname.nodename);
        snprintf(mdns_hostname_local, sizeof(mdns_hostname_local), "%s.local", utsname.nodename);
 }
+
+time_t monotonic_time(void)
+{
+       struct timespec ts;
+       clock_gettime(CLOCK_MONOTONIC, &ts);
+       return ts.tv_sec;
+}