input_handl..._each_handle(9)
π input_handler_for_each_handle β handle iterator
okay so this is a page from the Kernel API Manual, and bestie, it's literally about looping over handles. tiny function, big main character energy π
β¨ SYNOPSIS β¨
int input_handler_for_each_handle (struct input_handler *handler , void
*data , int (*fn)(struct input_handle *, void *) );
πΈ ARGUMENTS πΈ
handlerβ the input handler you're gonna iterate over, like the whole point of the operation πdataβ the data you're handing off to the callback, it just rides alongfnβ the function that gets called for each handle, one by one, no skips
π¦ DESCRIPTION π¦
So here's the vibe: you iterate over the bus's list of devices, and for each one you call fn, passing it data along for the ride. And you stop the second fn returns a non-zero value β like it's done, we're out, bye π
The function is using RCU to traverse the list, which means it may be used in atomic contexts. Slay for atomic contexts honestly.
β οΈ okay this part matters bestie: the fn callback is invoked from an RCU critical section, and so it must not sleep. like. at all. no cap. if your callback sleeps it's giving undefined disaster π
π SEE ALSO π
Kernel file ./drivers/input/input.c plus the whole friend group:
input_event(9)input_inject_event(9)input_alloc_absinfo(9)input_copy_abs(9)input_grab_device(9)input_release_device(9)input_open_device(9)input_close_device(9)input_scancode_to_scalar(9)input_default_setkeycode(9)input_get_keycode(9)input_set_keycode(9)input_reset_device(9)input_allocate_device(9)devm_input_allocate_device(9)input_free_device(9)input_set_timestamp(9)input_get_timestamp(9)input_set_capability(9)input_enable_softrepeat(9)input_register_device(9)input_unregister_device(9)input_register_handler(9)input_unregister_handler(9)input_register_handle(9)input_unregister_handle(9)input_get_new_minor(9)input_free_minor(9)
that's the whole page, you ate that π«Ά this came out of ./drivers/input and it's dated October 2026 β go forth and iterate responsibly, mwah πβ¨
π¦ 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