set_normalized_timespec64(9)
β¨ set_normalized_timespec64 β¨
okay so this is a page from the Kernel API Manual, bestie β set_normalized_timespec64(9) β and it's genuinely such a little icon. let's get into it π
πΈ NAME πΈ
set_normalized_timespec64 β sets the sec and nsec parts of a timespec and normalizes them. that's it, that's the whole vibe π
π¦ SYNOPSIS π¦
void set_normalized_timespec64(struct timespec64 *ts, time64_t sec, s64 nsec);
π ARGUMENTS π
tsβ pointer to the timespec variable you're setting, bestie. that's the thing getting the glow-up β¨secβ the seconds you wanna set it tonsecβ the nanoseconds you wanna set it to
π₯ DESCRIPTION π₯
So what it does: it sets the <italic>seconds</italic> and <italic>nanoseconds</italic> fields of a timespec variable, then normalizes the whole thing into the timespec storage format. like, it takes your raw numbers and makes them presentable. main character energy fr fr π
β NOTE β
Listen up, this part is important π thetv_nsecpart is always in the range of0 <= tv_nsec < NSEC_PER_SEC. and for negative values, only thetv_secfield is negative! not both. just the one. ik ik, iconic behaviour π
π SEE ALSO π
Kernel file ./kernel/time/time.c β and a whole friend group of related calls, no cap:
jiffies_to_msecs(9)jiffies_to_usecs(9)mktime64(9)ns_to_timespec64(9)__msecs_to_jiffies(9)__usecs_to_jiffies(9)timespec64_to_jiffies(9)jiffies_to_timespec64(9)jiffies_to_clock_t(9)clock_t_to_jiffies(9)jiffies_64_to_clock_t(9)nsec_to_clock_t(9)jiffies64_to_nsecs(9)jiffies64_to_msecs(9)nsecs_to_jiffies64(9)nsecs_to_jiffies(9)timespec64_add_safe(9)get_timespec64(9)put_timespec64(9)get_old_timespec32(9)put_old_timespec32(9)get_itimerspec64(9)put_itimerspec64(9)get_old_itimerspec32(9)put_old_itimerspec32(9)
okay that's the whole page, you ate that π«Ά this one lives in ./kernel/time and the version/date sitch is October 2026 β so like, go set some normalized timespecs, bestie, and remember: only tv_sec gets to be negative. periodt ππΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms