input_handl..._each_handle(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 along
  • fn β€” 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:


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