v4l2_g_ctrl(9)
π v4l2_g_ctrl (kernel API manual, bestie edition)
okay so this is a page from the Kernel API Manual β yes the man page name is literally v4l2_g_ctrl(9), we love a self-titled icon β¨ β and it's about one tiny helper function that does a very specific job. she's small, she's focused, she's giving "I only do one thing but I do it correctly" energy π
πΈ NAME πΈ
v4l2_g_ctrl β the helper function you use to implement the :ref:VIDIOC_G_CTRL <vidioc_g_ctrl>`` ioctl π«
like, that's her whole personality. that's the job. she's the glue between your driver and the userspace control-getting ioctl, no cap π«Ά
β¨ SYNOPSIS β¨
int v4l2_g_ctrl (struct v4l2_ctrl_handler *hdl , struct v4l2_control
*ctrl );
literally two pointers in, one int out. the signature is exactly that, spacing and line break and all β I did not touch it, I would never π
π¦ ARGUMENTS π¦
hdlβ a pointer tostruct v4l2_ctrl_handler. yes, the handler. the control handler. the main character of the control subsystem, honestly πctrlβ a pointer tostruct v4l2_control. this is the control struct itself, the thing that's gonna get its info read π
π DESCRIPTION π
okay so here's the entire described behaviour, and I need you to sit with it because it's short and it's important:
ifhdl == NULLthen they will all return-EINVAL.
that's it. that's the description. no cap, the whole documented description is that NULL check π so if you pass a NULL handler, expect -EINVAL coming right back at you. that's the deal. that's the contract. respect it π
(also notice the word "they" β the original says they will all return, which is doing a little hinting that this is one of a family of sibling helpers. cute. noted. anyway.)
π SEE ALSO π
bestie. bestie. sit down. this list is long and I am not skipping a single one of them, because every single entry is part of the page and I would never do you dirty like that π so here we go, in the original order, all of them, plus the kernel file:
- Kernel file
./include/media/v4l2-ctrls.h - union
v4l2_ctrl_ptr(9) v4l2_ctrl_ptr_create(9)- struct
v4l2_ctrl_ops(9) - struct
v4l2_ctrl_type_ops(9) v4l2_ctrl_notify_fnc(9)- struct
v4l2_ctrl(9) - struct
v4l2_ctrl_ref(9) - struct
v4l2_ctrl_handler(9) - struct
v4l2_ctrl_config(9) v4l2_ctrl_fill(9)v4l2_ctrl_handler_init_class(9)v4l2_ctrl_handler_init(9)v4l2_ctrl_handler_free(9)v4l2_ctrl_lock(9)v4l2_ctrl_unlock(9)__v4l2_ctrl_handler_setup(9)v4l2_ctrl_handler_setup(9)v4l2_ctrl_handler_log_status(9)v4l2_ctrl_new_custom(9)v4l2_ctrl_new_std(9)v4l2_ctrl_new_std_menu(9)v4l2_ctrl_new_std_menu_items(9)v4l2_ctrl_new_std_compound(9)v4l2_ctrl_new_int_menu(9)v4l2_ctrl_filter(9)v4l2_ctrl_add_handler(9)v4l2_ctrl_radio_filter(9)v4l2_ctrl_cluster(9)v4l2_ctrl_auto_cluster(9)v4l2_ctrl_find(9)v4l2_ctrl_activate(9)__v4l2_ctrl_grab(9)v4l2_ctrl_grab(9)__v4l2_ctrl_modify_range(9)v4l2_ctrl_modify_range(9)__v4l2_ctrl_modify_dimensions(9)v4l2_ctrl_modify_dimensions(9)v4l2_ctrl_notify(9)v4l2_ctrl_get_name(9)v4l2_ctrl_get_menu(9)v4l2_ctrl_get_int_menu(9)v4l2_ctrl_g_ctrl(9)__v4l2_ctrl_s_ctrl(9)v4l2_ctrl_s_ctrl(9)v4l2_ctrl_g_ctrl_int64(9)__v4l2_ctrl_s_ctrl_int64(9)v4l2_ctrl_s_ctrl_int64(9)__v4l2_ctrl_s_ctrl_string(9)v4l2_ctrl_s_ctrl_string(9)__v4l2_ctrl_s_ctrl_compound(9)v4l2_ctrl_s_ctrl_compound(9)v4l2_ctrl_replace(9)v4l2_ctrl_merge(9)v4l2_ctrl_log_status(9)v4l2_ctrl_subscribe_event(9)v4l2_ctrl_poll(9)v4l2_ctrl_request_setup(9)v4l2_ctrl_request_complete(9)v4l2_ctrl_request_hdl_find(9)v4l2_ctrl_request_hdl_put(9)v4l2_ctrl_request_hdl_ctrl_find(9)v4l2_queryctrl(9)v4l2_query_ext_ctrl_to_v4l2_queryctrl(9)v4l2_query_ext_ctrl(9)v4l2_querymenu(9)v4l2_s_ctrl(9)v4l2_g_ext_ctrls(9)v4l2_try_ext_ctrls(9)v4l2_s_ext_ctrls(9)v4l2_ctrl_subdev_subscribe_event(9)v4l2_ctrl_subdev_log_status(9)v4l2_ctrl_new_fwnode_properties(9)v4l2_ctrl_type_op_equal(9)v4l2_ctrl_type_op_init(9)v4l2_ctrl_type_op_log(9)v4l2_ctrl_type_op_validate(9)
like I said. long list. every one of them made it, none got left at the club π«Άπ
π cute sign-off π
this little love letter to the control subsystem lives under the ./include/media source, dated October 2026, and it goes by v4l2_g_ctrl(9) β same name up top, same name down here, consistent queen behavior πβ¨ that's the whole page bestie, go read v4l2_ctrls.h and slay π₯
π¦ 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