add further ioctl time64 fallback conversions
[musl] / src / linux / getdents.c
index cab2995..796c1e5 100644 (file)
@@ -1,11 +1,12 @@
 #define _BSD_SOURCE
 #include <dirent.h>
+#include <limits.h>
 #include "syscall.h"
-#include "libc.h"
 
 int getdents(int fd, struct dirent *buf, size_t len)
 {
+       if (len>INT_MAX) len = INT_MAX;
        return syscall(SYS_getdents, fd, buf, len);
 }
 
-LFS64(getdents);
+weak_alias(getdents, getdents64);