diff options
author | Gabor Pali <pali.gabor@gmail.com> | 2012-08-10 00:45:42 +0200 |
---|---|---|
committer | Gabor Pali <pali.gabor@gmail.com> | 2012-08-23 16:57:14 +0000 |
commit | 75f2e87bd7b6b8c0143addc59abfe68456e59591 (patch) | |
tree | 428fb8c9b8820419ba6fc2d16b6d10d3b8cdf512 /rts/posix/OSThreads.c | |
parent | cc1cc09dbd5625b6d1c05bb878b8ad1767cb9780 (diff) | |
download | haskell-75f2e87bd7b6b8c0143addc59abfe68456e59591.tar.gz |
Fix build with FreeBSD versions earlier than 9.0
Diffstat (limited to 'rts/posix/OSThreads.c')
-rw-r--r-- | rts/posix/OSThreads.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/rts/posix/OSThreads.c b/rts/posix/OSThreads.c index 7fa2f4d75d..2fa56704cb 100644 --- a/rts/posix/OSThreads.c +++ b/rts/posix/OSThreads.c @@ -31,6 +31,9 @@ #if defined(HAVE_PTHREAD_H) #include <pthread.h> +#if defined(freebsd_HOST_OS) +#include <pthread_np.h> +#endif #endif #if defined(THREADED_RTS) @@ -330,7 +333,8 @@ KernelThreadId kernelThreadId (void) pid_t tid = syscall(SYS_gettid); // no really, see man gettid return (KernelThreadId) tid; -#elif defined(freebsd_HOST_OS) +/* FreeBSD 9.0+ */ +#elif defined(freebsd_HOST_OS) && (__FreeBSD_version >= 900031) return pthread_getthreadid_np(); #elif defined(darwin_HOST_OS) |