summaryrefslogtreecommitdiffstats
path: root/src/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common.c b/src/common.c
index 5a953672d..a976e96eb 100644
--- a/src/common.c
+++ b/src/common.c
@@ -17,6 +17,7 @@ char *netdata_configured_cache_dir = NULL;
char *netdata_configured_varlib_dir = NULL;
char *netdata_configured_home_dir = NULL;
char *netdata_configured_host_prefix = NULL;
+char *netdata_configured_timezone = NULL;
int enable_ksm = 1;
@@ -1119,10 +1120,14 @@ pid_t gettid(void) {
#ifdef __FreeBSD__
return (pid_t)pthread_getthreadid_np();
#elif defined(__APPLE__)
+#if (defined __MAC_OS_X_VERSION_MIN_REQUIRED && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060)
uint64_t curthreadid;
pthread_threadid_np(NULL, &curthreadid);
return (pid_t)curthreadid;
-#else
+#else /* __MAC_OS_X_VERSION_MIN_REQUIRED */
+ return (pid_t)pthread_self;
+#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */
+#else /* __APPLE__*/
return (pid_t)syscall(SYS_gettid);
#endif /* __FreeBSD__, __APPLE__*/
}