diff --git a/src/basic/dirent-util.h b/src/basic/dirent-util.h index 816b28e04f..f3007b6bc3 100644 --- a/src/basic/dirent-util.h +++ b/src/basic/dirent-util.h @@ -34,6 +34,13 @@ struct dirent *readdir_no_dot(DIR *dirp); * Let's introduce a simple wrapper. */ #if !HAVE_POSIX_GETDENTS static inline ssize_t posix_getdents(int fd, void *buf, size_t nbyte, int flags) { + assert(fd >= 0); + assert(buf); + assert(nbyte > 0); + + if (flags != 0) + return -EINVAL; /* Currently flags must be zero. */ + return getdents64(fd, buf, nbyte); } #endif