ADJTIME(2)
ADJTIME(2) π
okay so this is the System Calls Manual page for adjtime β the syscall that makes little corrections so the system clock can sync up. Welcome to the group chat, bestie. π°οΈβ¨
πΈ NAME πΈ
adjtime β correct the time to allow synchronization of the system clock.
π LIBRARY π
Standard C Library (libc, -lc). That's the whole library vibe. π«Ά
β¨ SYNOPSIS β¨
#include <sys/time.h>
int
adjtime(const struct timeval *delta, struct timeval *olddelta);
π¦ DESCRIPTION π¦
The adjtime() system call makes small adjustments to the system time β the time as returned by gettimeofday(2) β advancing or retarding it by the time specified by the timeval delta. Tiny lil' clock correction. π
- If
deltais negative, the clock is slowed down by incrementing it more slowly than normal until the correction is complete. π’ - If
deltais positive, a larger increment than normal is used. π - The skew used to perform the correction is generally a fraction of one percent. So, like, a sliver. β¨
- Thus, the time is always a monotonically increasing function. It keeps moving forward, no cap. β³
A time correction from an earlier call to adjtime() may not be finished when adjtime() is called again. So if adjtime() gets called while the previous correction is still cooking, that's just how it is. π
If olddelta is not a null pointer, the structure pointed to will contain, upon return, the number of microseconds still to be corrected from the earlier call. That's your little "how much correction is left" receipt. π§Ύ
This call may be used by time servers that synchronize the clocks of computers in a local area network. Such time servers would slow down the clocks of some machines and speed up the clocks of others to bring them to the average network time. Group project, but make it clocks. π°οΈπ°οΈπ°οΈ
The adjtime() system call is restricted to the super-user. Root energy only, bestie. π
π RETURN VALUES π
The adjtime() function returns the value 0 if successful; otherwise, the value -1 is returned and the global variable errno is set to indicate the error. So 0 = slay, -1 = go read errno. π
π ERRORS π
The adjtime() system call will fail if:
[EFAULT]β An argument points outside the process's allocated address space. π«[EPERM]β The process's effective user ID is not that of the super-user. π«
π₯ SEE ALSO π₯
R. Gusella and S. Zatti, TSP: The Time Synchronization Protocol for UNIX 4.3BSD.
π HISTORY π
The adjtime() system call appeared in 4.3BSD. Old-school, but still iconic. π
Debian β’ May 13, 2021 β’ ADJTIME(2) β mwah, hope this helped bestie! ππ«Άβ¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 1980, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms