#include <fcntl.h>
#include <signal.h>
+#include "sysdep.h"
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
# include <time.h>
# endif
#endif
+
#ifdef HAVE_SYSCALL_H
-#include <syscall.h>
-#else if HAVE_SYS_SYSCALL_H
-#include <sys/syscall.h>
+# include <syscall.h>
+#else
+# if HAVE_SYS_SYSCALL_H
+# include <sys/syscall.h>
+# endif
#endif
+
#include <libcitadel.h>
#include "threads.h"
#endif
// Tell the world we are here
-#ifdef HAVE_SYSCALL_H
+#if defined(HAVE_SYSCALL_H) && defined (SYS_gettid)
this_thread->reltid = syscall(SYS_gettid);
#endif
CtdlLogPrintf(CTDL_NOTICE, "Created a new thread \"%s\" (0x%08lx).\n",