Skip to content

Commit 65cade4

Browse files
committed
posix-timers: Document sys_clock_getoverrun()
Document the syscall in detail and with coherent sentences. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Frederic Weisbecker <frederic@kernel.org> Link: https://lore.kernel.org/r/20230425183313.462051641@linutronix.de
1 parent a86e928 commit 65cade4

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

kernel/time/posix-timers.c

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -783,14 +783,23 @@ SYSCALL_DEFINE2(timer_gettime32, timer_t, timer_id,
783783

784784
#endif
785785

786-
/*
787-
* Get the number of overruns of a POSIX.1b interval timer. This is to
788-
* be the overrun of the timer last delivered. At the same time we are
789-
* accumulating overruns on the next timer. The overrun is frozen when
790-
* the signal is delivered, either at the notify time (if the info block
791-
* is not queued) or at the actual delivery time (as we are informed by
792-
* the call back to posixtimer_rearm(). So all we need to do is
793-
* to pick up the frozen overrun.
786+
/**
787+
* sys_timer_getoverrun - Get the number of overruns of a POSIX.1b interval timer
788+
* @timer_id: The timer ID which identifies the timer
789+
*
790+
* The "overrun count" of a timer is one plus the number of expiration
791+
* intervals which have elapsed between the first expiry, which queues the
792+
* signal and the actual signal delivery. On signal delivery the "overrun
793+
* count" is calculated and cached, so it can be returned directly here.
794+
*
795+
* As this is relative to the last queued signal the returned overrun count
796+
* is meaningless outside of the signal delivery path and even there it
797+
* does not accurately reflect the current state when user space evaluates
798+
* it.
799+
*
800+
* Returns:
801+
* -EINVAL @timer_id is invalid
802+
* 1..INT_MAX The number of overruns related to the last delivered signal
794803
*/
795804
SYSCALL_DEFINE1(timer_getoverrun, timer_t, timer_id)
796805
{

0 commit comments

Comments
 (0)