wire / wire-format / eventfd-counter

eventfd 8-byte counter

An eventfd file descriptor holds a 64-bit counter. read(2) returns the counter (and resets it to 0 unless EFD_SEMAPHORE); write(2) adds to it; poll(2) signals readability when the counter is nonzero. The on-the-wire representation is just the 8-byte little-endian counter value.

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: eventfd 8-byte counter

wire format

spec: Linux kernel (eventfd)

An eventfd file descriptor holds a 64-bit counter. read(2) returns the counter (and resets it to 0 unless EFD_SEMAPHORE); write(2) adds to it; poll(2) signals readability when the counter is nonzero. The on-the-wire representation is just the 8-byte little-endian counter value.

fieldsizemeaning
counter8 bytes (__u64)The counter value (little-endian). read returns this and resets to 0 (or decrements by 1 with EFD_SEMAPHORE). write adds the written value to the counter.

example:

00 00 00 00 00 00 00 00

eventfd counter = 0 (not readable)


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/eventfd-counter or /wire-format/eventfd-counter.json