minix3/lib/libc/sys/getdents.c

22 lines
463 B
C
Raw Permalink Normal View History

2020-02-21 00:59:27 +05:30
#include <sys/cdefs.h>
#include "namespace.h"
#include <lib.h>
#include <string.h>
#include <dirent.h>
ssize_t getdents(int fd, char *buffer, size_t nbytes)
{
message m;
memset(&m, 0, sizeof(m));
m.m_lc_vfs_readwrite.fd = fd;
m.m_lc_vfs_readwrite.len = nbytes;
m.m_lc_vfs_readwrite.buf = (vir_bytes)buffer;
return _syscall(VFS_PROC_NR, VFS_GETDENTS, &m);
}
#if defined(__minix) && defined(__weak_alias)
__weak_alias(getdents, __getdents30)
#endif