--- include/ac/socket.h 2002/01/04 19:40:30 1.54 +++ include/ac/socket.h 2003/03/05 23:48:31 1.54.2.3 @@ -1,7 +1,7 @@ /* Generic socket.h */ -/* $OpenLDAP: pkg/ldap/include/ac/socket.h,v 1.53 2001/12/28 05:12:17 hyc Exp $ */ +/* $OpenLDAP: pkg/ldap/include/ac/socket.h,v 1.54.2.2 2003/02/09 17:02:17 kurt Exp $ */ /* - * Copyright 1998-2002 The OpenLDAP Foundation, Redwood City, California, USA + * Copyright 1998-2003 The OpenLDAP Foundation, Redwood City, California, USA * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -81,7 +81,7 @@ # define ioctl_t u_long # define AC_SOCKET_INVALID ((unsigned int) ~0) -# if SD_BOTH +# ifdef SD_BOTH # define tcp_close( s ) (shutdown( s, SD_BOTH ), closesocket( s )) # else # define tcp_close( s ) closesocket( s ) @@ -127,7 +127,7 @@ LBER_F( char * ) ber_pvt_wsa_err2string # define tcp_read( s, buf, len) read( s, buf, len ) # define tcp_write( s, buf, len) write( s, buf, len ) -# if SHUT_RDWR +# ifdef SHUT_RDWR # define tcp_close( s ) (shutdown( s, SHUT_RDWR ), close( s )) # else # define tcp_close( s ) close( s ) @@ -197,8 +197,17 @@ LDAP_F (int) ldap_pvt_inet_aton LDAP_P(( # define AC_GAI_STRERROR(x) (gai_strerror((x))) # else # define AC_GAI_STRERROR(x) (ldap_pvt_gai_strerror((x))) - char * ldap_pvt_gai_strerror( int ); + LDAP_F (char *) ldap_pvt_gai_strerror( int ); # endif #endif +#ifndef HAVE_GETPEEREID +LDAP_LUTIL_F( int ) getpeereid( int s, uid_t *, gid_t * ); +#endif + +/* DNS RFC defines max host name as 255. New systems seem to use 1024 */ +#ifndef NI_MAXHOST +#define NI_MAXHOST 256 +#endif + #endif /* _AC_SOCKET_H_ */