[libc-commits] [PATCH] D133922: [libc] Add the implementation of the "remove" function.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Sep 15 09:18:56 PDT 2022


sivachandra added inline comments.


================
Comment at: libc/src/stdio/linux/remove.cpp:23
+  // it fails with EISDIR, we will try unlinking it as a directory.
+  int ret = __llvm_libc::syscall(SYS_unlinkat, AT_FDCWD, path, 0);
+  if (ret == -EISDIR)
----------------
lntue wrote:
> In the implementation of `linux/unlinkat`, `SYS_unlinkat` is guarded: https://github.com/llvm/llvm-project/blob/main/libc/src/unistd/linux/unlinkat.cpp#L21
> Do you need the same guard here?
I think that example is being a bit too pedantic. We can remove it - if `SYS_unlinkat` is missing, there will be a compile failure providing equivalent information.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133922



More information about the libc-commits mailing list