X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Fnetdb.h;h=82c78dc8991826a04b1276f6967f48fd43f4ff1e;hb=de05a2ac22d33bd7631f182143ecea6dd01d9406;hp=a480d82f4ae94cb8924e6177683b69fd6f86ef7d;hpb=3777f5b90d25b2cafc5fd7be57580f1925fb5515;p=musl diff --git a/include/netdb.h b/include/netdb.h index a480d82f..82c78dc8 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -5,7 +5,7 @@ extern "C" { #endif -#ifdef _GNU_SOURCE +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define __NEED_size_t #endif @@ -118,7 +118,7 @@ struct protoent *getprotoent (void); struct protoent *getprotobyname (const char *); struct protoent *getprotobynumber (int); -#ifdef _GNU_SOURCE +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) const char *hstrerror(int); struct hostent *gethostbyname (const char *); int gethostbyname_r(const char *, struct hostent *, char *, size_t, struct hostent **, int *); @@ -128,7 +128,11 @@ struct hostent *gethostbyaddr (const void *, socklen_t, int); int gethostbyaddr_r(const void *, socklen_t, int, struct hostent *, char *, size_t, struct hostent **, int *); int getservbyport_r(int, const char *, struct servent *, char *, size_t, struct servent **); int getservbyname_r(const char *, const char *, struct servent *, char *, size_t, struct servent **); -extern int h_errno; +#ifdef __GNUC__ +__attribute__((const)) +#endif +int *__h_errno_location(void); +#define h_errno (*__h_errno_location()) #define EAI_NODATA -5 #define EAI_ADDRFAMILY -9 #define EAI_INPROGRESS -100