getdents.c 252 B

123456789101112
  1. #define _BSD_SOURCE
  2. #include <dirent.h>
  3. #include <limits.h>
  4. #include "syscall.h"
  5. int getdents(int fd, struct dirent *buf, size_t len)
  6. {
  7. if (len>INT_MAX) len = INT_MAX;
  8. return syscall(SYS_getdents, fd, buf, len);
  9. }
  10. weak_alias(getdents, getdents64);