From ab3eacdf3106cb0b4027a6d928d9555815af0b48 Mon Sep 17 00:00:00 2001 From: ume Date: Fri, 12 May 2006 15:37:23 +0000 Subject: Fix gethostbyaddr() prototype to conform to IEEE Std 1003.1: http://www.opengroup.org/onlinepubs/009695399/functions/gethostbyaddr.html gethostbyaddr_r() is changed as well. It breaks ABI backward compatibility on 64 bit arch. So, we fix it on 32 bit arch only for now. Reported by: Rostislav Krasny --- include/netdb.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include/netdb.h') diff --git a/include/netdb.h b/include/netdb.h index 218bee3..6e7d818 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -63,6 +63,7 @@ #include #include +#include #ifndef _SIZE_T_DECLARED typedef __size_t size_t; @@ -220,9 +221,15 @@ void endnetgrent(void); void endprotoent(void); void endservent(void); void freehostent(struct hostent *); -struct hostent *gethostbyaddr(const char *, int, int); -int gethostbyaddr_r(const char *, int, int, struct hostent *, +#if __LONG_BIT == 64 +struct hostent *gethostbyaddr(const void *, int, int); +int gethostbyaddr_r(const void *, int, int, struct hostent *, char *, size_t, struct hostent **, int *); +#else +struct hostent *gethostbyaddr(const void *, socklen_t, int); +int gethostbyaddr_r(const void *, socklen_t, int, struct hostent *, + char *, size_t, struct hostent **, int *); +#endif struct hostent *gethostbyname(const char *); int gethostbyname_r(const char *, struct hostent *, char *, size_t, struct hostent **, int *); -- cgit v1.1