diff options
Diffstat (limited to 'libc-bottom-half/cloudlibc/src/libc/unistd/unlinkat.c')
-rw-r--r-- | libc-bottom-half/cloudlibc/src/libc/unistd/unlinkat.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libc-bottom-half/cloudlibc/src/libc/unistd/unlinkat.c b/libc-bottom-half/cloudlibc/src/libc/unistd/unlinkat.c new file mode 100644 index 0000000..351bf92 --- /dev/null +++ b/libc-bottom-half/cloudlibc/src/libc/unistd/unlinkat.c @@ -0,0 +1,17 @@ +// Copyright (c) 2015-2016 Nuxi, https://nuxi.nl/ +// +// SPDX-License-Identifier: BSD-2-Clause + +#include <wasi/api.h> +#include <wasi/libc.h> +#include <errno.h> +#include <fcntl.h> +#include <string.h> +#include <unistd.h> + +int unlinkat(int fd, const char *path, int flag) { + if ((flag & AT_REMOVEDIR) != 0) { + return __wasilibc_rmdirat(fd, path); + } + return __wasilibc_unlinkat(fd, path); +} |