--- a/pthread_getw32threadhandle_np.c
+++ b/pthread_getw32threadhandle_np.c
@@ -51,3 +51,15 @@
 {
   return ((ptw32_thread_t *)thread.p)->threadH;
 }
+
+/*
+ * pthread_getw32threadid_np()
+ *
+ * Returns the win32 thread id that the POSIX
+ * thread "thread" is running as.
+ */
+DWORD
+pthread_getw32threadid_np (pthread_t thread)
+{
+  return ((ptw32_thread_t *)thread.p)->thread;
+}