Hash :
b4417f75
Author :
Date :
2010-11-30T21:27:21
getdomainname: Use the system function when possible. * lib/unistd.in.h: Include <netdb.h>, for getdomainname's declaration. (getdomainname): Replace if needed. Provide the declaration if it is missing. Don't use _GL_CXXALIAS_SYS_CAST. * lib/getdomainname.c: Include <limits.h> and <sys/systeminfo.h>. (getdomainname): When the system has getdomainname, call the system function. When sysinfo (SI_SRPC_DOMAIN, ...) is possible, use that. * m4/getdomainname.m4 (gl_FUNC_GETDOMAINNAME): Require gl_HEADER_SYS_SOCKET and gl_HEADER_NETDB. Test whether the function is found in libnsl. Look for the declaration also in <netdb.h>. Replace the function if its second argument is of type 'int' or if it is found in libnsl. (gl_PREREQ_GETDOMAINNAME): Define HAVE_GETDOMAINNAME. Check for <sys/systeminfo.h> and sysinfo(). * modules/getdomainname (Depends-on): Add netdb, sys_socket. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize HAVE_DECL_GETDOMAINNAME and REPLACE_GETDOMAINNAME instead of HAVE_GETDOMAINNAME. * modules/unistd (Makefile.am): Substitute HAVE_DECL_GETDOMAINNAME and REPLACE_GETDOMAINNAME instead of HAVE_GETDOMAINNAME. * doc/glibc-functions/getdomainname.texi: Document the problems with the getdomainname declaration.
@node getdomainname
@subsection @code{getdomainname}
@findex getdomainname
Gnulib module: getdomainname
Portability problems fixed by Gnulib:
@itemize
@item
This function is missing on some platforms:
Solaris 11 2010-11, mingw, Interix 3.5, BeOS.
@item
This function is declared in @code{netdb.h}, not in @code{unistd.h}, on
some platforms:
AIX 7.1.
@item
This function is declared in @code{netdb.h} and in @code{sys/socket.h}, not
in @code{unistd.h}, on some platforms:
OSF/1 5.1.
@item
The second argument is of type @code{int}, not @code{size_t}, on some platforms:
MacOS X 10.5, FreeBSD 6.4, AIX 7.1, IRIX 6.5.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@end itemize