EVIOCSMASK(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ EVIOCSMASK ✨

okay so real talk, this is the EVIOCSMASK page from the Kernel API Manual, and it's lowkey one of those little ioctls that eats πŸ’…


🌸 NAME 🌸

EVIOCSMASK β€” Set event mask πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

EVIOCSMASK

that's it bestie, that's the whole vibe ✨


πŸ’– DESCRIPTION πŸ’–

okay so EVIOCSMASK is literally the counterpart to EVIOCGMASK β€” like, they're giving sibling energy fr fr πŸ‘― Instead of receiving the current event mask, this one changes the client's event mask for a specific type. and if you wanna know what an event-mask even is, or what the argument-type looks like, go read EVIOCGMASK's description, she explains all of it 🫢

this ioctl provides full forward compatibility, which is iconic of it actually πŸ‘‘ here's the tea:

  • if the event type you passed is unknown to the kernel, or if the number of event codes specified in the mask is bigger than what the kernel knows about, the ioctl is still accepted and applied. no drama, no rejection, she just goes with it ✨
  • however, any unknown codes are left untouched and stay cleared 🧹 which means the kernel always filters unknown codes regardless of what the client requests. periodt, no cap, that's just how it is πŸ’€
  • and if the new mask doesn't cover all known event-codes, all the remaining codes are automatically cleared and thus filtered. bye bye πŸ‘‹

😭 when it fails

okay so sometimes things don't slay, and this ioctl may fail in these ways:

  • ENODEV β€” in case the file is revoked πŸ™ˆ
  • EFAULT β€” returned if the receive-buffer points to invalid memory πŸ’€
  • EINVAL β€” returned if the kernel does not implement the ioctl 😭

πŸ’œ SEE ALSO πŸ’œ

go check these out, they're all besties of this page:

  • Kernel file ./include/uapi/linux/input.h
  • struct input_absinfo(9)
  • struct input_keymap_entry(9)
  • EVIOCGMTSLOTS(9)
  • EVIOCGMASK(9)
  • struct ff_replay(9)
  • struct ff_trigger(9)
  • struct ff_envelope(9)
  • struct ff_constant_effect(9)
  • struct ff_ramp_effect(9)
  • struct ff_condition_effect(9)
  • struct ff_periodic_effect(9)
  • struct ff_rumble_effect(9)
  • struct ff_haptic_effect(9)
  • struct ff_effect(9)

and that's the whole page bestie πŸ“ this lil legend lives at ./include/uapi/linux, dated October 2026, and yeah, it's EVIOCSMASK(9) β€” mwah, stan her, bye πŸ’‹πŸ’–

πŸ“¦ where this page comes from