]> git.proxmox.com Git - wasi-libc.git/blob - libc-bottom-half/cloudlibc/src/libc/unistd/close.c
a3e0aac4bd893d65ad682e405900164ae417ea1c
[wasi-libc.git] / libc-bottom-half / cloudlibc / src / libc / unistd / close.c
1 // Copyright (c) 2015-2016 Nuxi, https://nuxi.nl/
2 //
3 // SPDX-License-Identifier: BSD-2-Clause
4
5 #include <wasi/core.h>
6 #include <errno.h>
7 #include <unistd.h>
8
9 int close(int fildes) {
10 __wasi_errno_t error = __wasi_fd_close(fildes);
11 if (error != 0) {
12 errno = error;
13 return -1;
14 }
15 return 0;
16 }