Rich Felker | 5ce3737 | 2018-09-12 00:08:09 -0400 | [diff] [blame] | 1 | #define _BSD_SOURCE |
Rich Felker | ebb6afd | 2018-09-11 14:09:20 -0400 | [diff] [blame] | 2 | #include <dirent.h> |
Rich Felker | 3d178a7 | 2019-06-28 17:58:03 -0400 | [diff] [blame^] | 3 | #include <limits.h> |
Rich Felker | ebb6afd | 2018-09-11 14:09:20 -0400 | [diff] [blame] | 4 | #include "syscall.h" |
Rich Felker | ebb6afd | 2018-09-11 14:09:20 -0400 | [diff] [blame] | 5 | |
6 | int getdents(int fd, struct dirent *buf, size_t len) | ||||
7 | { | ||||
Rich Felker | 3d178a7 | 2019-06-28 17:58:03 -0400 | [diff] [blame^] | 8 | if (len>INT_MAX) len = INT_MAX; |
Rich Felker | ebb6afd | 2018-09-11 14:09:20 -0400 | [diff] [blame] | 9 | return syscall(SYS_getdents, fd, buf, len); |
10 | } | ||||
11 | |||||
Rich Felker | 63a4c9a | 2018-09-12 00:28:34 -0400 | [diff] [blame] | 12 | weak_alias(getdents, getdents64); |