2 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 #ifndef _SUNW_PORT_AFTER_H
7 #define _SUNW_PORT_AFTER_H
14 * rename setnetgrent and endnetgrent which were formerly in a separate irs
15 * shared library. These functions should come from libc.so
17 #define setnetgrent res_setnetgrent
18 #ifdef SETNETGRENT_ARGS
19 void setnetgrent(SETNETGRENT_ARGS
);
21 void setnetgrent(const char *netgroup
);
24 #define endnetgrent res_endnetgrent
25 void endnetgrent(void);
29 * include ports for the public header files. ISC's versions are quite different
30 * from those currently in OpenSolaris.
34 #include <port_resolv.h>
35 #endif /* _RESOLV_H_ */
38 #include <port_netdb.h>
42 #include <arpa/port_inet.h>
43 #endif /* _ARPA_INET_H */
45 #ifdef _ARPA_NAMESER_H
46 #include <arpa/port_nameser.h>
47 #endif /* _ARPA_NAMESER_H */
50 #ifdef _ARPA_NAMESER_COMPAT_H
52 #endif /* _ARPA_NAMESER_COMPAT_H */
54 /* version-specific defines */
55 #include <os_version.h>
58 * Prior to 2.6, Solaris needs a prototype for gethostname().
60 #if (OS_MAJOR == 5 && OS_MINOR < 6)
61 extern int gethostname(char *, size_t);
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.
68 #if (OS_MAJOR == 5 && OS_MINOR < 5)
69 #define GET_HOST_ID_MISSING
70 #define NO_UNIX_REUSEADDR
71 #define USE_FIONBIO_IOCTL
74 #if (OS_MAJOR == 5 && OS_MINOR < 11)
76 extern char *strsep(char **, const char *);
81 * Solaris 2.5 and later have getrlimit(), setrlimit() and getrusage().
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
90 /* the default syslog facility of named/lwresd. */
92 #define ISC_FACILITY LOG_DAEMON
97 * Solaris 8 has if_nametoindex().
99 #if (OS_MAJOR > 5 || (OS_MAJOR == 5 && OS_MINOR >= 8))
100 #define USE_IFNAMELINKID
104 #if (OS_MAJOR == 5 && OS_MINOR > 8)
105 #define ALIGN(x) (((uintptr_t)(x) + (sizeof (char *) - 1UL)) & \
106 ~(sizeof (char *) - 1UL))
108 #define ALIGN(x) (((unsigned long)(x) + (sizeof (char *) - 1UL)) & \
109 ~(sizeof (char *) - 1UL))
112 #if (OS_MAJOR == 5 && OS_MINOR < 5)
113 #ifndef USE_FIONBIO_IOCTL
114 #define USE_FIONBIO_IOCTL 1
123 #endif /* _SUNW_PORT_AFTER_H */