From c3b09c72429a8a4093761449e0d99f9b7bf43478 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 20 Feb 2020 06:58:16 +0100 Subject: [PATCH] LibC: Add h_errno and stub out getservbyname() --- Libraries/LibC/netdb.cpp | 9 +++++++++ Libraries/LibC/netdb.h | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/Libraries/LibC/netdb.cpp b/Libraries/LibC/netdb.cpp index 8e07f13b6d..91f6142f10 100644 --- a/Libraries/LibC/netdb.cpp +++ b/Libraries/LibC/netdb.cpp @@ -37,6 +37,8 @@ extern "C" { +int h_errno; + static hostent __gethostbyname_buffer; static char __gethostbyname_name_buffer[512]; static in_addr_t __gethostbyname_address; @@ -196,4 +198,11 @@ hostent* gethostbyaddr(const void* addr, socklen_t addr_size, int type) return &__gethostbyaddr_buffer; } + +struct servent* getservbyname(const char* name, const char* protocol) +{ + dbg() << "FIXME: getservbyname(\"" << name << "\", \"" << protocol << "\")"; + ASSERT_NOT_REACHED(); +} + } diff --git a/Libraries/LibC/netdb.h b/Libraries/LibC/netdb.h index 6639852cb6..782ce4e0fc 100644 --- a/Libraries/LibC/netdb.h +++ b/Libraries/LibC/netdb.h @@ -52,4 +52,11 @@ struct servent { struct servent* getservbyname(const char* name, const char* protocol); +extern int h_errno; + +#define HOST_NOT_FOUND 101 +#define NO_DATA 102 +#define NO_RECOVERY 103 +#define TRY_AGAIN 104 + __END_DECLS