diff options
author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2006-05-12 15:37:23 +0000 |
---|---|---|
committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2006-05-12 15:37:23 +0000 |
commit | 3da59cd0072b20be9464c3f0afe83579fc83909c (patch) | |
tree | 164cb97bf2cd0fc04b8135b782152c0960ca3354 /include/netdb.h | |
parent | b484e04bf9e39dfee879785d3be04753ce5f3635 (diff) | |
download | src-test2-3da59cd0072b20be9464c3f0afe83579fc83909c.tar.gz src-test2-3da59cd0072b20be9464c3f0afe83579fc83909c.zip |
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 <rosti.bsd@gmail.com>
Notes
Notes:
svn path=/head/; revision=158477
Diffstat (limited to 'include/netdb.h')
-rw-r--r-- | include/netdb.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/netdb.h b/include/netdb.h index 218bee3f79d4..6e7d8189695a 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -63,6 +63,7 @@ #include <sys/cdefs.h> #include <sys/_types.h> +#include <machine/_limits.h> #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 *); |