Path: blob/main/system/include/wasi/wasi-helpers.h
6171 views
/*1* Copyright 2019 The Emscripten Authors. All rights reserved.2* Emscripten is available under two separate licenses, the MIT license and the3* University of Illinois/NCSA Open Source License. Both these licenses can be4* found in the LICENSE file.5*/67#ifndef __wasi_emscripten_helpers_h8#define __wasi_emscripten_helpers_h910#include <wasi/api.h>1112#ifdef __cplusplus13extern "C" {14#endif1516// Converts a wasi return code to a musl syscall return code (-1 if17// error, 0 otherwise), and sets errno accordingly.18int __wasi_syscall_ret(__wasi_errno_t code);1920// Check if a wasi file descriptor is valid, returning 1 if valid and 0 if21// not. If not, also sets errno to EBADF.22int __wasi_fd_is_valid(__wasi_fd_t fd);2324struct timespec __wasi_timestamp_to_timespec(__wasi_timestamp_t timestamp);2526#ifdef __cplusplus27}28#endif2930#endif // __wasi_emscripten_helpers_h313233