public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug string/26540] New: [linux-only] nanosleep should call the syscall of the same name, not the posix version
@ 2020-08-26 19:46 crrodriguez at opensuse dot org
  2020-08-26 21:27 ` [Bug string/26540] " adhemerval.zanella at linaro dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: crrodriguez at opensuse dot org @ 2020-08-26 19:46 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=26540

            Bug ID: 26540
           Summary: [linux-only] nanosleep should call the syscall of the
                    same name, not the posix version
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: string
          Assignee: unassigned at sourceware dot org
          Reporter: crrodriguez at opensuse dot org
  Target Milestone: ---

nanosleep on linux rather disappointingly does not call the kernel nanosleep(2)
syscall but calls clock_nanosleep with CLOCK_REALTIME, this happens because
there is no nanosleep syscall wrapper (either by omission or intentionally) the
effect of this is rather unpleasant because it affects usleep(3) sleep(3)
making all non-monotonic.


The documentation of sleep(3) says for example,..

" On Linux, sleep() is implemented via nanosleep(2).  See the nanosleep(2) man
page for a discussion of the clock used."

good, now let's see what nanosleep(2) syscall documentation says.

"POSIX.1 specifies that nanosleep() should measure time against the
CLOCK_REALTIME clock.  However, Linux measures the time using the
CLOCK_MONOTONIC clock."

At least on linux the reasonable expectation is that the __nanosleep uses the
kernel syscall that behaves as documented.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-08-27 13:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-26 19:46 [Bug string/26540] New: [linux-only] nanosleep should call the syscall of the same name, not the posix version crrodriguez at opensuse dot org
2020-08-26 21:27 ` [Bug string/26540] " adhemerval.zanella at linaro dot org
2020-08-26 22:01 ` crrodriguez at opensuse dot org
2020-08-26 22:21 ` crrodriguez at opensuse dot org
2020-08-26 22:55 ` adhemerval.zanella at linaro dot org
2020-08-27  8:42 ` fweimer at redhat dot com
2020-08-27 10:49 ` adhemerval.zanella at linaro dot org
2020-08-27 13:05 ` crrodriguez at opensuse dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).