diff options
author | ume <ume@FreeBSD.org> | 2006-05-12 15:37:23 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2006-05-12 15:37:23 +0000 |
commit | ab3eacdf3106cb0b4027a6d928d9555815af0b48 (patch) | |
tree | 164cb97bf2cd0fc04b8135b782152c0960ca3354 /include | |
parent | 08978d5bee9bfc81ae25a6b3a8971577532cc9aa (diff) | |
download | FreeBSD-src-ab3eacdf3106cb0b4027a6d928d9555815af0b48.zip FreeBSD-src-ab3eacdf3106cb0b4027a6d928d9555815af0b48.tar.gz |
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>
Diffstat (limited to 'include')
-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 218bee3..6e7d818 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 *); |