On Fri, Jul 22, 2022 at 10:38:32AM +0000, Klemens Nanni wrote:
> timeout_set_flags() explains the flag and the next paragraph would simply
> repeat it.
>
> timeout_set_proc() can be described simpler, just like what the
> actual function does; this way I don't feel having just read the
> same sentence twice.
The current text describes the intension of the function. You
change it to an implementation detail. The timeout_set_proc() is
a commonly used API, timeout_set_flags() is barely used.
Instead of adding a redirection in the man page to an unused function,
I would make timeout_set_flags() private to kern_timeout.c. Dthen
it needs no documentation.
> sys/kern/kern_timeout.c:
> void
> timeout_set_flags(struct timeout *to, void (*fn)(void *), void *arg, int
> flags)
> {
> _timeout_set(to, fn, arg, KCLOCK_NONE, flags);
> }
>
> void
> timeout_set_proc(struct timeout *new, void (*fn)(void *), void *arg)
> {
> _timeout_set(new, fn, arg, KCLOCK_NONE, TIMEOUT_PROC);
> }
>
> Index: timeout.9
> ===================================================================
> RCS file: /cvs/src/share/man/man9/timeout.9,v
> retrieving revision 1.55
> diff -u -p -r1.55 timeout.9
> --- timeout.9 22 Jun 2022 14:10:49 -0000 1.55
> +++ timeout.9 22 Jul 2022 10:34:22 -0000
> @@ -138,11 +138,12 @@ interrupt context.
> .Pp
> The
> .Fn timeout_set_proc
> -function is similar to
> -.Fn timeout_set
> -but it runs the timeout in a process context instead of the default
> -.Dv IPL_SOFTCLOCK
> -interrupt context.
> +function is a shorthand for
> +.Fn timeout_set_flags
> +with a
> +.Fa flags
> +value of
> +.Dv TIMEOUT_PROC .
> .Pp
> The function
> .Fn timeout_add