cgroup_parse_float(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cgroup_parse_float β€” Kernel API Manual, bestie edition πŸŽ€

okay so real talk, this is a page from the Kernel API Manual for cgroup_parse_float(9), and honestly? it's a little icon and it deserves its flowers. it does exactly one thing and it does it flawlessly. main character energy fr fr.


✨ NAME ✨

cgroup_parse_float β€” parse a floating number πŸ‘‘

lowkey the humblest name for a function that eats decimals for breakfast.


🌸 SYNOPSIS 🌸

int cgroup_parse_float (const char *input , unsigned dec_shift , s64 *v );

three args, one int coming back at you. no cap, that's the whole vibe.


πŸ¦‹ ARGUMENTS πŸ¦‹

  • input β€” the input string, aka the little text gremlin you're feeding in πŸ“
  • dec_shift β€” number of decimal digits to shift. yes, that many. you decide πŸ’«
  • v β€” output. this is where the answer goes to live its best life ✨

πŸ’– DESCRIPTION πŸ’–

so here's the tea: it parses a decimal floating point number in input and stores the result in v with the decimal point right shifted dec_shift times. that's it. that's the gig.

like, for example β€” if input is "12.3456" and dec_shift is 3, then *v will be set to 12345. see? the decimal point just scooted over. iconic behavior, honestly. 🩰

it returns 0 on success, -errno otherwise. slay. that's the entire contract.

and the funniest part? there's nothing cgroup specific about this function β€” like, at all β€” except that it's currently the only user. it's a floater living in the cgroup house rent-free πŸ’€. we love a squatter with range.

bestie note: this is a -errno return situation, so a negative number is code for "something went wrong", not a result. don't get it twisted πŸ™ˆ

🧚 SEE ALSO 🧚

kernel file ./kernel/cgroup/cgroup.c, and literally the whole friend group:

like I said β€” the whole group chat πŸ’œ


and that's the page!! mwah πŸ’‹ this little section (./kernel/cgroup version, dated October 2026, manual cgroup_parse_float(9)) is out β€” go shift some decimals and be gorgeous about it πŸ’…βœ¨πŸ«Ά

πŸ“¦ where this page comes from