1570af302Sopenharmony_ci#define _BSD_SOURCE 2570af302Sopenharmony_ci#include <dirent.h> 3570af302Sopenharmony_ci#include <limits.h> 4570af302Sopenharmony_ci#include "syscall.h" 5570af302Sopenharmony_ci 6570af302Sopenharmony_ciint getdents(int fd, struct dirent *buf, size_t len) 7570af302Sopenharmony_ci{ 8570af302Sopenharmony_ci if (len>INT_MAX) len = INT_MAX; 9570af302Sopenharmony_ci return syscall(SYS_getdents, fd, buf, len); 10570af302Sopenharmony_ci} 11570af302Sopenharmony_ci 12570af302Sopenharmony_ciweak_alias(getdents, getdents64); 13