Print this page
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/lib/libresolv2/include/port_before.h
+++ new/usr/src/lib/libresolv2/include/port_before.h
1 1 /*
2 - * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
2 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
3 3 * Use is subject to license terms.
4 4 */
5 5
6 -#pragma ident "%Z%%M% %I% %E% SMI"
7 6
8 -#ifdef SUNW_OPTIONS
9 -#include "conf/sunoptions.h"
7 +/*
8 + * Copyright (C) 2005-2008 Internet Systems Consortium, Inc. ("ISC")
9 + * Copyright (C) 2001 Internet Software Consortium.
10 + *
11 + * Permission to use, copy, modify, and/or distribute this software for any
12 + * purpose with or without fee is hereby granted, provided that the above
13 + * copyright notice and this permission notice appear in all copies.
14 + *
15 + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
16 + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
17 + * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
18 + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
19 + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
20 + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21 + * PERFORMANCE OF THIS SOFTWARE.
22 + */
23 +
24 +/* $Id: port_before.h.in,v 1.31 2008/02/28 05:36:10 marka Exp $ */
25 +
26 +#ifndef port_before_h
27 +#define port_before_h
28 +/* Solaris-specific changes */
29 +#include "sunw_port_before.h"
30 +#include <config.h>
31 +
32 +#ifdef NEED_SUN4PROTOS
33 +#define _PARAMS(x) x
10 34 #endif
11 35
12 -#define __EXTENSIONS__
13 -/* #define SVR4 */
14 -#ifdef WANT_IRS_NIS
15 -#undef WANT_IRS_NIS
36 +struct group; /* silence warning */
37 +struct passwd; /* silence warning */
38 +struct timeval; /* silence warning */
39 +struct timezone; /* silence warning */
40 +
41 +#ifdef HAVE_SYS_TIMERS_H
42 +#include <sys/timers.h>
16 43 #endif
17 -#undef WANT_IRS_PW
18 -#undef WANT_IRS_GR
19 -#define SIG_FN void
20 -#define ISC_SOCKLEN_T int
21 -#include "os_version.h"
22 -#if (OS_MAJOR == 5 && OS_MINOR < 5)
23 -#undef HAS_PTHREADS
24 -#else
25 -#define HAS_PTHREADS
26 -#endif
44 +#include <limits.h>
27 45
28 -#if defined(HAS_PTHREADS) && defined(_REENTRANT)
29 -#define DO_PTHREADS
46 +#ifdef ISC_PLATFORM_NEEDTIMESPEC
47 +#include <time.h> /* For time_t */
48 +struct timespec {
49 + time_t tv_sec; /* seconds */
50 + long tv_nsec; /* nanoseconds */
51 +};
30 52 #endif
53 +#ifndef HAVE_MEMMOVE
54 +#define memmove(a,b,c) bcopy(b,a,c)
55 +#endif
31 56
57 +#undef WANT_IRS_GR
58 +#undef WANT_IRS_NIS
59 +#undef WANT_IRS_PW
60 +
61 +#define BSD_COMP 1
62 +#define USE_POLL 1
63 +#define HAVE_MD5 1
64 +#define SOLARIS2 1
65 +
66 +/* DO_PTHREADS is conditionally defined in sunw_port_before.h
67 + * #define DO_PTHREADS 1 */
68 +#define GETGROUPLIST_ARGS const char *name, gid_t basegid, gid_t *groups, int *ngroups
69 +#define GETNETBYADDR_ADDR_T long
70 +#define SETPWENT_VOID 1
71 +#define SETGRENT_VOID 1
72 +
73 +#define NET_R_ARGS char *buf, int buflen
74 +#define NET_R_BAD NULL
75 +#define NET_R_COPY buf, buflen
76 +#define NET_R_COPY_ARGS NET_R_ARGS
77 +#define NET_R_END_RESULT(x) /*empty*/
78 +#define NET_R_END_RETURN void
79 +#undef NET_R_ENT_ARGS /*empty*/
80 +#define NET_R_OK nptr
81 +#define NET_R_RETURN struct netent *
82 +#undef NET_R_SET_RESULT /*empty*/
83 +#undef NET_R_SETANSWER
84 +#define NET_R_SET_RETURN void
85 +#undef NETENT_DATA
86 +
32 87 #define GROUP_R_RETURN struct group *
33 88 #define GROUP_R_SET_RETURN void
34 89 #undef GROUP_R_SET_RESULT /*empty*/
35 90 #define GROUP_R_END_RETURN void
36 -#undef GROUP_R_END_RESULT /*empty*/
91 +#define GROUP_R_END_RESULT(x) /*empty*/
37 92 #define GROUP_R_ARGS char *buf, int buflen
38 -#undef GROUP_R_ENT_ARGS /*empty*/
93 +#define GROUP_R_ENT_ARGS void
39 94 #define GROUP_R_OK gptr
40 95 #define GROUP_R_BAD NULL
41 -#define GETGROUPLIST_ARGS const char *name, gid_t basegid, gid_t *groups, \
42 - int *ngroups
43 96
44 -#define HOST_R_RETURN struct hostent *
45 -#define HOST_R_SET_RETURN void
46 -#undef HOST_R_SET_RESULT /*empty*/
47 -#define HOST_R_END_RETURN void
48 -#define HOST_R_END_RESULT(x) /*empty*/
49 97 #define HOST_R_ARGS char *buf, int buflen, int *h_errnop
50 -#undef HOST_R_ENT_ARGS /*empty*/
98 +#define HOST_R_BAD NULL
51 99 #define HOST_R_COPY buf, buflen
52 100 #define HOST_R_COPY_ARGS char *buf, int buflen
101 +#define HOST_R_END_RESULT(x) /*empty*/
102 +#define HOST_R_END_RETURN void
103 +#undef HOST_R_ENT_ARGS /*empty*/
53 104 #define HOST_R_ERRNO *h_errnop = h_errno
54 105 #define HOST_R_OK hptr
55 -#define HOST_R_BAD NULL
106 +#define HOST_R_RETURN struct hostent *
107 +#undef HOST_R_SETANSWER
108 +#undef HOST_R_SET_RESULT
109 +#define HOST_R_SET_RETURN void
110 +#undef HOSTENT_DATA
56 111
57 -#define NET_R_RETURN struct netent *
58 -#define NET_R_SET_RETURN void
59 -#undef NET_R_SET_RESULT /*empty*/
60 -#define NET_R_END_RETURN void
61 -#define NET_R_END_RESULT(x) /*empty*/
62 -#define NET_R_ARGS char *buf, int buflen
63 -#undef NET_R_ENT_ARGS /*empty*/
64 -#define NET_R_COPY buf, buflen
65 -#define NET_R_COPY_ARGS NET_R_ARGS
66 -#define NET_R_OK nptr
67 -#define NET_R_BAD NULL
68 -
69 -#define NGR_R_RETURN int
70 -#define NGR_R_SET_RETURN void
71 -#undef NGR_R_SET_RESULT /*empty*/
72 -#define NGR_R_END_RETURN void
73 -#ifdef ORIGINAL_ISC_CODE
74 -#undef NGR_R_END_RESULT /*empty*/
75 -#else
76 -#define NGR_R_END_RESULT(x) /*empty*/
77 -#endif
78 112 #define NGR_R_ARGS char *buf, int buflen
79 -#undef NGR_R_ENT_ARGS /*empty*/
113 +#define NGR_R_BAD (0)
80 114 #define NGR_R_COPY buf, buflen
81 115 #define NGR_R_COPY_ARGS NGR_R_ARGS
116 +#define NGR_R_CONST
117 +#define NGR_R_END_RESULT(x) /*empty*/
118 +#define NGR_R_END_RETURN void
119 +#undef NGR_R_END_ARGS /*empty*/
82 120 #define NGR_R_OK 1
83 -#define NGR_R_BAD (0)
121 +#define NGR_R_RETURN int
122 +#define NGR_R_SET_CONST const
123 +#undef NGR_R_SET_RESULT /*empty*/
124 +#define NGR_R_SET_RETURN void
125 +#undef NGR_R_SET_ARGS
84 126
85 -#define PROTO_R_RETURN struct protoent *
86 -#define PROTO_R_SET_RETURN void
87 -#undef PROTO_R_SET_RESULT /*empty*/
88 -#define PROTO_R_END_RETURN void
89 -#define PROTO_R_END_RESULT(x) /*empty*/
127 +
128 +#if !defined(NGR_R_SET_ARGS) && defined(NGR_R_END_ARGS)
129 +#define NGR_R_SET_ARGS NGR_R_END_ARGS
130 +#endif
131 +
90 132 #define PROTO_R_ARGS char *buf, int buflen
91 -#undef PROTO_R_ENT_ARGS /*empty*/
133 +#define PROTO_R_BAD NULL
92 134 #define PROTO_R_COPY buf, buflen
93 135 #define PROTO_R_COPY_ARGS PROTO_R_ARGS
136 +#define PROTO_R_END_RESULT(x) /*empty*/
137 +#define PROTO_R_END_RETURN void
138 +#undef PROTO_R_ENT_ARGS /*empty*/
139 +#undef PROTO_R_ENT_UNUSED
94 140 #define PROTO_R_OK pptr
95 -#define PROTO_R_BAD NULL
141 +#undef PROTO_R_SETANSWER
142 +#define PROTO_R_RETURN struct protoent *
143 +#undef PROTO_R_SET_RESULT
144 +#define PROTO_R_SET_RETURN void
145 +#undef PROTOENT_DATA
96 146
97 -#define PASS_R_RETURN struct passwd *
98 -#define PASS_R_SET_RETURN void
99 -#undef PASS_R_SET_RESULT /*empty*/
100 -#define PASS_R_END_RETURN void
101 -#undef PASS_R_END_RESULT /*empty*/
102 147 #define PASS_R_ARGS char *buf, int buflen
103 -#undef PASS_R_ENT_ARGS /*empty*/
148 +#define PASS_R_BAD NULL
104 149 #define PASS_R_COPY buf, buflen
105 150 #define PASS_R_COPY_ARGS PASS_R_ARGS
151 +#define PASS_R_END_RESULT(x) /*empty*/
152 +#define PASS_R_END_RETURN void
153 +#undef PASS_R_ENT_ARGS
106 154 #define PASS_R_OK pwptr
107 -#define PASS_R_BAD NULL
155 +#define PASS_R_RETURN struct passwd *
156 +#undef PASS_R_SET_RESULT /*empty*/
157 +#define PASS_R_SET_RETURN void
108 158
109 -#define SERV_R_RETURN struct servent *
110 -#define SERV_R_SET_RETURN void
111 -#undef SERV_R_SET_RESULT /*empty*/
112 -#define SERV_R_END_RETURN void
113 -#define SERV_R_END_RESULT(x) /*empty*/
114 159 #define SERV_R_ARGS char *buf, int buflen
115 -#undef SERV_R_ENT_ARGS /*empty*/
160 +#define SERV_R_BAD NULL
116 161 #define SERV_R_COPY buf, buflen
117 162 #define SERV_R_COPY_ARGS SERV_R_ARGS
163 +#define SERV_R_END_RESULT(x) /*empty*/
164 +#define SERV_R_END_RETURN void
165 +#undef SERV_R_ENT_ARGS /*empty*/
166 +#undef SERV_R_ENT_UNUSED /*empty*/
118 167 #define SERV_R_OK sptr
119 -#define SERV_R_BAD NULL
168 +#undef SERV_R_SETANSWER
169 +#define SERV_R_RETURN struct servent *
170 +#undef SERV_R_SET_RESULT
171 +#define SERV_R_SET_RETURN void
120 172
121 -/* make #include <sys/ioctl.h> also #include <sys/sockio.h> */
122 -#define BSD_COMP
123 173
124 -#include <limits.h> /* _POSIX_PATH_MAX */
125 174
175 +#define DE_CONST(konst, var) \
176 + do { \
177 + union { const void *k; void *v; } _u; \
178 + _u.k = konst; \
179 + var = _u.v; \
180 + } while (0)
181 +
182 +#define UNUSED(x) (x) = (x)
183 +
184 +#undef NEED_SOLARIS_BITTYPES
185 +#define ISC_SOCKLEN_T int
186 +
126 187 #ifdef __GNUC__
127 188 #define ISC_FORMAT_PRINTF(fmt, args) \
128 189 __attribute__((__format__(__printf__, fmt, args)))
129 190 #else
130 191 #define ISC_FORMAT_PRINTF(fmt, args)
131 192 #endif
132 193
133 -/*
134 - * Remove compiler warnings without modifying ISC source by including
135 - * various headers here, mostly to get function prototypes.
136 - */
137 -#include <string.h>
138 -#include <strings.h>
139 -#include <unistd.h>
194 +/* Pull in host order macros when _XOPEN_SOURCE_EXTENDED is defined. */
195 +#if defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)
196 +#include <sys/byteorder.h>
197 +#endif
140 198
141 -#include <sys/types.h>
142 -#include "sys/bitypes.h"
143 -#include "sys/cdefs.h"
199 +#endif
144 200
145 -#define HAS_INET6_STRUCTS
146 -#define H_ERRNO_IS_FUNCTION
201 +/*! \file */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX