CLOCKCTL(4)
okay bestie, welcome to clockctl(4) from the Kernel Interfaces Manual. this page is about the clockctl pseudo-device, and the way that it brings clock control to non-root users? lowkey iconic. π
β¨
πΈ NAME πΈ
clockctl β Clock subsystem user control
π οΈ SYNOPSIS π οΈ
pseudo-device clockctl
π DESCRIPTION π
okay so the clockctl interface brings clock control to non-root users. Any user with write access to /dev/clockctl will be able to perform operations such as settimeofday(2), clock_settime(2), adjtime(2), or ntp_adjtime(2), which are normally restricted to the super-user. Using the clockctl pseudo-device, it is possible to run daemons such as ntpd(8) as non-privileged users, thus reducing the security exposure if a compromise is found in such a daemon. highkey a security glow-up, fr fr. π₯
The clockctl pseudo-device driver provides an ioctl(2) call for each privileged clock-related system call. 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. no cap, that's the routing vibe. π
The following ioctl(2) calls are defined in <sys/clockctl.h>:
π« CLOCKCTL_SETTIMEOFDAY π«
This will run the settimeofday(2) system call. Argument should be a pointer to a struct clockctl_settimeofday:
struct clockctl_settimeofday {
const struct timeval *tv;
const void *tzp;
};
β° CLOCKCTL_CLOCK_SETTIME β°
This will run the clock_settime(2) system call. Argument should be a pointer to a struct clockctl_clock_settime:
struct clockctl_clock_settime {
clockid_t clock_id;
struct timespec *tp;
};
π§ CLOCKCTL_ADJTIME π§
This will run the adjtime(2) system call. Argument should be a pointer to a struct clockctl_adjtime:
struct clockctl_adjtime {
const struct timeval *delta;
struct timeval *olddelta;
};
π°οΈ CLOCKCTL_NTP_ADJTIME π°οΈ
This will run the ntp_adjtime(2) system call. Argument should be a pointer to a struct clockctl_ntp_adjtime:
struct clockctl_ntp_adjtime {
struct timex *tp;
};
π SEE ALSO π
π¦ HISTORY π¦
clockctl appeared in NetBSD 1.6.
okay that's literally the whole page! source/version: Debian / CLOCKCTL(4); date: February 19, 2009. mwah, go slay your clock stuff bestie πβ¨ periodt.
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2001 The NetBSD Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms