LibC: Stub out some addrinfo things

This commit is contained in:
AnotherTest 2021-02-12 23:20:27 +03:30 committed by Andreas Kling
parent 4519950266
commit 0c07c005b5
Notes: sideshowbarker 2024-07-18 22:15:01 +09:00
2 changed files with 46 additions and 0 deletions

View file

@ -654,4 +654,23 @@ static bool fill_getproto_buffers(const char* line, ssize_t read)
return true;
}
int getaddrinfo(const char* __restrict node, const char* __restrict service, const struct addrinfo* __restrict hints, struct addrinfo** __restrict res)
{
(void)node;
(void)service;
(void)hints;
(void)res;
ASSERT_NOT_REACHED();
}
void freeaddrinfo(struct addrinfo* res)
{
(void)res;
ASSERT_NOT_REACHED();
}
const char* gai_strerror(int errcode)
{
(void)errcode;
return "Not yet implemented";
}
}

View file

@ -75,4 +75,31 @@ extern int h_errno;
#define NO_RECOVERY 103
#define TRY_AGAIN 104
struct addrinfo {
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
socklen_t ai_addrlen;
struct sockaddr* ai_addr;
char* ai_canonname;
struct addrinfo* ai_next;
};
#define EAI_ADDRFAMILY 1
#define EAI_AGAIN 2
#define EAI_BADFLAGS 3
#define EAI_FAIL 4
#define EAI_FAMILY 5
#define EAI_MEMORY 6
#define EAI_NODATA 7
#define EAI_NONAME 8
#define EAI_SERVICE 9
#define EAI_SOCKTYPE 10
#define EAI_SYSTEM 11
int getaddrinfo(const char* __restrict node, const char* __restrict service, const struct addrinfo* __restrict hints, struct addrinfo** __restrict res);
void freeaddrinfo(struct addrinfo* res);
const char* gai_strerror(int errcode);
__END_DECLS