1 // Copyright (c) 2015-2016 Nuxi, https://nuxi.nl/ 2 // 3 // SPDX-License-Identifier: BSD-2-Clause 4 5 #include <wasi/api.h> 6 #include <errno.h> 7 #include <unistd.h> 8 close(int fildes)9int 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 } 17