v4l2_s_ctrl(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– v4l2_s_ctrl(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” this is the page for v4l2_s_ctrl, and it is literally the helper function that holds down the VIDIOC_S_CTRL ioctl for you 🫢 it's a small one, but it's a real one, so let's get into it.


✨ NAME ✨

v4l2_s_ctrl β€” the helper function that implements the :ref:VIDIOC_S_CTRL <vidioc_g_ctrl> ioctl πŸ’…

it's giving "little function, big responsibilities" fr fr.


🌸 SYNOPSIS 🌸

int v4l2_s_ctrl (struct v4l2_fh *fh , struct v4l2_ctrl_handler *hdl ,
       struct v4l2_control *ctrl );

look at that signature. three pointers. one int coming back at you. iconic πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • fh β€” pointer to struct v4l2_fh ✨
  • hdl β€” pointer to struct v4l2_ctrl_handler πŸ’œ
  • ctrl β€” pointer to struct v4l2_control πŸ¦‹

three structs walk into a function, no cap.


πŸ’… DESCRIPTION πŸ’…

okay so here's the whole entire vibe of this function, and I need you to hear me out:

If hdl == NULL then they will all return -EINVAL.

that's it. that's the description. periodt. πŸŽ€ if that handler pointer is NULL, every single one of them comes back with -EINVAL β€” no ✨ results ✨, no πŸ¦‹ magic πŸ¦‹, just a very polite "nope, invalid argument" 😭


πŸ¦‹ SEE ALSO πŸ¦‹

this is the part where the page absolutely ate β€” look at this whole friend group. the kernel file is ./include/media/v4l2-ctrls.h, and the squad is:

seventy-six whole cross-references, bestie. seventy-six. iykyk 🌈


full transparency: this is the entire page. no caveats, no bugs section, no RETURN VALUE section, nada. it's a short king and we respect it πŸ’€πŸ’–

and that's the whole thing, bestie! this little page came from ./include/media and it's dated October 2026 β€” so yeah, mark your calendar, and go set some controls πŸŽ€βœ¨πŸ¦‹ slay.

πŸ“¦ where this page comes from