UI_ABS_SETUP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 UI_ABS_SETUP β€” the kernel API manual, but make it make sense 🌸

okay so bestie, welcome to the Kernel API Manual page for UI_ABS_SETUP πŸ’… this one's a kernel-level ioctl situation, so grab your iced coffee and let's get into it ✨


✨ NAME ✨

UI_ABS_SETUP β€” literally just: set absolute axis information for the device you're about to set up πŸŽ€


✨ SYNOPSIS ✨

UI_ABS_SETUP

that's it. that's the whole synopsis. iconic, honestly πŸ‘‘


✨ DESCRIPTION ✨

okay so this ioctl sets one absolute axis information for the input device that's about to be created πŸ¦‹ it supersedes the old struct uinput_user_dev method β€” you know, the ancient one that wrote part of this data plus the content of UI_DEV_SETUP via write. we've moved on, we're thriving 🌈

The ioctl takes a struct uinput_abs_setup object as its argument, no cap. The fields of that object are:

  • code β€” the corresponding input code associated with this axis (ABS_X, ABS_Y, etc...) πŸ‘€
  • absinfo β€” see struct input_absinfo for the description of this field. This field gets copied unchanged into the kernel for the specified axis, fr fr. And here's the slay part: if the axis isn't enabled via UI_SET_ABSBIT, this ioctl will enable it for you πŸ’–

This ioctl can be called multiple times and it will just overwrite previous values. no drama, no hard feelings 🌸

⚠️ if this ioctl fails with -EINVAL, it's recommended that you use the old uinput_user_dev method via write as a fallback β€” that's for when you're running on an old kernel that doesn't support this ioctl. backwards compatibility queen 🫢

And now the error vibes, because we respect them:

  • -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 πŸ’€
⚠️ big one: if this call fails, partial data may have already been applied to the internal device. so like... not a clean rollback. be aware, bestie.

✨ SEE ALSO ✨


and that's the page!! 🧚 from the kernel files at ./include/uapi/linux, dated October 2026 β€” go forth and set those absolute axes, you absolute main character πŸŽ€βœ¨πŸ’œ

πŸ“¦ where this page comes from