Define gettid as macro call to syscall under linux draft
authorISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
Mon, 23 May 2022 03:04:00 +0900
changeset 116837 7d5ea73347b0aa13a561a95afdf25101bf4d061c
parent 116836 a1870234c06d5b174a4e261d4be59ef28ab4136f
child 116838 82235e78bbcd49e37f0f3dff11c63be1987e4ba0
push id15955
push userishikawa@yk.rim.or.jp
push dateSun, 22 May 2022 18:04:18 +0000
treeherdertry-comm-central@beaacca97fbd [default view] [failures only]
Define gettid as macro call to syscall under linux
mozilla-M-C-001-gettid-linux.patch
new file mode 100644
--- /dev/null
+++ b/mozilla-M-C-001-gettid-linux.patch
@@ -0,0 +1,29 @@
+# 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.
+  */