about summary refs log tree commit diff
path: root/sysdeps/mach/htl/pt-timedblock.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/htl/pt-timedblock.c')
-rw-r--r--sysdeps/mach/htl/pt-timedblock.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sysdeps/mach/htl/pt-timedblock.c b/sysdeps/mach/htl/pt-timedblock.c
index 63af869c90..ead070e397 100644
--- a/sysdeps/mach/htl/pt-timedblock.c
+++ b/sysdeps/mach/htl/pt-timedblock.c
@@ -26,6 +26,10 @@
 
 #include <pt-internal.h>
 
+#ifndef MSG_OPTIONS
+# define MSG_OPTIONS 0
+#endif
+
 /* Block THREAD.  */
 error_t
 __pthread_timedblock (struct __pthread *thread,
@@ -54,11 +58,13 @@ __pthread_timedblock (struct __pthread *thread,
     /* Need to do a carry.  */
     timeout -= (now.tv_nsec - abstime->tv_nsec + 999999) / 1000000;
 
-  err = __mach_msg (&msg, MACH_RCV_MSG | MACH_RCV_TIMEOUT, 0,
+  err = __mach_msg (&msg, MACH_RCV_MSG | MACH_RCV_TIMEOUT | MSG_OPTIONS, 0,
 		    sizeof msg, thread->wakeupmsg.msgh_remote_port,
 		    timeout, MACH_PORT_NULL);
   if (err == EMACH_RCV_TIMED_OUT)
     return ETIMEDOUT;
+  if ((MSG_OPTIONS & MACH_RCV_INTERRUPT) && err == MACH_RCV_INTERRUPTED)
+    return EINTR;
 
   assert_perror (err);
   return 0;