mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 00:35:06 +00:00

I added a dead-simple malloc that only allows allocations < 4096 bytes. It just forwards the request to mmap() every time. I also added simplified versions of opendir() and readdir().
17 lines
311 B
C++
17 lines
311 B
C++
#include <LibC/stdio.h>
|
|
#include <LibC/unistd.h>
|
|
#include <LibC/dirent.h>
|
|
|
|
int main(int c, char** v)
|
|
{
|
|
DIR* dirp = opendir("/");
|
|
if (!dirp) {
|
|
printf("opendir failed :(\n");
|
|
return 1;
|
|
}
|
|
while (auto* de = readdir(dirp)) {
|
|
printf("%s\n", de->d_name);
|
|
|
|
}
|
|
return 0;
|
|
}
|