projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Port: Add logging thread id support on GNU Hurd
[babeltrace.git]
/
src
/
logging
/
log.c
diff --git
a/src/logging/log.c
b/src/logging/log.c
index 6f8de7b4959bfebfb8eb1a363cb1cc35fa0d9110..49f69958c7a0cc6499a907531293090a54d37628 100644
(file)
--- a/
src/logging/log.c
+++ b/
src/logging/log.c
@@
-330,6
+330,9
@@
extern unsigned long pthread_getsequence_np(pthread_t *);
#if defined(__MACH__)
#include <pthread.h>
#endif
#if defined(__MACH__)
#include <pthread.h>
#endif
+#if defined(__GNU__)
+ #include <mach.h>
+#endif
#define INLINE _BT_LOG_INLINE
#define VAR_UNUSED(var) (void)var
#define INLINE _BT_LOG_INLINE
#define VAR_UNUSED(var) (void)var
@@
-843,8
+846,12
@@
static void pid_callback(int *const pid, int *const tid)
*tid = gettid();
#elif defined(__linux__)
*tid = syscall(SYS_gettid);
*tid = gettid();
#elif defined(__linux__)
*tid = syscall(SYS_gettid);
- #elif defined(__MACH__)
+ #elif defined(__
APPLE__) && defined(__
MACH__)
*tid = (int)pthread_mach_thread_np(pthread_self());
*tid = (int)pthread_mach_thread_np(pthread_self());
+ #elif defined(__GNU__)
+ mach_port_t mach_port = mach_thread_self();
+ mach_port_deallocate(mach_task_self(), mach_port);
+ *tid = (int)mach_port;
#else
#define Platform not supported
#endif
#else
#define Platform not supported
#endif
This page took
0.023068 seconds
and
4
git commands to generate.