-// 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>
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);
+}
+