Files
rosetta/lib/libc/io/unistd/getdents.c

23 lines
464 B
C
Raw Normal View History

2026-03-24 12:42:39 +00:00
#include <errno.h>
#include <mango/handle.h>
#include <mango/msg.h>
#include <rosetta/fs.h>
#include <sys/remote.h>
#include <sys/types.h>
int getdents(int fd, struct dentry *dirp, unsigned int count)
{
int err;
size_t nr_read = 0;
kern_status_t status = fs_getdents(fd, &err, dirp, count, &nr_read);
if (status != KERN_OK) {
return __set_errno(__errno_from_kern_status(status));
}
if (err != SUCCESS) {
return __set_errno(err);
}
return nr_read;
}