[riot-notifications] [RIOT-OS/RIOT] sys/posix: add module posix_netdb (#16853)

Martine Lenders notifications at github.com
Thu Sep 16 14:11:59 CEST 2021


@miri64 commented on this pull request.



> +#if LWIP_NETDB
+    return lwip_gethostbyname(name);
+#else
+    #error "There is not implementation of gethostbyname available"
+#endif

For all the functions here: I think it might be cleaner (and smaller) to provide our own implementation utilizing either `sock_dns` or `sock_udp` directly here. This would have multiple advantages:

- no stack-wise `#ifdefs`
- other DNS protocols than the standard DNS over UDP (see #16705 and #16861) and even completely different name-resolution protocols ([`netdb.h` spec does not mention DNS at all](https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/basedefs/netdb.h.html) and [`getaddrinfo` spec just says "In many cases it is implemented by the Domain Name System, […]"](https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/functions/getaddrinfo.html)) could be used here.

BTW, since I looked at the specs: `gethostbyname()` and its re-entrant counter-part where removed in POSIX.1-2008, so do we really want to support them and not rather fix libraries that still use them?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16853#pullrequestreview-756216693
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210916/99ee6ef3/attachment-0001.htm>


More information about the notifications mailing list