summaryrefslogtreecommitdiff
path: root/libc/include
diff options
context:
space:
mode:
authorMikhail R. Gadelha <mikhail@igalia.com>2023-05-04 18:34:01 -0300
committerMikhail R. Gadelha <mikhail@igalia.com>2023-05-04 19:07:16 -0300
commit4c9c1a4e4f854b2a4891813b2b1d7e1079a52a62 (patch)
treeb1cd6849bb9360455ff02405f982451fd001667d /libc/include
parent8052c1e6ebbd993439006bd996bd34b9e8d32f57 (diff)
downloadllvm-4c9c1a4e4f854b2a4891813b2b1d7e1079a52a62.tar.gz
[libc] Enable linux directory entries syscalls in riscv64
This patch updates the struct dirent to be on par with glibc (by adding a missing d_type member) and update the readdir call to use SYS_getdents64 instead of SYS_getdents. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D147738
Diffstat (limited to 'libc/include')
-rw-r--r--libc/include/llvm-libc-types/struct_dirent.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libc/include/llvm-libc-types/struct_dirent.h b/libc/include/llvm-libc-types/struct_dirent.h
index 44bda4caae45..fde3f8ce4798 100644
--- a/libc/include/llvm-libc-types/struct_dirent.h
+++ b/libc/include/llvm-libc-types/struct_dirent.h
@@ -18,6 +18,7 @@ struct dirent {
off_t d_off;
unsigned short d_reclen;
#endif
+ unsigned char d_type;
// The user code should use strlen to determine actual the size of d_name.
// Likewise, it is incorrect and prohibited by the POSIX standard to detemine
// the size of struct dirent type using sizeof. The size should be got using