ark::kmsg::KmsgReader

Defined in header “ark/kmsg/kmsg_reader.hh”.


This class is responsible for attaching to /dev/kmsg and processing incoming messages.

Methods

  • KmsgReader(const std::filesystem::path & path)
    Constructor. Initializes against the given kernel message buffer (generally at /dev/kmsg).

  • KmsgReader(const KmsgReader & other)
    Disable copy constructors/assignment.

  • KmsgReader & operator=(const KmsgReader & other)

  • ~KmsgReader()
    Destructor. Cleans up.

  • std::optional< KmsgStatement > read()
    Reads the next record from the kernel message buffer. If no more messages are available, return an empty optional.

  • bool wait(std::chrono::nanoseconds duration)
    Waits for data to be available in the buffer. Returns true/false depending on if data is present or not.