diff options
Diffstat (limited to 'libc/stdio/stdio.cpp')
-rw-r--r-- | libc/stdio/stdio.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libc/stdio/stdio.cpp b/libc/stdio/stdio.cpp index 53b3faeb1..23a54de35 100644 --- a/libc/stdio/stdio.cpp +++ b/libc/stdio/stdio.cpp @@ -741,6 +741,12 @@ wint_t putwchar(wchar_t wc) { return fputwc(wc, stdout); } +int remove(const char* path) { + if (unlink(path) != -1) return 0; + if (errno != EISDIR) return -1; + return rmdir(path); +} + void rewind(FILE* fp) { ScopedFileLock sfl(fp); fseek(fp, 0, SEEK_SET); |