Skip to content

Commit 640fe74

Browse files
committed
posix-timers: Document nanosleep() details
The descriptions for common_nsleep() is wrong and common_nsleep_timens() lacks any form of comment. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Frederic Weisbecker <frederic@kernel.org> Link: https://lore.kernel.org/r/20230425183313.567072835@linutronix.de
1 parent 3561fcb commit 640fe74

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

kernel/time/posix-timers.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,7 @@ SYSCALL_DEFINE2(clock_getres_time32, clockid_t, which_clock,
13701370
#endif
13711371

13721372
/*
1373-
* nanosleep for monotonic and realtime clocks
1373+
* sys_clock_nanosleep() for CLOCK_REALTIME and CLOCK_TAI
13741374
*/
13751375
static int common_nsleep(const clockid_t which_clock, int flags,
13761376
const struct timespec64 *rqtp)
@@ -1382,8 +1382,13 @@ static int common_nsleep(const clockid_t which_clock, int flags,
13821382
which_clock);
13831383
}
13841384

1385+
/*
1386+
* sys_clock_nanosleep() for CLOCK_MONOTONIC and CLOCK_BOOTTIME
1387+
*
1388+
* Absolute nanosleeps for these clocks are time-namespace adjusted.
1389+
*/
13851390
static int common_nsleep_timens(const clockid_t which_clock, int flags,
1386-
const struct timespec64 *rqtp)
1391+
const struct timespec64 *rqtp)
13871392
{
13881393
ktime_t texp = timespec64_to_ktime(*rqtp);
13891394

0 commit comments

Comments
 (0)