mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +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().
18 lines
311 B
C++
18 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;
|
|
}
|