event_read(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ event_read(9) β€” Kernel API Manual ✨

Okay bestie, this is the event_read(9) glow-up from the Kernel API Manual β€” the callback that passes event data to userspace via read(). It's giving kernel-core, no cap. πŸ’–


πŸŽ€ NAME πŸŽ€

event_read β€” Callback for passing event data to userspace via read().


πŸ¦‹ SYNOPSIS πŸ¦‹

ssize_t event_read (struct file *filp , char __user *buf , size_t count
, loff_t *pos );

🌸 ARGUMENTS 🌸

  • filp β€” The file we are reading from. Main-character file energy, honestly.
  • buf β€” Pointer to userspace buffer to fill with one event. One event, slay.
  • count β€” Number of bytes requested. Must be at least EC_ACPI_MAX_EVENT_SIZE. Not a suggestion, bestie.
  • pos β€” File position pointer, irrelevant since we don't support seeking. It's lowkey just vibing there.

πŸ’… DESCRIPTION πŸ’…

So the way this works is: it removes the first event from the queue, and places it in the passed buffer. Periodt. ✨

If there are no events in the queue, then one of two things happens, depending on if the file was opened in nonblocking mode:

  • If in nonblocking mode, then return -EAGAIN to say there's no data. No data, no drama. πŸ’€
  • If in blocking mode, then block until an event is available. It will literally wait for an event to show up. 🫢

πŸ”₯ RETURN πŸ”₯

Number of bytes placed in buffer, negative error code on failure. That's the vibe check, and that's the whole return story.


🫢 SEE ALSO 🫢


Cute sign-off time: this page is from the source/version string ./drivers/platform/chrome/wilc..., dated October 2026, and it's still event_read(9) β€” bye bestie, read responsibly πŸ’œ

πŸ“¦ where this page comes from