proc_get_long(9)
π proc_get_long(9) β the Kernel API Manual, but make it make sense π
okay so bestie, we're in the Kernel API Manual today and this page is literally about proc_get_long β a little function that reads an ASCII formatted integer out of a user buffer. it's giving "parser but make it kernel" β¨ iykyk.
πΈ NAME πΈ
proc_get_long β reads an ASCII formatted integer from a user buffer π
no cap, that's the whole vibe. it goes and gets you a long. from ASCII. out of a user buffer. slay.
β¨ SYNOPSIS β¨
int proc_get_long (char **buf , size_t *size , unsigned long *val , bool
*neg , const char *perm_tr , unsigned perm_tr_len , char *tr );
that's seven arguments bestie, count 'em, i'll wait π«Ά (it's seven.)
π¦ ARGUMENTS π¦
okay so here's the cast of characters, main character energy incoming π
bufβ a kernel buffer. that's the thing we're reading out of, periodt.sizeβ size of the kernel buffer. like how much room there is to look at π₯valβ this is where the number will be stored. the whole point of the function honestly, the icon, the moment πnegβ set toTRUEif number is negative. so if you see a little minus sign, this flag gets its glow-up πperm_trβ a vector which contains the allowed trailers. trailers as in trailing characters, not as in movie previews, keep up π¬perm_tr_lenβ size of theperm_trvector. every vector needs its length bestie, it's called β¨consistencyβ¨trβ pointer to store the trailer character. so the trailing character has somewhere to live π
π RETURN π
here's what you get back, no surprises, we keep it honest:
0on success β andbufandsizeare updated with the amount of bytes read. π also! iftris non-NULLand a trailing character exists (meaningsizeis non-zero after returning from this function), thentris updated with the trailing character π-EINVALon failure. rip. that's the "you gave me nonsense" error π
ngl, the size is non-zero after returning bit is the sneaky important part β that's how you know a trailer actually got captured, so don't skip the vibe check on it π
π SEE ALSO π
here's the whole friend group, the entire group chat, all linked from the kernel file ./kernel/sysctl.c π§ β like genuinely, this list ate and left no crumbs:
enum sysctl_writes_mode(9)proc_first_pos_non_zero_ignore(9)proc_dostring(9)strtoul_lenient(9)proc_put_long(9)proc_uint_u2k_conv_uop(9)proc_uint_k2u_conv(9)proc_uint_conv(9)proc_int_k2u_conv_kop(9)proc_int_u2k_conv_uop(9)proc_int_conv(9)proc_douintvec_conv(9)proc_dobool(9)proc_dointvec(9)proc_douintvec(9)proc_dointvec_minmax(9)proc_douintvec_minmax(9)proc_dou8vec_minmax(9)proc_ulong_conv(9)proc_ulong_u2k_conv_uop(9)proc_ulong_k2u_conv_kop(9)proc_doulongvec_conv(9)proc_doulongvec_minmax(9)proc_dointvec_conv(9)proc_do_large_bitmap(9)
like?? look at them all, highkey iconic ππ
and that's the page babes π β brought to you by the fine folks in ./kernel, dated October 2026, back when this doc was born. mwah π go read the source, i'm obsessed with you π¦
π¦ 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