UI_DEV_SETUP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ UI_DEV_SETUP ✨

okay so bestie, we're in the Kernel API Manual (section 9, the kernel-functions girlypop section πŸ’…) and today's main character is UI_DEV_SETUP β€” the ioctl that sets up your input device's parameters before it exists. yes, before. it's giving "manifesting" ✨


🌸 SYNOPSIS 🌸

UI_DEV_SETUP

that's it. that's the whole vibe. no cap.


πŸŽ€ DESCRIPTION πŸŽ€

so this ioctl sets the parameters for the input device you're about to create 🫢. it supersedes the old "struct uinput_user_dev" method β€” you know, the one that wrote this data via write. retiring an icon tbh πŸ’€. but heads up: if you actually wanna set the absolute axes, you use UI_ABS_SETUP for that, not this one. iykyk.

The ioctl takes a "struct uinput_setup" object as its argument, and the fields of that object are, like, super important:

  • id β€” see the description of "struct input_id". this field is copied unchanged into the new device. literally a copy-paste moment ✨
  • name β€” this is used unchanged as the name for the new device. iconic name stays iconic πŸŽ€
  • ff_effects_max β€” this limits the max number of force-feedback effects. check below for the description of FF with uinput πŸ‘‘

ngl this is the flexible one: this ioctl can be called multiple times and it will overwrite previous values πŸ”₯. so if you fumbled the first call, no biggie, just run it again bestie.

⚠️ okay real talk β€” if this ioctl fails with -EINVAL, it's recommended that you use the old "uinput_user_dev" method via write as a fallback, just in case you're running on an old kernel that doesn't support this ioctl. think of it as the group-chat backup plan πŸ’–

now the failure modes, because we respect the lore:

  • -EINVAL β€” if it's not supported, or if you passed incorrect values πŸ™ˆ
  • -ENOMEM β€” if the kernel runs out of memory 😭
  • -EFAULT β€” if the passed uinput_setup object cannot be read/written πŸ’€
and the spicy warning: if this call fails, partial data may have already been applied to the internal device. so like... it's not a clean undo. be careful, bestie 🫢

πŸ¦‹ SEE ALSO πŸ¦‹

go read them, they're all slaying in their own way πŸ‘‘


and that's the page!! 🌈 this lil gem lives under ./include/uapi/linux and it's dated October 2026, so screenshot it and send it to the group chat πŸ’Œ periodt. 🧚

πŸ“¦ where this page comes from