#include <sys/types.h>
#include <sys/stat.h>
#include <sys/utsname.h>
-#include <linux/if.h>
-#include <linux/sockios.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <signal.h>
#include <libubox/uloop.h>
+#include <libubox/utils.h>
#include "dns.h"
#include "util.h"
snprintf(mdns_hostname_local, sizeof(mdns_hostname_local), "%s.local", utsname.nodename);
}
-void*
-memdup(const void *d, int l)
+time_t monotonic_time(void)
{
- void *r = malloc(l);
- if (!r)
- return NULL;
- memcpy(r, d, l);
- return r;
+ struct timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ return ts.tv_sec;
}
-