Files
uutil-linux/src
Goffredo Baroncelli 98ef2d7f82 dmesg: add support of reading from /dev/kmesg
In order to properly read from /dev/kmsg, we need [*]:
1) open /dev/kmsg with O_NONBLOCK
2) handle the EAGAIN/WouldBlock error as end of records
3) treat '\n' (and not '\0') as record separator.
4) do lseek(fd, 0, SEEK_DATA)

Because Windows doesn't support O_NONBLOCK and SEEK_DATA, we had protect
these code with #[cfg(not(target_os = "windows"))]. Moreover because
Windows doesn't have /dev/kmsg, it is mandatory to use the '-K' switch.

[*] https://www.kernel.org/doc/Documentation/ABI/testing/dev-kmsg
2025-01-03 11:20:02 +01:00
..
2024-01-26 19:09:54 +01:00