clock_nanosleep.2, timer_create.2, timerfd_create.2: Add various missing errors

Mostly verified by testing and reading the code.

There is unfortunately quite a bit of inconsistency across API~s:

                  clock_gettime  clock_settime  clock_nanosleep  timer_create  timerfd_create

CLOCK_BOOTTIME            y        n (EINVAL)     y                y             y
CLOCK_BOOTTIME_ALARM      y        n (EINVAL)     y [1]            y [1]         y [1]
CLOCK_MONOTONIC           y        n (EINVAL)     y                y             y
CLOCK_MONOTONIC_COARSE    y        n (EINVAL)     n (ENOTSUP)      n (ENOTSUP)   n (EINVAL)
CLOCK_MONOTONIC_RAW       y        n (EINVAL)     n (ENOTSUP)      n (ENOTSUP)   n (EINVAL)
CLOCK_REALTIME            y        y              y                y             y
CLOCK_REALTIME_ALARM      y        n (EINVAL)     y [1]            y [1]         y [1]
CLOCK_REALTIME_COARSE     y        n (EINVAL)     n (ENOTSUP)      n (ENOTSUP)   n (EINVAL)
CLOCK_TAI                 y        n (EINVAL)     y                y             n (EINVAL)
CLOCK_PROCESS_CPUTIME_ID  y        n (EINVAL)     y                y             n (EINVAL)
CLOCK_THREAD_CPUTIME_ID   y        n (EINVAL)     n (EINVAL [2])   y             n (EINVAL)
pthread_getcpuclockid()   y        n (EINVAL)     y                y             n (EINVAL)

[1] The caller must have CAP_WAKE_ALARM, or the error EPERM results.

[2] This error is generated in the glibc wrapper.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2020-04-02 08:39:08 +02:00
parent 04e2e313fc
commit 96d951a401
3 changed files with 28 additions and 0 deletions

View File

@ -193,6 +193,10 @@ was invalid.
.RB ( CLOCK_THREAD_CPUTIME_ID
is not a permitted value for
.IR clock_id .)
.TP
.B ENOTSUP
The kernel does not support sleeping against this
.IR clock_id .
.SH VERSIONS
The
.BR clock_nanosleep ()

View File

@ -223,6 +223,20 @@ is invalid.
.B ENOMEM
.\" glibc layer: malloc()
Could not allocate memory.
.TP
.B ENOTSUP
The kernel does not support creating a timer against this
.IR clockid .
.TP
.B EPERM
.I clockid
was
.BR CLOCK_REALTIME_ALARM
or
,BR CLOCK_BOOTTIME_ALARM
but the caller did not have the
.BR CAP_WAKE_ALARM
capability.
.SH VERSIONS
This system call is available since Linux 2.6.
.SH CONFORMING TO

View File

@ -443,6 +443,16 @@ Could not mount (internal) anonymous inode device.
.TP
.B ENOMEM
There was insufficient kernel memory to create the timer.
.TP
.B EPERM
.I clockid
was
.BR CLOCK_REALTIME_ALARM
or
,BR CLOCK_BOOTTIME_ALARM
but the caller did not have the
.BR CAP_WAKE_ALARM
capability.
.PP
.BR timerfd_settime ()
and