STRUCT GPIO_V2_LINE_EVENT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct_gpio_v2_line_event(9) ✨

okay bestie, so we're in the Kernel API Manual today and the star of the show is struct gpio_v2_line_event(9) β€” like, this is a kernel manpage, yes, but it's that girl. buckle up πŸ’…


🌸 NAME 🌸

struct gpio_v2_line_event β€” literally the actual event that gets pushed to userspace. that's it, that's the whole vibe. it's the little packet of joy that shows up when a GPIO line does a thing πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

struct gpio_v2_line_event {
    __aligned_u64 timestamp_ns;
    __u32 id;
    __u32 offset;
    __u32 seqno;
    __u32 line_seqno;
    __u32 padding[6];
 };

look at her. impeccable. no notes. ✨


πŸŽ€ Members πŸŽ€

  • timestamp_ns β€” the best estimate of when the event actually happened, in nanoseconds. it's an estimate, not a promise, ok? she's doing her best 🫢
  • id β€” the event identifier, and its value comes from enum gpio_v2_line_event_id. iykyk
  • offset β€” the offset of the line that triggered the event. the main character of this particular event, fr.
  • seqno β€” the sequence number for this event within the sequence of events for all the lines in this line request. so like, the group chat's message count πŸ’¬
  • line_seqno β€” the sequence number for this event within the sequence of events on this particular line. so like, that one friend's personal message count. two different counters, both valid 🌈
  • padding β€” reserved for future use. don't touch. she's saving that space for later πŸ’€

πŸ’– Description πŸ’–

so by default, timestamp_ns is read from CLOCK_MONOTONIC, and the whole point is to let you accurately measure the time between events. it does not give you wall-clock time β€” like, it's not gonna tell you "it's 3pm", it's gonna tell you "this happened 400ns after that". don't @ me πŸ™ˆ

if the GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME flag is set, then timestamp_ns is read from CLOCK_REALTIME instead. different clock, different vibe ⭐

and if the GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE flag is set, then timestamp_ns is provided by the hardware timestamping engine (HTE) subsystem. hardware said "i got this" πŸ”₯


🌟 SEE ALSO 🌟

  • Kernel file ./include/uapi/linux/gpio.h struct gpiochip_info(9)
  • enum gpio_v2_line_flag(9)
  • struct gpio_v2_line_values(9)
  • enum gpio_v2_line_attr_id(9)
  • struct gpio_v2_line_attribute(9)
  • struct gpio_v2_line_config_attribute(9)
  • struct gpio_v2_line_config(9)
  • struct gpio_v2_line_request(9)
  • struct gpio_v2_line_info(9)
  • enum gpio_v2_line_changed_type(9)
  • struct gpio_v2_line_info_changed(9)
  • enum gpio_v2_line_event_id(9)
  • struct gpioline_info(9)
  • struct gpioline_info_changed(9)
  • struct gpiohandle_request(9)
  • struct gpiohandle_config(9)
  • struct gpiohandle_data(9)
  • struct gpioevent_request(9)
  • struct gpioevent_data(9)

the whole friend group, honestly. go say hi 🫢


and that's the page, bestie!! source is ./include/uapi/linux, dated October 2026, and it's filed under struct gpio_v2_line_event(9) β€” slay, periodt, go read your GPIO events πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from