X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fmdnsd.git;a=blobdiff_plain;f=util.c;h=63f1612fdb2c935887de2d0bdd2953ae5d630a40;hp=f0517b42fe30837ba7ef37712e1dc0ac727fc28b;hb=c0c78c92d57c53276bb7f08468bcc716ba272497;hpb=8f4777715aa8a99d019026c9a87039005fcd5754 diff --git a/util.c b/util.c index f0517b4..63f1612 100644 --- a/util.c +++ b/util.c @@ -27,6 +27,7 @@ #include #include +#include #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; +}