-// enable O_NOATIME
-#define _GNU_SOURCE
-
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <sys/syscall.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include "log.h"
#include "common.h"
+char *global_host_prefix = "";
+
/*
// http://stackoverflow.com/questions/7666509/hash-function-for-string
uint32_t simple_hash(const char *name)
return fcntl(fd, F_GETFD) != -1 || errno != EBADF;
}
+/*
+ ***************************************************************************
+ * Get number of clock ticks per second.
+ ***************************************************************************
+ */
+unsigned int hz;
+
+void get_HZ(void)
+{
+ long ticks;
+
+ if ((ticks = sysconf(_SC_CLK_TCK)) == -1) {
+ perror("sysconf");
+ }
+
+ hz = (unsigned int) ticks;
+}
+
+pid_t gettid(void)
+{
+ return syscall(SYS_gettid);
+}
+