RESETTODR(9)

✨ RESETTODR(9) ✨

okay bestie, this is a page from the Kernel Developer's Manual and it's literally about the clock. yes, THE clock. the one that keeps ticking even when your laptop's like "ma'am I have no power". let's get into it πŸ’…


πŸŽ€ NAME πŸŽ€

resettodr β€” set the battery-backed clock from system time

like, it writes the current system time into the little battery-powered clock so it doesn't forget who it is. periodt ⏰


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <sys/types.h>
#include <sys/systm.h>

void
resettodr(void);

no arguments, no return value, just vibes. she takes nothing and gives nothing back (in the return-value sense, anyway 🫢).


🌸 DESCRIPTION 🌸

The resettodr() function sets the system's battery-backed clock based on the contents of the system time variable.

that's it. that's the whole thing. she reads the system time, she writes it to the battery-backed clock, and the clock stays in the loop. no cap. πŸ”₯


πŸ’– SEE ALSO πŸ’–

go read those too, they're the rest of the clock lore iykyk πŸ‘‘


πŸ’€ BUGS πŸ’€

ok so this is the part where we keep it real:

On many systems, resettodr() has to convert from time to a time expressed in terms of year, month, day, hours, minutes, and seconds.

Many of the implementations could share code, but do not.

read that again. they could share code. they do not. iconic behavior honestly 😭 every implementation is out here reinventing the calendar conversion from scratch like it's their first day. no sharing, no teamwork, just main character energy in every single driver. we love that for them (we do not love that for them).


and that's the whole page bestie!! this one's from Debian, dated November 13, 1995 β€” yes it's older than you, and it's still out here converting months by hand. respect the elders πŸ™ˆπŸ’œ RESETTODR(9) forever βœ¨πŸŽ€

πŸ“¦ where this page comes from