11cb0ef41Sopenharmony_ci#ifndef __UVWASI_H__
21cb0ef41Sopenharmony_ci#define __UVWASI_H__
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_ci#ifdef __cplusplus
51cb0ef41Sopenharmony_ciextern "C" {
61cb0ef41Sopenharmony_ci#endif
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ci#include "uv.h"
91cb0ef41Sopenharmony_ci#include "wasi_serdes.h"
101cb0ef41Sopenharmony_ci#include "wasi_types.h"
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ci#define UVWASI_VERSION_MAJOR 0
131cb0ef41Sopenharmony_ci#define UVWASI_VERSION_MINOR 0
141cb0ef41Sopenharmony_ci#define UVWASI_VERSION_PATCH 19
151cb0ef41Sopenharmony_ci#define UVWASI_VERSION_HEX ((UVWASI_VERSION_MAJOR << 16) | \
161cb0ef41Sopenharmony_ci                            (UVWASI_VERSION_MINOR <<  8) | \
171cb0ef41Sopenharmony_ci                            (UVWASI_VERSION_PATCH))
181cb0ef41Sopenharmony_ci#define UVWASI_STRINGIFY(v) UVWASI_STRINGIFY_HELPER(v)
191cb0ef41Sopenharmony_ci#define UVWASI_STRINGIFY_HELPER(v) #v
201cb0ef41Sopenharmony_ci#define UVWASI_VERSION_STRING UVWASI_STRINGIFY(UVWASI_VERSION_MAJOR) "." \
211cb0ef41Sopenharmony_ci                              UVWASI_STRINGIFY(UVWASI_VERSION_MINOR) "." \
221cb0ef41Sopenharmony_ci                              UVWASI_STRINGIFY(UVWASI_VERSION_PATCH)
231cb0ef41Sopenharmony_ci#define UVWASI_VERSION_WASI "snapshot_1"
241cb0ef41Sopenharmony_ci
251cb0ef41Sopenharmony_citypedef void* (*uvwasi_malloc)(size_t size, void* mem_user_data);
261cb0ef41Sopenharmony_citypedef void (*uvwasi_free)(void* ptr, void* mem_user_data);
271cb0ef41Sopenharmony_citypedef void* (*uvwasi_calloc)(size_t nmemb, size_t size, void* mem_user_data);
281cb0ef41Sopenharmony_citypedef void* (*uvwasi_realloc)(void* ptr, size_t size, void* mem_user_data);
291cb0ef41Sopenharmony_ci
301cb0ef41Sopenharmony_citypedef struct uvwasi_mem_s {
311cb0ef41Sopenharmony_ci  void* mem_user_data;
321cb0ef41Sopenharmony_ci  uvwasi_malloc malloc;
331cb0ef41Sopenharmony_ci  uvwasi_free free;
341cb0ef41Sopenharmony_ci  uvwasi_calloc calloc;
351cb0ef41Sopenharmony_ci  uvwasi_realloc realloc;
361cb0ef41Sopenharmony_ci} uvwasi_mem_t;
371cb0ef41Sopenharmony_ci
381cb0ef41Sopenharmony_cistruct uvwasi_fd_table_t;
391cb0ef41Sopenharmony_ci
401cb0ef41Sopenharmony_citypedef struct uvwasi_s {
411cb0ef41Sopenharmony_ci  struct uvwasi_fd_table_t* fds;
421cb0ef41Sopenharmony_ci  uvwasi_size_t argc;
431cb0ef41Sopenharmony_ci  char** argv;
441cb0ef41Sopenharmony_ci  char* argv_buf;
451cb0ef41Sopenharmony_ci  uvwasi_size_t argv_buf_size;
461cb0ef41Sopenharmony_ci  uvwasi_size_t envc;
471cb0ef41Sopenharmony_ci  char** env;
481cb0ef41Sopenharmony_ci  char* env_buf;
491cb0ef41Sopenharmony_ci  uvwasi_size_t env_buf_size;
501cb0ef41Sopenharmony_ci  const uvwasi_mem_t* allocator;
511cb0ef41Sopenharmony_ci  uv_loop_t* loop;
521cb0ef41Sopenharmony_ci} uvwasi_t;
531cb0ef41Sopenharmony_ci
541cb0ef41Sopenharmony_citypedef struct uvwasi_preopen_s {
551cb0ef41Sopenharmony_ci  const char* mapped_path;
561cb0ef41Sopenharmony_ci  const char* real_path;
571cb0ef41Sopenharmony_ci} uvwasi_preopen_t;
581cb0ef41Sopenharmony_ci
591cb0ef41Sopenharmony_citypedef struct uvwasi_preopen_socket_s {
601cb0ef41Sopenharmony_ci  const char* address;
611cb0ef41Sopenharmony_ci  int port;
621cb0ef41Sopenharmony_ci} uvwasi_preopen_socket_t;
631cb0ef41Sopenharmony_ci
641cb0ef41Sopenharmony_citypedef struct uvwasi_options_s {
651cb0ef41Sopenharmony_ci  uvwasi_size_t fd_table_size;
661cb0ef41Sopenharmony_ci  uvwasi_size_t preopenc;
671cb0ef41Sopenharmony_ci  uvwasi_preopen_t* preopens;
681cb0ef41Sopenharmony_ci  uvwasi_size_t preopen_socketc;
691cb0ef41Sopenharmony_ci  uvwasi_preopen_socket_t* preopen_sockets;
701cb0ef41Sopenharmony_ci  uvwasi_size_t argc;
711cb0ef41Sopenharmony_ci  const char** argv;
721cb0ef41Sopenharmony_ci  const char** envp;
731cb0ef41Sopenharmony_ci  uvwasi_fd_t in;
741cb0ef41Sopenharmony_ci  uvwasi_fd_t out;
751cb0ef41Sopenharmony_ci  uvwasi_fd_t err;
761cb0ef41Sopenharmony_ci  const uvwasi_mem_t* allocator;
771cb0ef41Sopenharmony_ci} uvwasi_options_t;
781cb0ef41Sopenharmony_ci
791cb0ef41Sopenharmony_ci/* Embedder API. */
801cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_init(uvwasi_t* uvwasi, const uvwasi_options_t* options);
811cb0ef41Sopenharmony_civoid uvwasi_destroy(uvwasi_t* uvwasi);
821cb0ef41Sopenharmony_civoid uvwasi_options_init(uvwasi_options_t* options);
831cb0ef41Sopenharmony_ci/* Use int instead of uv_file to avoid needing uv.h */
841cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_embedder_remap_fd(uvwasi_t* uvwasi,
851cb0ef41Sopenharmony_ci                                        const uvwasi_fd_t fd,
861cb0ef41Sopenharmony_ci                                        int new_host_fd);
871cb0ef41Sopenharmony_ciconst char* uvwasi_embedder_err_code_to_string(uvwasi_errno_t code);
881cb0ef41Sopenharmony_ci
891cb0ef41Sopenharmony_ci
901cb0ef41Sopenharmony_ci/* WASI system call API. */
911cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_args_get(uvwasi_t* uvwasi, char** argv, char* argv_buf);
921cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_args_sizes_get(uvwasi_t* uvwasi,
931cb0ef41Sopenharmony_ci                                     uvwasi_size_t* argc,
941cb0ef41Sopenharmony_ci                                     uvwasi_size_t* argv_buf_size);
951cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_clock_res_get(uvwasi_t* uvwasi,
961cb0ef41Sopenharmony_ci                                    uvwasi_clockid_t clock_id,
971cb0ef41Sopenharmony_ci                                    uvwasi_timestamp_t* resolution);
981cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_clock_time_get(uvwasi_t* uvwasi,
991cb0ef41Sopenharmony_ci                                     uvwasi_clockid_t clock_id,
1001cb0ef41Sopenharmony_ci                                     uvwasi_timestamp_t precision,
1011cb0ef41Sopenharmony_ci                                     uvwasi_timestamp_t* time);
1021cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_environ_get(uvwasi_t* uvwasi,
1031cb0ef41Sopenharmony_ci                                  char** environment,
1041cb0ef41Sopenharmony_ci                                  char* environ_buf);
1051cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_environ_sizes_get(uvwasi_t* uvwasi,
1061cb0ef41Sopenharmony_ci                                        uvwasi_size_t* environ_count,
1071cb0ef41Sopenharmony_ci                                        uvwasi_size_t* environ_buf_size);
1081cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_advise(uvwasi_t* uvwasi,
1091cb0ef41Sopenharmony_ci                                uvwasi_fd_t fd,
1101cb0ef41Sopenharmony_ci                                uvwasi_filesize_t offset,
1111cb0ef41Sopenharmony_ci                                uvwasi_filesize_t len,
1121cb0ef41Sopenharmony_ci                                uvwasi_advice_t advice);
1131cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_allocate(uvwasi_t* uvwasi,
1141cb0ef41Sopenharmony_ci                                  uvwasi_fd_t fd,
1151cb0ef41Sopenharmony_ci                                  uvwasi_filesize_t offset,
1161cb0ef41Sopenharmony_ci                                  uvwasi_filesize_t len);
1171cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_close(uvwasi_t* uvwasi, uvwasi_fd_t fd);
1181cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_datasync(uvwasi_t* uvwasi, uvwasi_fd_t fd);
1191cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_fdstat_get(uvwasi_t* uvwasi,
1201cb0ef41Sopenharmony_ci                                    uvwasi_fd_t fd,
1211cb0ef41Sopenharmony_ci                                    uvwasi_fdstat_t* buf);
1221cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_fdstat_set_flags(uvwasi_t* uvwasi,
1231cb0ef41Sopenharmony_ci                                          uvwasi_fd_t fd,
1241cb0ef41Sopenharmony_ci                                          uvwasi_fdflags_t flags);
1251cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_fdstat_set_rights(uvwasi_t* uvwasi,
1261cb0ef41Sopenharmony_ci                                           uvwasi_fd_t fd,
1271cb0ef41Sopenharmony_ci                                           uvwasi_rights_t fs_rights_base,
1281cb0ef41Sopenharmony_ci                                           uvwasi_rights_t fs_rights_inheriting
1291cb0ef41Sopenharmony_ci                                          );
1301cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_filestat_get(uvwasi_t* uvwasi,
1311cb0ef41Sopenharmony_ci                                      uvwasi_fd_t fd,
1321cb0ef41Sopenharmony_ci                                      uvwasi_filestat_t* buf);
1331cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_filestat_set_size(uvwasi_t* uvwasi,
1341cb0ef41Sopenharmony_ci                                           uvwasi_fd_t fd,
1351cb0ef41Sopenharmony_ci                                           uvwasi_filesize_t st_size);
1361cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_filestat_set_times(uvwasi_t* uvwasi,
1371cb0ef41Sopenharmony_ci                                            uvwasi_fd_t fd,
1381cb0ef41Sopenharmony_ci                                            uvwasi_timestamp_t st_atim,
1391cb0ef41Sopenharmony_ci                                            uvwasi_timestamp_t st_mtim,
1401cb0ef41Sopenharmony_ci                                            uvwasi_fstflags_t fst_flags);
1411cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_pread(uvwasi_t* uvwasi,
1421cb0ef41Sopenharmony_ci                               uvwasi_fd_t fd,
1431cb0ef41Sopenharmony_ci                               const uvwasi_iovec_t* iovs,
1441cb0ef41Sopenharmony_ci                               uvwasi_size_t iovs_len,
1451cb0ef41Sopenharmony_ci                               uvwasi_filesize_t offset,
1461cb0ef41Sopenharmony_ci                               uvwasi_size_t* nread);
1471cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_prestat_get(uvwasi_t* uvwasi,
1481cb0ef41Sopenharmony_ci                                     uvwasi_fd_t fd,
1491cb0ef41Sopenharmony_ci                                     uvwasi_prestat_t* buf);
1501cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_prestat_dir_name(uvwasi_t* uvwasi,
1511cb0ef41Sopenharmony_ci                                          uvwasi_fd_t fd,
1521cb0ef41Sopenharmony_ci                                          char* path,
1531cb0ef41Sopenharmony_ci                                          uvwasi_size_t path_len);
1541cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_pwrite(uvwasi_t* uvwasi,
1551cb0ef41Sopenharmony_ci                                uvwasi_fd_t fd,
1561cb0ef41Sopenharmony_ci                                const uvwasi_ciovec_t* iovs,
1571cb0ef41Sopenharmony_ci                                uvwasi_size_t iovs_len,
1581cb0ef41Sopenharmony_ci                                uvwasi_filesize_t offset,
1591cb0ef41Sopenharmony_ci                                uvwasi_size_t* nwritten);
1601cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_read(uvwasi_t* uvwasi,
1611cb0ef41Sopenharmony_ci                              uvwasi_fd_t fd,
1621cb0ef41Sopenharmony_ci                              const uvwasi_iovec_t* iovs,
1631cb0ef41Sopenharmony_ci                              uvwasi_size_t iovs_len,
1641cb0ef41Sopenharmony_ci                              uvwasi_size_t* nread);
1651cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_readdir(uvwasi_t* uvwasi,
1661cb0ef41Sopenharmony_ci                                 uvwasi_fd_t fd,
1671cb0ef41Sopenharmony_ci                                 void* buf,
1681cb0ef41Sopenharmony_ci                                 uvwasi_size_t buf_len,
1691cb0ef41Sopenharmony_ci                                 uvwasi_dircookie_t cookie,
1701cb0ef41Sopenharmony_ci                                 uvwasi_size_t* bufused);
1711cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_renumber(uvwasi_t* uvwasi,
1721cb0ef41Sopenharmony_ci                                  uvwasi_fd_t from,
1731cb0ef41Sopenharmony_ci                                  uvwasi_fd_t to);
1741cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_seek(uvwasi_t* uvwasi,
1751cb0ef41Sopenharmony_ci                              uvwasi_fd_t fd,
1761cb0ef41Sopenharmony_ci                              uvwasi_filedelta_t offset,
1771cb0ef41Sopenharmony_ci                              uvwasi_whence_t whence,
1781cb0ef41Sopenharmony_ci                              uvwasi_filesize_t* newoffset);
1791cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_sync(uvwasi_t* uvwasi, uvwasi_fd_t fd);
1801cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_tell(uvwasi_t* uvwasi,
1811cb0ef41Sopenharmony_ci                              uvwasi_fd_t fd,
1821cb0ef41Sopenharmony_ci                              uvwasi_filesize_t* offset);
1831cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_fd_write(uvwasi_t* uvwasi,
1841cb0ef41Sopenharmony_ci                               uvwasi_fd_t fd,
1851cb0ef41Sopenharmony_ci                               const uvwasi_ciovec_t* iovs,
1861cb0ef41Sopenharmony_ci                               uvwasi_size_t iovs_len,
1871cb0ef41Sopenharmony_ci                               uvwasi_size_t* nwritten);
1881cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_path_create_directory(uvwasi_t* uvwasi,
1891cb0ef41Sopenharmony_ci                                            uvwasi_fd_t fd,
1901cb0ef41Sopenharmony_ci                                            const char* path,
1911cb0ef41Sopenharmony_ci                                            uvwasi_size_t path_len);
1921cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_path_filestat_get(uvwasi_t* uvwasi,
1931cb0ef41Sopenharmony_ci                                        uvwasi_fd_t fd,
1941cb0ef41Sopenharmony_ci                                        uvwasi_lookupflags_t flags,
1951cb0ef41Sopenharmony_ci                                        const char* path,
1961cb0ef41Sopenharmony_ci                                        uvwasi_size_t path_len,
1971cb0ef41Sopenharmony_ci                                        uvwasi_filestat_t* buf);
1981cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_path_filestat_set_times(uvwasi_t* uvwasi,
1991cb0ef41Sopenharmony_ci                                              uvwasi_fd_t fd,
2001cb0ef41Sopenharmony_ci                                              uvwasi_lookupflags_t flags,
2011cb0ef41Sopenharmony_ci                                              const char* path,
2021cb0ef41Sopenharmony_ci                                              uvwasi_size_t path_len,
2031cb0ef41Sopenharmony_ci                                              uvwasi_timestamp_t st_atim,
2041cb0ef41Sopenharmony_ci                                              uvwasi_timestamp_t st_mtim,
2051cb0ef41Sopenharmony_ci                                              uvwasi_fstflags_t fst_flags);
2061cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_path_link(uvwasi_t* uvwasi,
2071cb0ef41Sopenharmony_ci                                uvwasi_fd_t old_fd,
2081cb0ef41Sopenharmony_ci                                uvwasi_lookupflags_t old_flags,
2091cb0ef41Sopenharmony_ci                                const char* old_path,
2101cb0ef41Sopenharmony_ci                                uvwasi_size_t old_path_len,
2111cb0ef41Sopenharmony_ci                                uvwasi_fd_t new_fd,
2121cb0ef41Sopenharmony_ci                                const char* new_path,
2131cb0ef41Sopenharmony_ci                                uvwasi_size_t new_path_len);
2141cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_path_open(uvwasi_t* uvwasi,
2151cb0ef41Sopenharmony_ci                                uvwasi_fd_t dirfd,
2161cb0ef41Sopenharmony_ci                                uvwasi_lookupflags_t dirflags,
2171cb0ef41Sopenharmony_ci                                const char* path,
2181cb0ef41Sopenharmony_ci                                uvwasi_size_t path_len,
2191cb0ef41Sopenharmony_ci                                uvwasi_oflags_t o_flags,
2201cb0ef41Sopenharmony_ci                                uvwasi_rights_t fs_rights_base,
2211cb0ef41Sopenharmony_ci                                uvwasi_rights_t fs_rights_inheriting,
2221cb0ef41Sopenharmony_ci                                uvwasi_fdflags_t fs_flags,
2231cb0ef41Sopenharmony_ci                                uvwasi_fd_t* fd);
2241cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_path_readlink(uvwasi_t* uvwasi,
2251cb0ef41Sopenharmony_ci                                    uvwasi_fd_t fd,
2261cb0ef41Sopenharmony_ci                                    const char* path,
2271cb0ef41Sopenharmony_ci                                    uvwasi_size_t path_len,
2281cb0ef41Sopenharmony_ci                                    char* buf,
2291cb0ef41Sopenharmony_ci                                    uvwasi_size_t buf_len,
2301cb0ef41Sopenharmony_ci                                    uvwasi_size_t* bufused);
2311cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_path_remove_directory(uvwasi_t* uvwasi,
2321cb0ef41Sopenharmony_ci                                            uvwasi_fd_t fd,
2331cb0ef41Sopenharmony_ci                                            const char* path,
2341cb0ef41Sopenharmony_ci                                            uvwasi_size_t path_len);
2351cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_path_rename(uvwasi_t* uvwasi,
2361cb0ef41Sopenharmony_ci                                  uvwasi_fd_t old_fd,
2371cb0ef41Sopenharmony_ci                                  const char* old_path,
2381cb0ef41Sopenharmony_ci                                  uvwasi_size_t old_path_len,
2391cb0ef41Sopenharmony_ci                                  uvwasi_fd_t new_fd,
2401cb0ef41Sopenharmony_ci                                  const char* new_path,
2411cb0ef41Sopenharmony_ci                                  uvwasi_size_t new_path_len);
2421cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_path_symlink(uvwasi_t* uvwasi,
2431cb0ef41Sopenharmony_ci                                   const char* old_path,
2441cb0ef41Sopenharmony_ci                                   uvwasi_size_t old_path_len,
2451cb0ef41Sopenharmony_ci                                   uvwasi_fd_t fd,
2461cb0ef41Sopenharmony_ci                                   const char* new_path,
2471cb0ef41Sopenharmony_ci                                   uvwasi_size_t new_path_len);
2481cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_path_unlink_file(uvwasi_t* uvwasi,
2491cb0ef41Sopenharmony_ci                                       uvwasi_fd_t fd,
2501cb0ef41Sopenharmony_ci                                       const char* path,
2511cb0ef41Sopenharmony_ci                                       uvwasi_size_t path_len);
2521cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_poll_oneoff(uvwasi_t* uvwasi,
2531cb0ef41Sopenharmony_ci                                  const uvwasi_subscription_t* in,
2541cb0ef41Sopenharmony_ci                                  uvwasi_event_t* out,
2551cb0ef41Sopenharmony_ci                                  uvwasi_size_t nsubscriptions,
2561cb0ef41Sopenharmony_ci                                  uvwasi_size_t* nevents);
2571cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_proc_exit(uvwasi_t* uvwasi, uvwasi_exitcode_t rval);
2581cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_proc_raise(uvwasi_t* uvwasi, uvwasi_signal_t sig);
2591cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_random_get(uvwasi_t* uvwasi,
2601cb0ef41Sopenharmony_ci                                 void* buf,
2611cb0ef41Sopenharmony_ci                                 uvwasi_size_t buf_len);
2621cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_sched_yield(uvwasi_t* uvwasi);
2631cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_sock_accept(uvwasi_t* uvwasi,
2641cb0ef41Sopenharmony_ci                                  uvwasi_fd_t sock,
2651cb0ef41Sopenharmony_ci                                  uvwasi_fdflags_t flags,
2661cb0ef41Sopenharmony_ci                                  uvwasi_fd_t* fd);
2671cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_sock_recv(uvwasi_t* uvwasi,
2681cb0ef41Sopenharmony_ci                                uvwasi_fd_t sock,
2691cb0ef41Sopenharmony_ci                                const uvwasi_iovec_t* ri_data,
2701cb0ef41Sopenharmony_ci                                uvwasi_size_t ri_data_len,
2711cb0ef41Sopenharmony_ci                                uvwasi_riflags_t ri_flags,
2721cb0ef41Sopenharmony_ci                                uvwasi_size_t* ro_datalen,
2731cb0ef41Sopenharmony_ci                                uvwasi_roflags_t* ro_flags);
2741cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_sock_send(uvwasi_t* uvwasi,
2751cb0ef41Sopenharmony_ci                                uvwasi_fd_t sock,
2761cb0ef41Sopenharmony_ci                                const uvwasi_ciovec_t* si_data,
2771cb0ef41Sopenharmony_ci                                uvwasi_size_t si_data_len,
2781cb0ef41Sopenharmony_ci                                uvwasi_siflags_t si_flags,
2791cb0ef41Sopenharmony_ci                                uvwasi_size_t* so_datalen);
2801cb0ef41Sopenharmony_ciuvwasi_errno_t uvwasi_sock_shutdown(uvwasi_t* uvwasi,
2811cb0ef41Sopenharmony_ci                                    uvwasi_fd_t sock,
2821cb0ef41Sopenharmony_ci                                    uvwasi_sdflags_t how);
2831cb0ef41Sopenharmony_ci
2841cb0ef41Sopenharmony_ci#ifdef __cplusplus
2851cb0ef41Sopenharmony_ci}
2861cb0ef41Sopenharmony_ci#endif
2871cb0ef41Sopenharmony_ci
2881cb0ef41Sopenharmony_ci#endif /* __UVWASI_H__ */
289