From 7ab7f97c4e7ba7c55b67ca5ad902366249e6e112 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Thu, 23 Feb 2023 17:47:48 -0500 Subject: [PATCH] deps: update uvwasi to v0.0.16 Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/46434 Refs: https://github.com/nodejs/uvwasi/pull/185 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- deps/uvwasi/include/uvwasi.h | 6 +++++- deps/uvwasi/include/wasi_types.h | 1 + deps/uvwasi/src/uvwasi.c | 9 +++++++++ deps/uvwasi/src/wasi_rights.h | 3 ++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/deps/uvwasi/include/uvwasi.h b/deps/uvwasi/include/uvwasi.h index 6d97c88537aa1e..b5da3108629792 100644 --- a/deps/uvwasi/include/uvwasi.h +++ b/deps/uvwasi/include/uvwasi.h @@ -10,7 +10,7 @@ extern "C" { #define UVWASI_VERSION_MAJOR 0 #define UVWASI_VERSION_MINOR 0 -#define UVWASI_VERSION_PATCH 15 +#define UVWASI_VERSION_PATCH 16 #define UVWASI_VERSION_HEX ((UVWASI_VERSION_MAJOR << 16) | \ (UVWASI_VERSION_MINOR << 8) | \ (UVWASI_VERSION_PATCH)) @@ -251,6 +251,10 @@ uvwasi_errno_t uvwasi_random_get(uvwasi_t* uvwasi, void* buf, uvwasi_size_t buf_len); uvwasi_errno_t uvwasi_sched_yield(uvwasi_t* uvwasi); +uvwasi_errno_t uvwasi_sock_accept(uvwasi_t* uvwasi, + uvwasi_fd_t sock, + uvwasi_fdflags_t flags, + uvwasi_fd_t* fd); uvwasi_errno_t uvwasi_sock_recv(uvwasi_t* uvwasi, uvwasi_fd_t sock, const uvwasi_iovec_t* ri_data, diff --git a/deps/uvwasi/include/wasi_types.h b/deps/uvwasi/include/wasi_types.h index 35e46a821b69fb..045c55288056c2 100644 --- a/deps/uvwasi/include/wasi_types.h +++ b/deps/uvwasi/include/wasi_types.h @@ -214,6 +214,7 @@ typedef uint64_t uvwasi_rights_t; /* Bitfield */ #define UVWASI_RIGHT_PATH_UNLINK_FILE (1 << 26) #define UVWASI_RIGHT_POLL_FD_READWRITE (1 << 27) #define UVWASI_RIGHT_SOCK_SHUTDOWN (1 << 28) +#define UVWASI_RIGHT_SOCK_ACCEPT (1 << 29) typedef uint16_t uvwasi_roflags_t; /* Bitfield */ #define UVWASI_SOCK_RECV_DATA_TRUNCATED (1 << 0) diff --git a/deps/uvwasi/src/uvwasi.c b/deps/uvwasi/src/uvwasi.c index 18885ee25961a6..38a6817cfdac30 100644 --- a/deps/uvwasi/src/uvwasi.c +++ b/deps/uvwasi/src/uvwasi.c @@ -2557,6 +2557,15 @@ uvwasi_errno_t uvwasi_sock_shutdown(uvwasi_t* uvwasi, return UVWASI_ENOTSUP; } +uvwasi_errno_t uvwasi_sock_accept(uvwasi_t* uvwasi, + uvwasi_fd_t sock, + uvwasi_fdflags_t flags, + uvwasi_fd_t* fd) { + /* TODO(mhdawson): Needs implementation */ + UVWASI_DEBUG("uvwasi_sock_accept(uvwasi=%p, unimplemented)\n", uvwasi); + return UVWASI_ENOTSUP; +}; + const char* uvwasi_embedder_err_code_to_string(uvwasi_errno_t code) { switch (code) { diff --git a/deps/uvwasi/src/wasi_rights.h b/deps/uvwasi/src/wasi_rights.h index fb19bd0a00e74e..09009b39889cc0 100644 --- a/deps/uvwasi/src/wasi_rights.h +++ b/deps/uvwasi/src/wasi_rights.h @@ -31,7 +31,8 @@ UVWASI_RIGHT_PATH_UNLINK_FILE | \ UVWASI_RIGHT_PATH_REMOVE_DIRECTORY | \ UVWASI_RIGHT_POLL_FD_READWRITE | \ - UVWASI_RIGHT_SOCK_SHUTDOWN) + UVWASI_RIGHT_SOCK_SHUTDOWN | \ + UVWASI_RIGHT_SOCK_ACCEPT) #define UVWASI__RIGHTS_BLOCK_DEVICE_BASE UVWASI__RIGHTS_ALL #define UVWASI__RIGHTS_BLOCK_DEVICE_INHERITING UVWASI__RIGHTS_ALL