]> git.proxmox.com Git - wasi-libc.git/blame - libc-bottom-half/cloudlibc/src/libc/unistd/symlinkat.c
Update to the next version of the `witx` crate (#234)
[wasi-libc.git] / libc-bottom-half / cloudlibc / src / libc / unistd / symlinkat.c
CommitLineData
320054e8
DG
1// Copyright (c) 2015-2016 Nuxi, https://nuxi.nl/
2//
3// SPDX-License-Identifier: BSD-2-Clause
4
5#include <common/errno.h>
6
446cb3f1 7#include <wasi/api.h>
320054e8
DG
8#include <errno.h>
9#include <string.h>
10#include <unistd.h>
11
f2e779e5 12int __wasilibc_nocwd_symlinkat(const char *path1, int fd, const char *path2) {
2b7e73ae 13 __wasi_errno_t error = __wasi_path_symlink(path1, fd, path2);
320054e8
DG
14 if (error != 0) {
15 errno = errno_fixup_directory(fd, error);
16 return -1;
17 }
18 return 0;
19}