mozilla-M-C-001-gettid-linux.patch
author ISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
Mon, 23 May 2022 03:04:00 +0900
changeset 116837 7d5ea73347b0aa13a561a95afdf25101bf4d061c
permissions -rw-r--r--
Define gettid as macro call to syscall under linux

# HG changeset patch
# User ISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
# Parent  71853bc0eae7b7ba5599c6538625b73f74e882c7
Define gettid as macro call to syscall under linux

diff --git a/nsprpub/pr/src/pthreads/ptthread.c b/nsprpub/pr/src/pthreads/ptthread.c
--- a/nsprpub/pr/src/pthreads/ptthread.c
+++ b/nsprpub/pr/src/pthreads/ptthread.c
@@ -29,16 +29,20 @@
 #include <sys/prctl.h>
 #endif
 
 #ifdef _PR_NICE_PRIORITY_SCHEDULING
 #undef _POSIX_THREAD_PRIORITY_SCHEDULING
 #include <sys/resource.h>
 #ifndef HAVE_GETTID
 #define gettid() (syscall(SYS_gettid))
+#elif defined (LINUX)
+// Under linux, gettid is not a defined function, but has to be changed to
+// a wrapper call via syscall.
+#define gettid() (syscall(SYS_gettid))
 #endif
 #endif
 
 /*
  * Record whether or not we have the privilege to set the scheduling
  * policy and priority of threads.  0 means that privilege is available.
  * EPERM means that privilege is not available.
  */