proc_dointvec_minmax(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

hey bestie, welcome to proc_dointvec_minmax(9) from the Kernel API Manual ✨ this page is literally about reading a vector of integers with min/max values, and she is iconic β€” no cap πŸ’…

🌸 NAME 🌸

proc_dointvec_minmax β€” read a vector of integers with min/max values πŸ’–

✨ SYNOPSIS ✨

int proc_dointvec_minmax (const struct ctl_table *table , int dir , void *buffer , size_t *lenp , loff_t *ppos );

πŸŽ€ ARGUMENTS πŸŽ€

  • table β€” the sysctl table, your main character struct 🫢
  • dir β€” TRUE if this is a write to the sysctl file, iykyk βœ…
  • buffer β€” the user buffer, where the data hangs out πŸ’…
  • lenp β€” the size of the user buffer, keep an eye on her πŸ‘€
  • ppos β€” file position, the little bookmark πŸ“Œ

πŸ’– DESCRIPTION πŸ’–

Okay so this routine reads/writes up to table->maxlen/sizeof(unsigned int) integer values from/to the user buffer, and the buffer is treated as an ASCII string. The way that formula is just sitting there being all slash-y? Obsessed, periodt.

She also does a vibe check on the values: this routine will ensure the values are within the range specified by table->extra1 (min) and table->extra2 (max). Min is table->extra1, max is table->extra2, fr fr.

πŸ”₯ RETURN πŸ”₯

  • 0 on success πŸŽ‰
  • -EINVAL when the range check fails and SYSCTL_USER_TO_KERN(dir) == true πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

Peep the kernel file ./kernel/sysctl.c and enum sysctl_writes_mode(9), then the rest of the crew:

xoxo, this page came from the ./kernel source/version, dated October 2026, and it’s the proc_dointvec_minmax(9) manual page β€” slay πŸ’…βœ¨

πŸ“¦ where this page comes from