viortc_read_cross(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… viortc_read_cross β€” like, the manual page for it (Kernel API Manual, bestie)

okay so welcome to viortc_read_cross(9), a page from the Kernel API Manual ✨ and honestly? it's a little guy. a tiny wrapper. but it's an important tiny wrapper, so let's get into it 🫢


🌸 NAME 🌸

viortc_read_cross β€” the VIRTIO_RTC_REQ_READ_CROSS wrapper. that's it, that's the whole vibe. it wraps the request. it's giving middleman but make it iconic πŸ’…


✨ SYNOPSIS ✨

int viortc_read_cross (struct viortc_dev *viortc , u16 vio_clk_id , u8
hw_counter , u64 *reading , u64 *cycles );

like yes she takes five arguments and returns an int, no cap. the line breaks are a little chaotic but we respect her πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

so here's who's who in the group chat:

  • viortc β€” the device data. this is the main character, the device itself πŸ’–
  • vio_clk_id β€” the virtio_rtc clock id (type u16). which clock are we talking about, bestie? this tells you πŸ”₯
  • hw_counter β€” the virtio_rtc HW counter type (type u8). specifying the hardware counter flavor 🌈
  • reading β€” the clock reading, measured in [ns]. it's a u64 *, so yes, pointer, so yes, she writes into it πŸ’«
  • cycles β€” the HW counter cycles during the clock reading. also a u64 *. also gets written into. both of them, lowkey, get filled in πŸ“

🧚 CONTEXT 🧚

Process context. that's the whole section. process context, periodt. so like, don't be calling this from some weird atomic place, iykyk 😭


⭐ RETURN ⭐

Zero on success πŸ’š β€” and a negative error code otherwise πŸ’€. classic. no surprises, no drama, we love a predictable return value πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯

okay this list is LONG and honestly it ate. buckle up bestie, we're going through the whole friend group:

the kernel file ./drivers/virtio/virtio_rtc_driver.c plus:

see? told you. the whole squad 🫢


ngl if you're here it's probably because something with VIRTIO_RTC_REQ_READ_CROSS is doing bits and you need to know what the wrapper promises. it promises zero or negative. that's the contract. slay ✨

and that's the page!! brought to you by the source ./drivers/virtio, dated October 2026, and known to all her friends as viortc_read_cross(9) πŸ’œ mwah, go read some virtio code bestie πŸŽ€

πŸ“¦ where this page comes from