Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/rtapi/uspace_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,15 @@ static int rtapi_clock_nanosleep(clockid_t clock_id, int flags,
(void)pnow;
#if defined(HAVE_CLOCK_NANOSLEEP)
return TEMP_FAILURE_RETRY(clock_nanosleep(clock_id, flags, prequest, remain));
#elif defined(__APPLE__)
/* Darwin provides nanosleep(); this helper's callers use relative waits. */
(void)clock_id;
if(flags != 0)
{
errno = EINVAL;
return -1;
}
return nanosleep(prequest, remain);
Comment on lines +373 to +381

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this be simpler? Or does that give other problems?

@@ -373,6 +373,12 @@ static int rtapi_clock_nanosleep(clockid_t clock_id, int flags,
 #else
     if(flags == 0)
         return nanosleep(prequest, remain);
+#if defined(__APPLE__)
+    else {
+        errno = EINTR;
+        return -1;
+    }
+#endif
     if(flags != TIMER_ABSTIME)
     {
         errno = EINVAL;

#else
if(flags == 0)
return nanosleep(prequest, remain);
Expand Down