1*9525b14bSRao Shoaib /* 2*9525b14bSRao Shoaib * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 3*9525b14bSRao Shoaib * Use is subject to license terms. 4*9525b14bSRao Shoaib */ 5*9525b14bSRao Shoaib 6*9525b14bSRao Shoaib #ifndef _SUNW_PORT_AFTER_H 7*9525b14bSRao Shoaib #define _SUNW_PORT_AFTER_H 8*9525b14bSRao Shoaib 9*9525b14bSRao Shoaib #ifdef __cplusplus 10*9525b14bSRao Shoaib extern "C" { 11*9525b14bSRao Shoaib #endif 12*9525b14bSRao Shoaib 13*9525b14bSRao Shoaib /* 14*9525b14bSRao Shoaib * rename setnetgrent and endnetgrent which were formerly in a separate irs 15*9525b14bSRao Shoaib * shared library. These functions should come from libc.so 16*9525b14bSRao Shoaib */ 17*9525b14bSRao Shoaib #define setnetgrent res_setnetgrent 18*9525b14bSRao Shoaib #ifdef SETNETGRENT_ARGS 19*9525b14bSRao Shoaib void setnetgrent(SETNETGRENT_ARGS); 20*9525b14bSRao Shoaib #else 21*9525b14bSRao Shoaib void setnetgrent(const char *netgroup); 22*9525b14bSRao Shoaib #endif 23*9525b14bSRao Shoaib 24*9525b14bSRao Shoaib #define endnetgrent res_endnetgrent 25*9525b14bSRao Shoaib void endnetgrent(void); 26*9525b14bSRao Shoaib 27*9525b14bSRao Shoaib 28*9525b14bSRao Shoaib /* 29*9525b14bSRao Shoaib * include ports for the public header files. ISC's versions are quite different 30*9525b14bSRao Shoaib * from those currently in OpenSolaris. 31*9525b14bSRao Shoaib */ 32*9525b14bSRao Shoaib 33*9525b14bSRao Shoaib #ifdef _RESOLV_H_ 34*9525b14bSRao Shoaib #include <port_resolv.h> 35*9525b14bSRao Shoaib #endif /* _RESOLV_H_ */ 36*9525b14bSRao Shoaib 37*9525b14bSRao Shoaib #ifdef _NETDB_H 38*9525b14bSRao Shoaib #include <port_netdb.h> 39*9525b14bSRao Shoaib #endif /* _NETDB_H */ 40*9525b14bSRao Shoaib 41*9525b14bSRao Shoaib #ifdef _ARPA_INET_H 42*9525b14bSRao Shoaib #include <arpa/port_inet.h> 43*9525b14bSRao Shoaib #endif /* _ARPA_INET_H */ 44*9525b14bSRao Shoaib 45*9525b14bSRao Shoaib #ifdef _ARPA_NAMESER_H 46*9525b14bSRao Shoaib #include <arpa/port_nameser.h> 47*9525b14bSRao Shoaib #endif /* _ARPA_NAMESER_H */ 48*9525b14bSRao Shoaib 49*9525b14bSRao Shoaib 50*9525b14bSRao Shoaib #ifdef _ARPA_NAMESER_COMPAT_H 51*9525b14bSRao Shoaib /* no changes */ 52*9525b14bSRao Shoaib #endif /* _ARPA_NAMESER_COMPAT_H */ 53*9525b14bSRao Shoaib 54*9525b14bSRao Shoaib /* version-specific defines */ 55*9525b14bSRao Shoaib #include <os_version.h> 56*9525b14bSRao Shoaib 57*9525b14bSRao Shoaib /* 58*9525b14bSRao Shoaib * Prior to 2.6, Solaris needs a prototype for gethostname(). 59*9525b14bSRao Shoaib */ 60*9525b14bSRao Shoaib #if (OS_MAJOR == 5 && OS_MINOR < 6) 61*9525b14bSRao Shoaib extern int gethostname(char *, size_t); 62*9525b14bSRao Shoaib #endif 63*9525b14bSRao Shoaib /* 64*9525b14bSRao Shoaib * gethostid() was not available until 2.5 65*9525b14bSRao Shoaib * setsockopt(SO_REUSEADDR) fails on unix domain sockets before 2.5 66*9525b14bSRao Shoaib * use ioctl(FIONBIO) rather than fcntl() calls to set/clear non-blocking i/o. 67*9525b14bSRao Shoaib */ 68*9525b14bSRao Shoaib #if (OS_MAJOR == 5 && OS_MINOR < 5) 69*9525b14bSRao Shoaib #define GET_HOST_ID_MISSING 70*9525b14bSRao Shoaib #define NO_UNIX_REUSEADDR 71*9525b14bSRao Shoaib #define USE_FIONBIO_IOCTL 72*9525b14bSRao Shoaib #endif 73*9525b14bSRao Shoaib 74*9525b14bSRao Shoaib #if (OS_MAJOR == 5 && OS_MINOR < 11) 75*9525b14bSRao Shoaib #define NEED_STRSEP 76*9525b14bSRao Shoaib extern char *strsep(char **, const char *); 77*9525b14bSRao Shoaib #endif 78*9525b14bSRao Shoaib 79*9525b14bSRao Shoaib 80*9525b14bSRao Shoaib /* 81*9525b14bSRao Shoaib * Solaris 2.5 and later have getrlimit(), setrlimit() and getrusage(). 82*9525b14bSRao Shoaib */ 83*9525b14bSRao Shoaib #if (OS_MAJOR > 5 || (OS_MAJOR == 5 && OS_MINOR >= 5)) 84*9525b14bSRao Shoaib #include <sys/resource.h> 85*9525b14bSRao Shoaib #define HAVE_GETRUSAGE 86*9525b14bSRao Shoaib #define RLIMIT_TYPE rlim_t 87*9525b14bSRao Shoaib #define RLIMIT_FILE_INFINITY 88*9525b14bSRao Shoaib #endif 89*9525b14bSRao Shoaib 90*9525b14bSRao Shoaib /* the default syslog facility of named/lwresd. */ 91*9525b14bSRao Shoaib #ifndef ISC_FACILITY 92*9525b14bSRao Shoaib #define ISC_FACILITY LOG_DAEMON 93*9525b14bSRao Shoaib #endif 94*9525b14bSRao Shoaib 95*9525b14bSRao Shoaib 96*9525b14bSRao Shoaib /* 97*9525b14bSRao Shoaib * Solaris 8 has if_nametoindex(). 98*9525b14bSRao Shoaib */ 99*9525b14bSRao Shoaib #if (OS_MAJOR > 5 || (OS_MAJOR == 5 && OS_MINOR >= 8)) 100*9525b14bSRao Shoaib #define USE_IFNAMELINKID 101*9525b14bSRao Shoaib #endif 102*9525b14bSRao Shoaib 103*9525b14bSRao Shoaib #undef ALIGN 104*9525b14bSRao Shoaib #if (OS_MAJOR == 5 && OS_MINOR > 8) 105*9525b14bSRao Shoaib #define ALIGN(x) (((uintptr_t)(x) + (sizeof (char *) - 1UL)) & \ 106*9525b14bSRao Shoaib ~(sizeof (char *) - 1UL)) 107*9525b14bSRao Shoaib #else 108*9525b14bSRao Shoaib #define ALIGN(x) (((unsigned long)(x) + (sizeof (char *) - 1UL)) & \ 109*9525b14bSRao Shoaib ~(sizeof (char *) - 1UL)) 110*9525b14bSRao Shoaib #endif 111*9525b14bSRao Shoaib 112*9525b14bSRao Shoaib #if (OS_MAJOR == 5 && OS_MINOR < 5) 113*9525b14bSRao Shoaib #ifndef USE_FIONBIO_IOCTL 114*9525b14bSRao Shoaib #define USE_FIONBIO_IOCTL 1 115*9525b14bSRao Shoaib #endif 116*9525b14bSRao Shoaib #endif 117*9525b14bSRao Shoaib 118*9525b14bSRao Shoaib 119*9525b14bSRao Shoaib #ifdef __cplusplus 120*9525b14bSRao Shoaib } 121*9525b14bSRao Shoaib #endif 122*9525b14bSRao Shoaib 123*9525b14bSRao Shoaib #endif /* _SUNW_PORT_AFTER_H */ 124