2 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
8 * Copyright (C) 2005-2008 Internet Systems Consortium, Inc. ("ISC")
9 * Copyright (C) 2001 Internet Software Consortium.
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.
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.
24 /* $Id: port_before.h.in,v 1.31 2008/02/28 05:36:10 marka Exp $ */
28 /* Solaris-specific changes */
29 #include "sunw_port_before.h"
32 #ifdef NEED_SUN4PROTOS
36 struct group
; /* silence warning */
37 struct passwd
; /* silence warning */
38 struct timeval
; /* silence warning */
39 struct timezone
; /* silence warning */
41 #ifdef HAVE_SYS_TIMERS_H
42 #include <sys/timers.h>
46 #ifdef ISC_PLATFORM_NEEDTIMESPEC
47 #include <time.h> /* For time_t */
49 time_t tv_sec
; /* seconds */
50 long tv_nsec
; /* nanoseconds */
54 #define memmove(a,b,c) bcopy(b,a,c)
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
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*/
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
87 #define GROUP_R_RETURN struct group *
88 #define GROUP_R_SET_RETURN void
89 #undef GROUP_R_SET_RESULT /*empty*/
90 #define GROUP_R_END_RETURN void
91 #define GROUP_R_END_RESULT(x) /*empty*/
92 #define GROUP_R_ARGS char *buf, int buflen
93 #define GROUP_R_ENT_ARGS void
94 #define GROUP_R_OK gptr
95 #define GROUP_R_BAD NULL
97 #define HOST_R_ARGS char *buf, int buflen, int *h_errnop
98 #define HOST_R_BAD NULL
99 #define HOST_R_COPY buf, buflen
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*/
104 #define HOST_R_ERRNO *h_errnop = h_errno
105 #define HOST_R_OK hptr
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
112 #define NGR_R_ARGS char *buf, int buflen
113 #define NGR_R_BAD (0)
114 #define NGR_R_COPY buf, buflen
115 #define NGR_R_COPY_ARGS NGR_R_ARGS
117 #define NGR_R_END_RESULT(x) /*empty*/
118 #define NGR_R_END_RETURN void
119 #undef NGR_R_END_ARGS /*empty*/
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
128 #if !defined(NGR_R_SET_ARGS) && defined(NGR_R_END_ARGS)
129 #define NGR_R_SET_ARGS NGR_R_END_ARGS
132 #define PROTO_R_ARGS char *buf, int buflen
133 #define PROTO_R_BAD NULL
134 #define PROTO_R_COPY buf, buflen
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
140 #define PROTO_R_OK pptr
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
147 #define PASS_R_ARGS char *buf, int buflen
148 #define PASS_R_BAD NULL
149 #define PASS_R_COPY buf, buflen
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
154 #define PASS_R_OK pwptr
155 #define PASS_R_RETURN struct passwd *
156 #undef PASS_R_SET_RESULT /*empty*/
157 #define PASS_R_SET_RETURN void
159 #define SERV_R_ARGS char *buf, int buflen
160 #define SERV_R_BAD NULL
161 #define SERV_R_COPY buf, buflen
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*/
167 #define SERV_R_OK sptr
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
175 #define DE_CONST(konst, var) \
177 union { const void *k; void *v; } _u; \
182 #define UNUSED(x) (x) = (x)
184 #undef NEED_SOLARIS_BITTYPES
185 #define ISC_SOCKLEN_T socklen_t
188 #define ISC_FORMAT_PRINTF(fmt, args) \
189 __attribute__((__format__(__printf__, fmt, args)))
191 #define ISC_FORMAT_PRINTF(fmt, args)
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>