Enhance sock_addr_local syscall (#1320)
Slightly change the __wasi_sock_addr_local interface - since we already have a `__wasi_addr_t` structure which is an union, there's no need for passing the length around - the address buffer will always have the right length (i.e. max of all address families).
This commit is contained in:
@ -105,7 +105,7 @@ htonl(uint32 value)
|
||||
return value;
|
||||
}
|
||||
|
||||
static uint32
|
||||
uint32
|
||||
ntohl(uint32 value)
|
||||
{
|
||||
return htonl(value);
|
||||
@ -632,4 +632,13 @@ os_socket_addr_resolve(const char *host, const char *service,
|
||||
return BHT_ERROR;
|
||||
}
|
||||
|
||||
int
|
||||
os_socket_addr_local(bh_socket_t socket, uint8_t *buf, size_t buflen,
|
||||
uint16_t *port, uint8_t *is_ipv4)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
|
||||
return BHT_ERROR;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -95,6 +95,9 @@ struct sockaddr {
|
||||
char sa_data[14]; /* Address data. */
|
||||
};
|
||||
|
||||
uint32_t
|
||||
ntohl(uint32_t value);
|
||||
|
||||
int
|
||||
socket(int domain, int type, int protocol);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user