mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibC: Add definition for the NI_NAMEREQD macro
This commit is contained in:
parent
ea6d0aa1d4
commit
7d12c08bec
Notes:
sideshowbarker
2024-07-18 20:23:22 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/7d12c08bec8 Pull-request: https://github.com/SerenityOS/serenity/pull/6307 Reviewed-by: https://github.com/awesomekling
2 changed files with 4 additions and 2 deletions
|
@ -794,14 +794,15 @@ const char* gai_strerror(int errcode)
|
|||
|
||||
int getnameinfo(const struct sockaddr* __restrict addr, socklen_t addrlen, char* __restrict host, socklen_t hostlen, char* __restrict serv, socklen_t servlen, int flags)
|
||||
{
|
||||
(void)flags;
|
||||
|
||||
if (addr->sa_family != AF_INET || addrlen < sizeof(sockaddr_in))
|
||||
return EAI_FAMILY;
|
||||
|
||||
const sockaddr_in* sin = reinterpret_cast<const sockaddr_in*>(addr);
|
||||
|
||||
if (host && hostlen > 0) {
|
||||
if (flags & NI_NAMEREQD)
|
||||
dbgln("getnameinfo flag NI_NAMEREQD not implemented");
|
||||
|
||||
if (!inet_ntop(AF_INET, &sin->sin_addr, host, hostlen)) {
|
||||
if (errno == ENOSPC)
|
||||
return EAI_OVERFLOW;
|
||||
|
|
|
@ -112,6 +112,7 @@ struct addrinfo {
|
|||
|
||||
#define NI_NUMERICHOST 1
|
||||
#define NI_NUMERICSERV 2
|
||||
#define NI_NAMEREQD 3
|
||||
|
||||
int getaddrinfo(const char* __restrict node, const char* __restrict service, const struct addrinfo* __restrict hints, struct addrinfo** __restrict res);
|
||||
void freeaddrinfo(struct addrinfo* res);
|
||||
|
|
Loading…
Reference in a new issue