You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wasi-sockets: Add services database and implement getservbyname/getservbyport functions (#532)
This is a follow-up PR for #524 by implementing the following features:
- Embeds a minimal network services database with 17 common protocols,
suggested by @badeend. The database array is a weak symbol allowing
applications to override the default database at link time.
- Updates `getaddrinfo` to resolve named services in the address info.
For example `getaddrinfo("google.com", "https", NULL, &res);`
- Implements the `getservbyname` and `getservbyport` functions. These
functions are implemented using a static variable (`global_serv`), which
holds the returned service entry. This approach is acceptable because
these functions [are defined as not being
thread-safe](https://man.archlinux.org/man/getservbyname.3.en).
~~Additionally, this PR introduces an optional, more comprehensive
services database (`sockets_full_services_db.c`), based on Debian
Bookworm's `/etc/services` file (320 entries). To use this database,
link with the `-lc-full-services-db` flag.~~
0 commit comments