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.
+ */