[libc-commits] [PATCH] D147738: [libc] Enable linux directory entries syscalls in riscv64

Mikhail Ramalho via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu May 4 12:11:34 PDT 2023


mikhail.ramalho added inline comments.


================
Comment at: libc/src/__support/File/linux_dir.cpp:45
+                                        buffer.size());
+#elif defined(SYS_getdents)
+  size_t size =
----------------
sivachandra wrote:
> Do we need this alternate path at all for the platforms we care about now? For example, if none of the builders exercise this path, then it is dead code. The four platforms I have checked and care for at this time, x86_64, aarch64, arm32 and riscv64, all have `SYS_getdents64`. If this alternate path is not an immediate necessity, we should skip it.
@sivachandra, `SYS_getdents` doesn't seem to be defined in riscv64, so we need to add the patch to support `SYS_getdents64` instead. Please, check: https://github.com/riscv-collab/riscv-gnu-toolchain/blob/master/linux-headers/include/asm-generic/unistd.h

May I ask how you are testing this? I tested cross-compiling libc with clang, and building it natively in qemu, and  `SYS_getdents` was not defined in either case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147738/new/

https://reviews.llvm.org/D147738



More information about the libc-commits mailing list