RESETTODR(9)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, welcome to the RESETTODR(9) page from the Kernel Developer's Manual β€” this one is about resettodr, and it's literally the function that sets the battery-backed clock from system time. 🫢


✨ SYNOPSIS ✨

First, the includes β€” do not skip these, bestie:

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

void
resettodr(void);

That's the whole signature: void resettodr(void); β€” no args, no return value, just a clock-setting moment. πŸ’…


🌸 DESCRIPTION 🌸

The resettodr() function sets the system's battery-backed clock based on the contents of the system time variable. That's it β€” it takes what's in the system time variable and uses it to set the battery-backed clock. ⭐


πŸ¦‹ SEE ALSO πŸ¦‹

iykyk, go peek at those when you're done here. 🫢


πŸ’€ BUGS πŸ’€

Okay, slight yikes: 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. Not them having duplicate code and refusing to share 😭 β€” it's literally called out here.


xoxo, Debian Β· November 13, 1995 πŸŽ€

πŸ“¦ where this page comes from