get_old_timespec32(9)
π get_old_timespec32 π
okay so bestie, welcome to the Kernel API Manual β yes that's the manual name, we're in the kernel docs section, put your seatbelt on π
This one is a tiny little function with a very specific job and honestly it's giving "quiet kid in the back of the class who's actually a genius." Let's get into it.
β¨ NAME β¨
get_old_timespec32 β the way to pull a user's old-format time value into kernel space. literally just that. no cap. π
πΈ SYNOPSIS πΈ
int get_old_timespec32 (struct timespec64 *ts , const void __user *uts );
That's the whole flex. Two args, one int coming back at you. π
π¦ ARGUMENTS π¦
tsβ the destinationstruct timespec64. this is where the good stuff lands, it's the main character of the operation β¨utsβ the user's old-format time value, and it's astruct old_timespec32. note the__useron the pointer type β yeah, that one. treat it with respect π
π§ DESCRIPTION π§
So what does it actually do? It handles the X86_X32_ABI compatibility conversion. that's it. that's the whole description. iconic brevity honestly π
Translation for the besties: you've got an old-format time value sitting over in user space, and you need it in kernel space in the new-format struct timespec64 shape. This is the little compatibility bridge that makes that happen on X86_X32_ABI. fr fr, it's a converter. π«Ά
β RETURN β
0on success π- a negative
errnoon error π
that's it, that's the contract. check your return value, bestie, always π
π SEE ALSO π
Up next on the playlist, we got the whole Kernel file ./kernel/time/time.c crew, and here's the full lineup β no skips, no shuffling, we're listening to the whole album π
jiffies_to_msecs(9)jiffies_to_usecs(9)mktime64(9)set_normalized_timespec64(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)put_old_timespec32(9)get_itimerspec64(9)put_itimerspec64(9)get_old_itimerspec32(9)put_old_itimerspec32(9)
yeah that's twenty-five of them. not me counting. i counted. π
also peep put_old_timespec32(9) down there β that's this function's sibling, the reverse direction. cute lil family π
and that's the page!! π
shoutout to the source β this one lives under ./kernel/time β and it's dated October 2026, so mark your calendars bestie π
β¨ go forth and convert your timestamps responsibly, ily, bye ππ¦π
π¦ 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