Last active
March 21, 2020 14:14
-
-
Save cjihrig/d7ca6d4ba541890f6b2eb7719fc0433d to your computer and use it in GitHub Desktop.
WASI C Header
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "uvwasi.h" | |
__wasi_errno_t __wasi_args_get(char** argv, char* argv_buf) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_args_sizes_get(size_t* argc, size_t* argv_buf_size) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_clock_res_get(__wasi_clockid_t clock_id, | |
__wasi_timestamp_t* resolution) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_clock_time_get(__wasi_clockid_t clock_id, | |
__wasi_timestamp_t precision, | |
__wasi_timestamp_t* time) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_environ_get(char** environ, char* environ_buf) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_environ_sizes_get(size_t* environ_count, | |
size_t* environ_buf_size) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_advise(__wasi_fd_t fd, | |
__wasi_filesize_t offset, | |
__wasi_filesize_t len, | |
__wasi_advice_t advice) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_allocate(__wasi_fd_t fd, | |
__wasi_filesize_t offset, | |
__wasi_filesize_t len) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_close(__wasi_fd_t fd) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_datasync(__wasi_fd_t fd) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_fdstat_get(__wasi_fd_t fd, __wasi_fdstat_t* buf) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_fdstat_set_flags(__wasi_fd_t fd, | |
__wasi_fdflags_t flags) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_fdstat_set_rights(__wasi_fd_t fd, | |
__wasi_rights_t fs_rights_base, | |
__wasi_rights_t fs_rights_inheriting | |
) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_filestat_get(__wasi_fd_t fd, __wasi_filestat_t* buf) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_filestat_set_size(__wasi_fd_t fd, | |
__wasi_filesize_t st_size) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_filestat_set_times(__wasi_fd_t fd, | |
__wasi_timestamp_t st_atim, | |
__wasi_timestamp_t st_mtim, | |
__wasi_fstflags_t fst_flags) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_pread(__wasi_fd_t fd, | |
const __wasi_iovec_t* iovs, | |
size_t iovs_len, | |
__wasi_filesize_t offset, | |
size_t* nread) { | |
return __WASI_ENOTSUP; | |
} | |
/* TODO(cjihrig): __wasi_prestat_t is not defined. */ | |
__wasi_errno_t __wasi_fd_prestat_get(__wasi_fd_t fd | |
/* , __wasi_prestat_t* buf */) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_prestat_dir_name(__wasi_fd_t fd, | |
const char* path, | |
size_t path_len) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_pwrite(__wasi_fd_t fd, | |
const __wasi_ciovec_t* iovs, | |
size_t iovs_len, | |
__wasi_filesize_t offset, | |
size_t* nwritten) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_read(__wasi_fd_t fd, | |
const __wasi_iovec_t* iovs, | |
size_t iovs_len, | |
size_t* nread) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_readdir(__wasi_fd_t fd, | |
void* buf, | |
size_t buf_len, | |
__wasi_dircookie_t cookie, | |
size_t* bufused) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_renumber(__wasi_fd_t from, __wasi_fd_t to) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_seek(__wasi_fd_t fd, | |
__wasi_filedelta_t offset, | |
__wasi_whence_t whence, | |
__wasi_filesize_t* newoffset) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_sync(__wasi_fd_t fd) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_tell(__wasi_fd_t fd, __wasi_filesize_t* offset) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_fd_write(__wasi_fd_t fd, | |
const __wasi_ciovec_t* iovs, | |
size_t iovs_len, | |
size_t* nwritten) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_path_create_directory(__wasi_fd_t fd, | |
const char* path, | |
size_t path_len) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_path_filestat_get(__wasi_fd_t fd, | |
__wasi_lookupflags_t flags, | |
const char* path, | |
size_t path_len, | |
__wasi_filestat_t* buf) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_path_filestat_set_times(__wasi_fd_t fd, | |
__wasi_lookupflags_t flags, | |
const char* path, | |
size_t path_len, | |
__wasi_timestamp_t st_atim, | |
__wasi_timestamp_t st_mtim, | |
__wasi_fstflags_t fst_flags) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_path_link(__wasi_fd_t old_fd, | |
__wasi_lookupflags_t old_flags, | |
const char* old_path, | |
size_t old_path_len, | |
__wasi_fd_t new_fd, | |
const char* new_path, | |
size_t new_path_len) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_path_open(__wasi_fd_t dirfd, | |
__wasi_lookupflags_t dirflags, | |
const char* path, | |
size_t path_len, | |
__wasi_oflags_t o_flags, | |
__wasi_rights_t fs_rights_base, | |
__wasi_rights_t fs_rights_inheriting, | |
__wasi_fdflags_t fs_flags, | |
__wasi_fd_t* fd) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_path_readlink(__wasi_fd_t fd, | |
const char* path, | |
size_t path_len, | |
char* buf, | |
size_t buf_len, | |
size_t* bufused) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_path_remove_directory(__wasi_fd_t fd, | |
const char* path, | |
size_t path_len) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_path_rename(__wasi_fd_t old_fd, | |
const char* old_path, | |
size_t old_path_len, | |
__wasi_fd_t new_fd, | |
const char* new_path, | |
size_t new_path_len) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_path_symlink(const char* old_path, | |
size_t old_path_len, | |
__wasi_fd_t fd, | |
const char* new_path, | |
size_t new_path_len) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_path_unlink_file(__wasi_fd_t fd, | |
const char* path, | |
size_t path_len) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_poll_oneoff(const __wasi_subscription_t* in, | |
__wasi_event_t* out, | |
size_t nsubscriptions, | |
size_t* nevents) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_proc_exit(__wasi_exitcode_t rval) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_proc_raise(__wasi_signal_t sig) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_random_get(void* buf, size_t buf_len) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_sched_yield(void) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_sock_recv(__wasi_fd_t sock, | |
const __wasi_iovec_t* ri_data, | |
size_t ri_data_len, | |
__wasi_riflags_t ri_flags, | |
size_t* ro_datalen, | |
__wasi_roflags_t* ro_flags) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_sock_send(__wasi_fd_t sock, | |
const __wasi_ciovec_t* si_data, | |
size_t si_data_len, | |
__wasi_siflags_t si_flags, | |
size_t* so_datalen) { | |
return __WASI_ENOTSUP; | |
} | |
__wasi_errno_t __wasi_sock_shutdown(__wasi_fd_t sock, __wasi_sdflags_t how) { | |
return __WASI_ENOTSUP; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __WASI_H__ | |
#define __WASI_H__ | |
#include <stddef.h> | |
#include <stdint.h> | |
/* API: https://github.com/WebAssembly/WASI/blob/master/design/WASI-core.md */ | |
typedef uint8_t __wasi_advice_t; | |
#define __WASI_ADVICE_DONTNEED 0 | |
#define __WASI_ADVICE_NOREUSE 1 | |
#define __WASI_ADVICE_NORMAL 2 | |
#define __WASI_ADVICE_RANDOM 3 | |
#define __WASI_ADVICE_SEQUENTIAL 4 | |
#define __WASI_ADVICE_WILLNEED 5 | |
typedef struct __wasi_ciovec_s { | |
const void* buf; | |
size_t buf_len; | |
} __wasi_ciovec_t; | |
typedef uint32_t __wasi_clockid_t; | |
#define __WASI_CLOCK_MONOTONIC 0 | |
#define __WASI_CLOCK_PROCESS_CPUTIME_ID 1 | |
#define __WASI_CLOCK_REALTIME 2 | |
#define __WASI_CLOCK_THREAD_CPUTIME_ID 3 | |
typedef uint64_t __wasi_device_t; | |
typedef uint64_t __wasi_dircookie_t; | |
#define __WASI_DIRCOOKIE_START 0 | |
typedef uint16_t __wasi_errno_t; | |
#define __WASI_ESUCCESS 0 | |
#define __WASI_E2BIG 1 | |
#define __WASI_EACCES 2 | |
#define __WASI_EADDRINUSE 3 | |
#define __WASI_EADDRNOTAVAIL 4 | |
#define __WASI_EAFNOSUPPORT 5 | |
#define __WASI_EAGAIN 6 | |
#define __WASI_EALREADY 7 | |
#define __WASI_EBADF 8 | |
#define __WASI_EBADMSG 9 | |
#define __WASI_EBUSY 10 | |
#define __WASI_ECANCELED 11 | |
#define __WASI_ECHILD 12 | |
#define __WASI_ECONNABORTED 13 | |
#define __WASI_ECONNREFUSED 14 | |
#define __WASI_ECONNRESET 15 | |
#define __WASI_EDEADLK 16 | |
#define __WASI_EDESTADDRREQ 17 | |
#define __WASI_EDOM 18 | |
#define __WASI_EDQUOT 19 | |
#define __WASI_EEXIST 20 | |
#define __WASI_EFAULT 21 | |
#define __WASI_EFBIG 22 | |
#define __WASI_EHOSTUNREACH 23 | |
#define __WASI_EIDRM 24 | |
#define __WASI_EILSEQ 25 | |
#define __WASI_EINPROGRESS 26 | |
#define __WASI_EINTR 27 | |
#define __WASI_EINVAL 28 | |
#define __WASI_EIO 29 | |
#define __WASI_EISCONN 30 | |
#define __WASI_EISDIR 31 | |
#define __WASI_ELOOP 32 | |
#define __WASI_EMFILE 33 | |
#define __WASI_EMLINK 34 | |
#define __WASI_EMSGSIZE 35 | |
#define __WASI_EMULTIHOP 36 | |
#define __WASI_ENAMETOOLONG 37 | |
#define __WASI_ENETDOWN 38 | |
#define __WASI_ENETRESET 39 | |
#define __WASI_ENETUNREACH 40 | |
#define __WASI_ENFILE 41 | |
#define __WASI_ENOBUFS 42 | |
#define __WASI_ENODEV 43 | |
#define __WASI_ENOENT 44 | |
#define __WASI_ENOEXEC 45 | |
#define __WASI_ENOLCK 46 | |
#define __WASI_ENOLINK 47 | |
#define __WASI_ENOMEM 48 | |
#define __WASI_ENOMSG 49 | |
#define __WASI_ENOPROTOOPT 50 | |
#define __WASI_ENOSPC 51 | |
#define __WASI_ENOSYS 52 | |
#define __WASI_ENOTCONN 53 | |
#define __WASI_ENOTDIR 54 | |
#define __WASI_ENOTEMPTY 55 | |
#define __WASI_ENOTRECOVERABLE 56 | |
#define __WASI_ENOTSOCK 57 | |
#define __WASI_ENOTSUP 58 | |
#define __WASI_ENOTTY 59 | |
#define __WASI_ENXIO 60 | |
#define __WASI_EOVERFLOW 61 | |
#define __WASI_EOWNERDEAD 62 | |
#define __WASI_EPERM 63 | |
#define __WASI_EPIPE 64 | |
#define __WASI_EPROTO 65 | |
#define __WASI_EPROTONOSUPPORT 66 | |
#define __WASI_EPROTOTYPE 67 | |
#define __WASI_ERANGE 68 | |
#define __WASI_EROFS 69 | |
#define __WASI_ESPIPE 70 | |
#define __WASI_ESRCH 71 | |
#define __WASI_ESTALE 72 | |
#define __WASI_ETIMEDOUT 73 | |
#define __WASI_ETXTBSY 74 | |
#define __WASI_EXDEV 75 | |
#define __WASI_ENOTCAPABLE 76 | |
typedef uint16_t __wasi_eventrwflags_t; /* Bitfield */ | |
#define __WASI_EVENT_FD_READWRITE_HANGUP (1 << 0) | |
typedef uint8_t __wasi_eventtype_t; | |
#define __WASI_EVENTTYPE_CLOCK 0 | |
#define __WASI_EVENTTYPE_FD_READ 1 | |
#define __WASI_EVENTTYPE_FD_WRITE 2 | |
typedef uint32_t __wasi_exitcode_t; | |
typedef uint32_t __wasi_fd_t; | |
typedef uint16_t __wasi_fdflags_t; /* Bitfield */ | |
#define __WASI_FDFLAG_APPEND (1 << 0) | |
#define __WASI_FDFLAG_DSYNC (1 << 1) | |
#define __WASI_FDFLAG_NONBLOCK (1 << 2) | |
#define __WASI_FDFLAG_RSYNC (1 << 3) | |
#define __WASI_FDFLAG_SYNC (1 << 4) | |
typedef int64_t __wasi_filedelta_t; | |
typedef uint64_t __wasi_filesize_t; | |
typedef uint8_t __wasi_filetype_t; | |
#define __WASI_FILETYPE_UNKNOWN 0 | |
#define __WASI_FILETYPE_BLOCK_DEVICE 1 | |
#define __WASI_FILETYPE_CHARACTER_DEVICE 2 | |
#define __WASI_FILETYPE_DIRECTORY 3 | |
#define __WASI_FILETYPE_REGULAR_FILE 4 | |
#define __WASI_FILETYPE_SOCKET_DGRAM 5 | |
#define __WASI_FILETYPE_SOCKET_STREAM 6 | |
#define __WASI_FILETYPE_SYMBOLIC_LINK 7 | |
typedef uint16_t __wasi_fstflags_t; /* Bitfield */ | |
#define __WASI_FILESTAT_SET_ATIM (1 << 0) | |
#define __WASI_FILESTAT_SET_ATIM_NOW (1 << 1) | |
#define __WASI_FILESTAT_SET_MTIM (1 << 2) | |
#define __WASI_FILESTAT_SET_MTIM_NOW (1 << 3) | |
typedef uint64_t __wasi_inode_t; | |
typedef struct __wasi_iovec_s { | |
void* buf; | |
size_t buf_len; | |
} __wasi_iovec_t; | |
typedef uint32_t __wasi_linkcount_t; | |
typedef uint32_t __wasi_lookupflags_t; /* Bitfield */ | |
#define __WASI_LOOKUP_SYMLINK_FOLLOW (1 << 0) | |
typedef uint16_t __wasi_oflags_t; /* Bitfield */ | |
#define __WASI_O_CREAT (1 << 0) | |
#define __WASI_O_DIRECTORY (1 << 1) | |
#define __WASI_O_EXCL (1 << 2) | |
#define __WASI_O_TRUNC (1 << 3) | |
typedef uint16_t __wasi_riflags_t; /* Bitfield */ | |
#define __WASI_SOCK_RECV_PEEK (1 << 0) | |
#define __WASI_SOCK_RECV_WAITALL (1 << 1) | |
typedef uint64_t __wasi_rights_t; /* Bitfield */ | |
#define __WASI_RIGHT_FD_DATASYNC (1 << 0) | |
#define __WASI_RIGHT_FD_READ (1 << 1) | |
#define __WASI_RIGHT_FD_SEEK (1 << 2) | |
#define __WASI_RIGHT_FD_FDSTAT_SET_FLAGS (1 << 3) | |
#define __WASI_RIGHT_FD_SYNC (1 << 4) | |
#define __WASI_RIGHT_FD_TELL (1 << 5) | |
#define __WASI_RIGHT_FD_WRITE (1 << 6) | |
#define __WASI_RIGHT_FD_ADVISE (1 << 7) | |
#define __WASI_RIGHT_FD_ALLOCATE (1 << 8) | |
#define __WASI_RIGHT_PATH_CREATE_DIRECTORY (1 << 9) | |
#define __WASI_RIGHT_PATH_CREATE_FILE (1 << 10) | |
#define __WASI_RIGHT_PATH_LINK_SOURCE (1 << 11) | |
#define __WASI_RIGHT_PATH_LINK_TARGET (1 << 12) | |
#define __WASI_RIGHT_PATH_OPEN (1 << 13) | |
#define __WASI_RIGHT_FD_READDIR (1 << 14) | |
#define __WASI_RIGHT_PATH_READLINK (1 << 15) | |
#define __WASI_RIGHT_PATH_RENAME_SOURCE (1 << 16) | |
#define __WASI_RIGHT_PATH_RENAME_TARGET (1 << 17) | |
#define __WASI_RIGHT_PATH_FILESTAT_GET (1 << 18) | |
#define __WASI_RIGHT_PATH_FILESTAT_SET_SIZE (1 << 19) | |
#define __WASI_RIGHT_PATH_FILESTAT_SET_TIMES (1 << 20) | |
#define __WASI_RIGHT_FD_FILESTAT_GET (1 << 21) | |
#define __WASI_RIGHT_FD_FILESTAT_SET_SIZE (1 << 22) | |
#define __WASI_RIGHT_FD_FILESTAT_SET_TIMES (1 << 23) | |
#define __WASI_RIGHT_PATH_SYMLINK (1 << 24) | |
#define __WASI_RIGHT_PATH_UNLINK_FILE (1 << 25) | |
#define __WASI_RIGHT_PATH_REMOVE_DIRECTORY (1 << 26) | |
#define __WASI_RIGHT_POLL_FD_READWRITE (1 << 27) | |
#define __WASI_RIGHT_SOCK_SHUTDOWN (1 << 28) | |
typedef uint16_t __wasi_roflags_t; /* Bitfield */ | |
#define __WASI_SOCK_RECV_DATA_TRUNCATED (1 << 0) | |
typedef uint8_t __wasi_sdflags_t; /* Bitfield */ | |
#define __WASI_SHUT_RD (1 << 0) | |
#define __WASI_SHUT_WR (1 << 1) | |
typedef uint16_t __wasi_siflags_t; /* Bitfield */ | |
typedef uint8_t __wasi_signal_t; | |
#define __WASI_SIGABRT 0 | |
#define __WASI_SIGALRM 1 | |
#define __WASI_SIGBUS 2 | |
#define __WASI_SIGCHLD 3 | |
#define __WASI_SIGCONT 4 | |
#define __WASI_SIGFPE 5 | |
#define __WASI_SIGHUP 6 | |
#define __WASI_SIGILL 7 | |
#define __WASI_SIGINT 8 | |
#define __WASI_SIGKILL 9 | |
#define __WASI_SIGPIPE 10 | |
#define __WASI_SIGQUIT 11 | |
#define __WASI_SIGSEGV 12 | |
#define __WASI_SIGSTOP 13 | |
#define __WASI_SIGSYS 14 | |
#define __WASI_SIGTERM 15 | |
#define __WASI_SIGTRAP 16 | |
#define __WASI_SIGTSTP 17 | |
#define __WASI_SIGTTIN 18 | |
#define __WASI_SIGTTOU 19 | |
#define __WASI_SIGURG 20 | |
#define __WASI_SIGUSR1 21 | |
#define __WASI_SIGUSR2 22 | |
#define __WASI_SIGVTALRM 23 | |
#define __WASI_SIGXCPU 24 | |
#define __WASI_SIGXFSZ 25 | |
typedef uint16_t __wasi_subclockflags_t; /* Bitfield */ | |
#define __WASI_SUBSCRIPTION_CLOCK_ABSTIME (1 << 0) | |
typedef uint64_t __wasi_timestamp_t; | |
typedef uint64_t __wasi_userdata_t; | |
typedef struct __wasi_subscription_s { | |
__wasi_userdata_t userdata; | |
__wasi_eventtype_t type; | |
union { | |
struct { | |
__wasi_userdata_t identifier; | |
__wasi_clockid_t clock_id; | |
__wasi_timestamp_t timeout; | |
__wasi_timestamp_t precision; | |
__wasi_subclockflags_t flags; | |
} clock; | |
struct { | |
__wasi_fd_t fd; | |
} fd_readwrite; | |
} u; | |
} __wasi_subscription_t; | |
typedef struct __wasi_dirent_s { | |
__wasi_dircookie_t d_next; | |
__wasi_inode_t d_ino; | |
uint32_t d_namlen; | |
__wasi_filetype_t d_type; | |
} __wasi_dirent_t; | |
typedef struct __wasi_fdstat_s { | |
__wasi_filetype_t fs_filetype; | |
__wasi_fdflags_t fs_flags; | |
__wasi_rights_t fs_rights_base; | |
__wasi_rights_t fs_rights_inheriting; | |
} __wasi_fdstat_t; | |
typedef struct __wasi_filestat_s { | |
__wasi_device_t st_dev; | |
__wasi_inode_t st_ino; | |
__wasi_filetype_t st_filetype; | |
__wasi_linkcount_t st_nlink; | |
__wasi_filesize_t st_size; | |
__wasi_timestamp_t st_atim; | |
__wasi_timestamp_t st_mtim; | |
__wasi_timestamp_t st_ctim; | |
} __wasi_filestat_t; | |
typedef struct __wasi_event_s { | |
__wasi_userdata_t userdata; | |
__wasi_errno_t error; | |
__wasi_eventtype_t type; | |
union { | |
struct { | |
__wasi_filesize_t nbytes; | |
__wasi_eventrwflags_t flags; | |
} fd_readwrite; | |
} u; | |
} __wasi_event_t; | |
typedef uint8_t __wasi_whence_t; | |
#define __WASI_WHENCE_CUR 0 | |
#define __WASI_WHENCE_END 1 | |
#define __WASI_WHENCE_SET 2 | |
__wasi_errno_t __wasi_args_get(char** argv, char* argv_buf); | |
__wasi_errno_t __wasi_args_sizes_get(size_t* argc, size_t* argv_buf_size); | |
__wasi_errno_t __wasi_clock_res_get(__wasi_clockid_t clock_id, | |
__wasi_timestamp_t* resolution); | |
__wasi_errno_t __wasi_clock_time_get(__wasi_clockid_t clock_id, | |
__wasi_timestamp_t precision, | |
__wasi_timestamp_t* time); | |
__wasi_errno_t __wasi_environ_get(char** environ, char* environ_buf); | |
__wasi_errno_t __wasi_environ_sizes_get(size_t* environ_count, | |
size_t* environ_buf_size); | |
__wasi_errno_t __wasi_fd_advise(__wasi_fd_t fd, | |
__wasi_filesize_t offset, | |
__wasi_filesize_t len, | |
__wasi_advice_t advice); | |
__wasi_errno_t __wasi_fd_allocate(__wasi_fd_t fd, | |
__wasi_filesize_t offset, | |
__wasi_filesize_t len); | |
__wasi_errno_t __wasi_fd_close(__wasi_fd_t fd); | |
__wasi_errno_t __wasi_fd_datasync(__wasi_fd_t fd); | |
__wasi_errno_t __wasi_fd_fdstat_get(__wasi_fd_t fd, __wasi_fdstat_t* buf); | |
__wasi_errno_t __wasi_fd_fdstat_set_flags(__wasi_fd_t fd, | |
__wasi_fdflags_t flags); | |
__wasi_errno_t __wasi_fd_fdstat_set_rights(__wasi_fd_t fd, | |
__wasi_rights_t fs_rights_base, | |
__wasi_rights_t fs_rights_inheriting | |
); | |
__wasi_errno_t __wasi_fd_filestat_get(__wasi_fd_t fd, __wasi_filestat_t* buf); | |
__wasi_errno_t __wasi_fd_filestat_set_size(__wasi_fd_t fd, | |
__wasi_filesize_t st_size); | |
__wasi_errno_t __wasi_fd_filestat_set_times(__wasi_fd_t fd, | |
__wasi_timestamp_t st_atim, | |
__wasi_timestamp_t st_mtim, | |
__wasi_fstflags_t fst_flags); | |
__wasi_errno_t __wasi_fd_pread(__wasi_fd_t fd, | |
const __wasi_iovec_t* iovs, | |
size_t iovs_len, | |
__wasi_filesize_t offset, | |
size_t* nread); | |
/* TODO(cjihrig): __wasi_prestat_t is not defined. */ | |
__wasi_errno_t __wasi_fd_prestat_get(__wasi_fd_t fd | |
/* , __wasi_prestat_t* buf */); | |
__wasi_errno_t __wasi_fd_prestat_dir_name(__wasi_fd_t fd, | |
const char* path, | |
size_t path_len); | |
__wasi_errno_t __wasi_fd_pwrite(__wasi_fd_t fd, | |
const __wasi_ciovec_t* iovs, | |
size_t iovs_len, | |
__wasi_filesize_t offset, | |
size_t* nwritten); | |
__wasi_errno_t __wasi_fd_read(__wasi_fd_t fd, | |
const __wasi_iovec_t* iovs, | |
size_t iovs_len, | |
size_t* nread); | |
__wasi_errno_t __wasi_fd_readdir(__wasi_fd_t fd, | |
void* buf, | |
size_t buf_len, | |
__wasi_dircookie_t cookie, | |
size_t* bufused); | |
__wasi_errno_t __wasi_fd_renumber(__wasi_fd_t from, __wasi_fd_t to); | |
__wasi_errno_t __wasi_fd_seek(__wasi_fd_t fd, | |
__wasi_filedelta_t offset, | |
__wasi_whence_t whence, | |
__wasi_filesize_t* newoffset); | |
__wasi_errno_t __wasi_fd_sync(__wasi_fd_t fd); | |
__wasi_errno_t __wasi_fd_tell(__wasi_fd_t fd, __wasi_filesize_t* offset); | |
__wasi_errno_t __wasi_fd_write(__wasi_fd_t fd, | |
const __wasi_ciovec_t* iovs, | |
size_t iovs_len, | |
size_t* nwritten); | |
__wasi_errno_t __wasi_path_create_directory(__wasi_fd_t fd, | |
const char* path, | |
size_t path_len); | |
__wasi_errno_t __wasi_path_filestat_get(__wasi_fd_t fd, | |
__wasi_lookupflags_t flags, | |
const char* path, | |
size_t path_len, | |
__wasi_filestat_t* buf); | |
__wasi_errno_t __wasi_path_filestat_set_times(__wasi_fd_t fd, | |
__wasi_lookupflags_t flags, | |
const char* path, | |
size_t path_len, | |
__wasi_timestamp_t st_atim, | |
__wasi_timestamp_t st_mtim, | |
__wasi_fstflags_t fst_flags); | |
__wasi_errno_t __wasi_path_link(__wasi_fd_t old_fd, | |
__wasi_lookupflags_t old_flags, | |
const char* old_path, | |
size_t old_path_len, | |
__wasi_fd_t new_fd, | |
const char* new_path, | |
size_t new_path_len); | |
__wasi_errno_t __wasi_path_open(__wasi_fd_t dirfd, | |
__wasi_lookupflags_t dirflags, | |
const char* path, | |
size_t path_len, | |
__wasi_oflags_t o_flags, | |
__wasi_rights_t fs_rights_base, | |
__wasi_rights_t fs_rights_inheriting, | |
__wasi_fdflags_t fs_flags, | |
__wasi_fd_t* fd); | |
__wasi_errno_t __wasi_path_readlink(__wasi_fd_t fd, | |
const char* path, | |
size_t path_len, | |
char* buf, | |
size_t buf_len, | |
size_t* bufused); | |
__wasi_errno_t __wasi_path_remove_directory(__wasi_fd_t fd, | |
const char* path, | |
size_t path_len); | |
__wasi_errno_t __wasi_path_rename(__wasi_fd_t old_fd, | |
const char* old_path, | |
size_t old_path_len, | |
__wasi_fd_t new_fd, | |
const char* new_path, | |
size_t new_path_len); | |
__wasi_errno_t __wasi_path_symlink(const char* old_path, | |
size_t old_path_len, | |
__wasi_fd_t fd, | |
const char* new_path, | |
size_t new_path_len); | |
__wasi_errno_t __wasi_path_unlink_file(__wasi_fd_t fd, | |
const char* path, | |
size_t path_len); | |
__wasi_errno_t __wasi_poll_oneoff(const __wasi_subscription_t* in, | |
__wasi_event_t* out, | |
size_t nsubscriptions, | |
size_t* nevents); | |
__wasi_errno_t __wasi_proc_exit(__wasi_exitcode_t rval); | |
__wasi_errno_t __wasi_proc_raise(__wasi_signal_t sig); | |
__wasi_errno_t __wasi_random_get(void* buf, size_t buf_len); | |
__wasi_errno_t __wasi_sched_yield(void); | |
__wasi_errno_t __wasi_sock_recv(__wasi_fd_t sock, | |
const __wasi_iovec_t* ri_data, | |
size_t ri_data_len, | |
__wasi_riflags_t ri_flags, | |
size_t* ro_datalen, | |
__wasi_roflags_t* ro_flags); | |
__wasi_errno_t __wasi_sock_send(__wasi_fd_t sock, | |
const __wasi_ciovec_t* si_data, | |
size_t si_data_len, | |
__wasi_siflags_t si_flags, | |
size_t* so_datalen); | |
__wasi_errno_t __wasi_sock_shutdown(__wasi_fd_t sock, __wasi_sdflags_t how); | |
#endif /* __WASI_H__ */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cool!