zephyr: add WASI socket support #3335
zephyr: add WASI socket support #3335lucasAbadFr wants to merge 9 commits intobytecodealliance:mainfrom
Conversation
| } | ||
| addr_pool_inited = true; | ||
|
|
||
| #if !defined(BH_PLATFORM_ZEPHYR) |
There was a problem hiding this comment.
Could you implement os_convert_stdin_handle, os_convert_stdout_handle, os_convert_stderr_handle and some other APIs if needed? It is strange that these critical codes are commented for zephy.
| bool abstime) REQUIRES_EXCLUSIVE(*lock) NO_LOCK_ANALYSIS | ||
| { | ||
| #if defined(BH_PLATFORM_ZEPHYR) | ||
| return false; |
There was a problem hiding this comment.
Will you implement it in the future? How about:
#if defined(BH_PLATFORM_ZEPHYR)
return false;
#endif| #include "refcount.h" | ||
| #include "rights.h" | ||
| #include "str.h" | ||
| #include "assert.h" |
There was a problem hiding this comment.
Seems no assert function is called? And no need to include "assert.h", just use bh_assert if needed.
| return convert_errno(errno); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Had better not add trailing spaces, or code guideline check CI will report error.
| __wasi_rights_t rights_inheriting) | ||
| TRYLOCKS_EXCLUSIVE(0, (*fo)->refcount) REQUIRES_EXCLUSIVE(ft->lock) | ||
| { | ||
| printf("[SSP] fd_object_get_locked\n"); |
There was a problem hiding this comment.
These printf will be removed in the future, right?
And had better use os_printf or LOG_XXX instead if needed, printf may be not supported in some platforms.
| src_addr->addr.ip4.addr.n1 = adjusted_addr_copy[2]; | ||
| src_addr->addr.ip4.addr.n2 = adjusted_addr_copy[1]; | ||
| src_addr->addr.ip4.addr.n3 = adjusted_addr_copy[0]; | ||
| src_addr->addr.ip4.port = adjusted_port_copy; |
| @@ -0,0 +1,17 @@ | |||
| #include "platform_api_extension.h" | |||
There was a problem hiding this comment.
Had better add license header
| @@ -0,0 +1,300 @@ | |||
| #include "platform_api_extension.h" | |||
There was a problem hiding this comment.
Had better add license header
| @@ -0,0 +1,1068 @@ | |||
| #include "platform_api_extension.h" | |||
There was a problem hiding this comment.
Had better add license header
| adjusted_addr.addr.ip4.addr.n1 = ip_addr[2]; | ||
| adjusted_addr.addr.ip4.addr.n2 = ip_addr[1]; | ||
| adjusted_addr.addr.ip4.addr.n3 = ip_addr[0]; | ||
| adjusted_addr.addr.ip4.port = ntohs(*port); |
|
I will close this pull request. I actually opened another one (#3633) for socket + file system. EDIT: The reviews were obviously taken in account. |
To address #3311