summaryrefslogtreecommitdiffstats
path: root/src/common.c
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2017-12-19 23:39:21 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2017-12-19 23:39:21 +0000
commit61aedf201c2c4bf0e5aa4db32e74f4d860b88593 (patch)
treebcf4f9a0cd8bc2daf38b2ff9f29bfcc1e5ed8968 /src/common.c
parentNew upstream version 1.8.0+dfsg (diff)
downloadnetdata-61aedf201c2c4bf0e5aa4db32e74f4d860b88593.tar.xz
netdata-61aedf201c2c4bf0e5aa4db32e74f4d860b88593.zip
New upstream version 1.9.0+dfsgupstream/1.9.0+dfsg
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__*/
}