diff options
author | norrarvid <norrarvid@gmail.com> | 2012-05-27 17:17:39 +0200 |
---|---|---|
committer | norrarvid <norrarvid@gmail.com> | 2012-05-27 17:17:39 +0200 |
commit | 4d4ebbf3632bed609b41a9d36969c08d36791417 (patch) | |
tree | 3c81398b71442617a3897f00f3be400b6fdd29d3 /common/os_calls.c | |
parent | 900a2541ca94b5c4cb839c3bd6d35e6460ca1c48 (diff) | |
download | xrdp-proprietary-4d4ebbf3632bed609b41a9d36969c08d36791417.tar.gz xrdp-proprietary-4d4ebbf3632bed609b41a9d36969c08d36791417.zip |
Initial syslog support in XRDP
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 692dc015..dada66ce 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 @@ -2163,6 +2167,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) |