libroot/posix/stdio: Remove unused portions.
[haiku.git] / src / system / libroot / posix / stdio / remove.c
blob856942d6fdcc96a9a804ed2c7b0cf4d9981b06f7
1 /*
2 * Copyright 2004-2009, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
4 */
7 #include <stdio.h>
9 #include <errno.h>
11 #include <errno_private.h>
12 #include <syscalls.h>
15 int
16 remove(const char* path)
18 // TODO: find a better way that does not require two syscalls for directories
19 int status = _kern_unlink(-1, path);
20 if (status == B_IS_A_DIRECTORY)
21 status = _kern_remove_dir(-1, path);
23 if (status != B_OK) {
24 __set_errno(status);
25 return -1;
28 return status;