EVIOCGMASK(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ EVIOCGMASK ✨

okay so real talk, this is page EVIOCGMASK(9) from the Kernel API Manual, and bestie, it's literally about grabbing the current event mask. that's the whole vibe. let's get into it πŸ’…


🌸 NAME 🌸

EVIOCGMASK β€” Retrieve current event mask


πŸŽ€ SYNOPSIS πŸŽ€

EVIOCGMASK

πŸ¦‹ DESCRIPTION πŸ¦‹

so this ioctl lets you (the user) retrieve the current event mask for a specific event type. she's nosy but in a productive way πŸ’–

the argument must be of type struct input_mask and it specifies three things, periodt:

  • the event type to query
  • the address of the receive buffer
  • the size of the receive buffer

now, what even is the event mask? it's a per-client mask that specifies which events get forwarded to the client. each event code is represented by a single bit in the event mask. if the bit is set, the event is passed to the client normally. otherwise? the event is filtered and will never be queued on the client's receive buffer. not ever. not once. she's blocked πŸ’€

important tho β€” event masks do not affect the global state of the input device. they only affect the file descriptor they're applied to. so like, it's a you thing, not a everyone thing 🫢

the default event mask for a client has all bits set, i.e. all events are forwarded to the client. icon behavior, honestly πŸ‘‘

and here's the edge case, pay attention: if the kernel is queried for an unknown event type, or if the receive buffer is larger than the number of event codes known to the kernel, the kernel returns all zeroes for those codes. zeroes. nothing. empty. 😭

at maximum, codes_size bytes are copied.

⚠️ this ioctl may fail with ENODEV in case the file is revoked, EFAULT if the receive-buffer points to invalid memory, or EINVAL if the kernel does not implement the ioctl. so like... know the errors, bestie, they will find you πŸ™ˆ

🌈 SEE ALSO 🌈

  • Kernel file ./include/uapi/linux/input.h
  • struct input_absinfo(9)
  • struct input_keymap_entry(9)
  • EVIOCGMTSLOTS(9)
  • EVIOCSMASK(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)

okay that's the whole page!! this one lives under ./include/uapi/linux and it's dated October 2026 β€” so like, mark your calendars, mwah πŸ’‹βœ¨ see u in the next manpage bestie πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from