From 5719b7a58d25c302a9190d5f936be7dae97851d5 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 2 Jul 2012 02:50:02 +0200 Subject: [PATCH] if SYS_gettid doesn't exist (like under HURD), use getpid() instead --- common_linux.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common_linux.h b/common_linux.h index b0381d991..6766ff37c 100644 --- a/common_linux.h +++ b/common_linux.h @@ -86,7 +86,13 @@ static inline int my_set_mempolicy(int mode, const unsigned long *addr, unsigned return syscall(SYS_set_mempolicy, mode, addr, flag); } -static inline int my_gettid(void) { return syscall(SYS_gettid); } +static inline int my_gettid(void) { +#ifdef SYS_gettid +return syscall(SYS_gettid); +#else +return getpid(); +#endif +} #endif #endif