diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2012-06-04 01:11:16 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2012-06-04 01:11:16 -0700 |
commit | 5cd7e29a9fa69c8b1b6c3a3ca8ebf8a9966a2492 (patch) | |
tree | a47661f16bcd913652a2a6d671e71884a79046f8 /common/os_calls.c | |
parent | af1b96b3d2dd4c7fb3d15b278e2fbbb6bcc9065e (diff) | |
parent | 4d4ebbf3632bed609b41a9d36969c08d36791417 (diff) | |
download | xrdp-proprietary-5cd7e29a9fa69c8b1b6c3a3ca8ebf8a9966a2492.tar.gz xrdp-proprietary-5cd7e29a9fa69c8b1b6c3a3ca8ebf8a9966a2492.zip |
Merge remote branch 'syslog3/syslog3'
Diffstat (limited to 'common/os_calls.c')
-rw-r--r-- | common/os_calls.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/common/os_calls.c b/common/os_calls.c index 211adc82..453c0466 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -71,6 +71,10 @@ extern char** environ; #endif +#if defined(__linux__) +#include <linux/unistd.h> +#endif + /* for solaris */ #if !defined(PF_LOCAL) #define PF_LOCAL AF_UNIX @@ -2215,6 +2219,22 @@ g_getpid(void) } /*****************************************************************************/ +int APP_CC +g_gettid(void) +{ +#if defined(_WIN32) + return (int)GetCurrentThreadId(); +#else +#if defined(__linux__) + /* This is Linux specific way of getting the thread id. + * Function is not part of GLIB so therefore this syscall*/ + return (int)syscall(__NR_gettid); +#else + return (int)pthread_self(); +#endif +#endif +} +/*****************************************************************************/ /* does not work in win32 */ int APP_CC g_sigterm(int pid) |