In article <[email protected]>,
Paul Goyette  <[email protected]> wrote:
>According to the clockctl(4) man page, operations on system time should
>first try the /dev/clockctl device, and only fall-back to the syscall()
>if the device is not available:
>
>       ... The system call stubs in C library will use the ioctl(2) on
>       /dev/clockctl if the special file is present and accessible, or
>       will revert to the plain super-user-restricted system call if
>       the special file is not accessible.
>
>However, looking at the source file for lib/libc/sys/settimeofday.c we
>have the following comment which says that we first try the syscall()
>and only use the /dev/clockctl mechanism if the syscall() fails:
>
>int
>settimeofday(const struct timeval *tv, const void *tzp)
>{
>         struct clockctl_settimeofday args;
>         int rv;
>
>         /*
>          * try syscal first and attempt to switch to clockctl
>          * if that fails with EPERM
>          */
>
>Which of these is correct?  And which needs to be updated?

Using the syscall is simpler and cheaper, so I think the man page should
be updated.

christos

Reply via email to