Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

clockctl(4) vs settimeofday(2)



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?

:)




+------------------+--------------------------+------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+------------------------+


Home | Main Index | Thread Index | Old Index