X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Fremove.c;h=942e301a4c035f491c6b0ffef47b8e1572312678;hb=8949da7ab1c0dbf801e8bc78f0c0adc625020f75;hp=8e338277eb967dcbac1f76f8d8994f8b47b8f668;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/stdio/remove.c b/src/stdio/remove.c index 8e338277..942e301a 100644 --- a/src/stdio/remove.c +++ b/src/stdio/remove.c @@ -1,7 +1,19 @@ #include +#include +#include #include "syscall.h" int remove(const char *path) { - return __syscall_unlink(path); +#ifdef SYS_unlink + int r = __syscall(SYS_unlink, path); +#else + int r = __syscall(SYS_unlinkat, AT_FDCWD, path, 0); +#endif +#ifdef SYS_rmdir + if (r==-EISDIR) r = __syscall(SYS_rmdir, path); +#else + if (r==-EISDIR) r = __syscall(SYS_unlinkat, AT_FDCWD, path, AT_REMOVEDIR); +#endif + return __syscall_ret(r); }