Skip to content

Commit

Permalink
deps: update uvwasi to v0.0.16
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Dawson <[email protected]>

PR-URL: #46434
Refs: nodejs/uvwasi#185
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
mhdawson authored and targos committed Mar 14, 2023
1 parent 92a6138 commit 7ab7f97
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
6 changes: 5 additions & 1 deletion deps/uvwasi/include/uvwasi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions deps/uvwasi/include/wasi_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions deps/uvwasi/src/uvwasi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion deps/uvwasi/src/wasi_rights.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7ab7f97

Please sign in to comment.