ladybird/Userland/ps.cpp

21 lines
445 B
C++
Raw Normal View History

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