proc_ulong_conv(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

okay so this is a page from the Kernel API Manual, and it's all about proc_ulong_conv, which (spoiler) flips a pointer depending on which direction the data's flowing. it's giving traffic controller energy ngl 🚦


✨ NAME ✨

proc_ulong_conv β€” change user or kernel pointer based on direction πŸ¦‹


🌸 SYNOPSIS 🌸

int proc_ulong_conv (ulong *u_ptr , ulong *k_ptr , int dir , const
struct ctl_table *tbl , bool k_ptr_range_check , int
(*user_to_kern)(const ulong *u_ptr, ulong *k_ptr) , int
(*kern_to_user)(ulong *u_ptr, const ulong *k_ptr) );

like, look at all those parameters. she's high maintenance and we love that for her πŸ’…


🫢 ARGUMENTS 🫢

  • u_ptr β€” pointer to user variable πŸ’–
  • k_ptr β€” pointer to kernel variable πŸ‘‘
  • dir β€” TRUE if this is a write to the sysctl file ✍️ (yes literally, that's the whole vibe check)
  • tbl β€” the sysctl table πŸ“‹
  • k_ptr_range_check β€” check the range for k_ptr when TRUE πŸ” (so, only when it's TRUE, ok? don't skip that part)
  • user_to_kern β€” callback used to assign the value from the user var to the kernel var 🧚
  • kern_to_user β€” callback used to assign the value from the kernel var to the user var 🌈

πŸ”₯ DESCRIPTION πŸ”₯

so here's the tea β˜• β€” when the direction is kernel to user, then u_ptr gets modified. and when the direction is user to kernel, then k_ptr gets modified. that's it, that's the plot. short king of a description, fr fr πŸ’€


⭐ RETURN ⭐

  • 0 on success βœ… slay

πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group, no cap πŸ‘―β€β™€οΈ:


πŸ’€ lowkey reminder: if k_ptr_range_check is FALSE, that range check for k_ptr just… doesn't happen. that's the documented behaviour, bestie, i don't make the rules 🫢

k bye, this page lives in ./kernel, version vibes from October 2026, and it's filed under proc_ulong_conv(9) in case you need to find her again πŸŽ€βœ¨πŸ’œ

πŸ“¦ where this page comes from