UI_DEV_SETUP(9)
β¨ 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 viawriteas 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 passeduinput_setupobject 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 π¦
- the kernel file
./include/uapi/linux/uinput.h UI_ABS_SETUP(9)UI_GET_SYSNAME(9)UI_GET_VERSION(9)
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
- 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