Hi,
This patch contributed by Jeff Bailey <[EMAIL PROTECTED]>, fixes
a build failure on ia64, by using syscall() instead of _syscall0
as the later is not supported there.
regards,
guillem
--- lib/direct/system.c 2005-05-18 16:33:22.000000000 +0000
+++ lib/direct/system.c 2005-05-18 16:38:18.000000000 +0000
@@ -42,27 +42,20 @@
#if DIRECT_BUILD_GETTID && defined(HAVE_LINUX_UNISTD_H)
#include <linux/unistd.h>
-
-#ifdef __NR_gettid
-static inline _syscall0(pid_t,gettid)
-#else
-#warning __NR_gettid was not found in "linux/unistd.h", using getpid instead
-#define gettid getpid
-#endif
-
-#else
-
-#include <unistd.h>
-#define gettid getpid
-
#endif
-
__attribute__((no_instrument_function))
pid_t
direct_gettid()
{
- return gettid();
+ pid_t tid = -1;
+#if DIRECT_BUILD_GETTID && defined(__NR_gettid) /* present on linux >= 2.4.20
*/
+ tid = syscall(__NR_gettid);
+#endif
+ if (tid < 0)
+ tid = getpid();
+
+ return tid;
}
long
_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev