2019-01-28 22:40:55 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
#include <assert.h>
|
2019-06-02 12:13:06 +02:00
|
|
|
#include <LibCore/CFile.h>
|
2019-01-28 22:40:55 +01:00
|
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
|
{
|
|
|
|
|
(void) argc;
|
|
|
|
|
(void) argv;
|
2019-06-02 12:13:06 +02:00
|
|
|
CFile f("/proc/dmesg");
|
|
|
|
|
if (!f.open(CIODevice::ReadOnly)) {
|
|
|
|
|
fprintf(stderr, "open: failed to open /proc/dmesg: %s", f.error_string());
|
2019-01-28 22:40:55 +01:00
|
|
|
return 1;
|
|
|
|
|
}
|
2019-06-02 12:13:06 +02:00
|
|
|
const auto& b = f.read_all();
|
|
|
|
|
for (auto i = 0; i < b.size(); ++i)
|
|
|
|
|
putchar(b[i]);
|
2019-01-28 22:40:55 +01:00
|
|
|
return 0;
|
|
|
|
|
}
|