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