xref: /onnv-gate/usr/src/lib/libresolv2/include/port_before.h (revision 11038:74b12212b8a2)
10Sstevel@tonic-gate /*
2*11038SRao.Shoaib@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
30Sstevel@tonic-gate  * Use is subject to license terms.
40Sstevel@tonic-gate  */
50Sstevel@tonic-gate 
60Sstevel@tonic-gate 
7*11038SRao.Shoaib@Sun.COM /*
8*11038SRao.Shoaib@Sun.COM  * Copyright (C) 2005-2008  Internet Systems Consortium, Inc. ("ISC")
9*11038SRao.Shoaib@Sun.COM  * Copyright (C) 2001  Internet Software Consortium.
10*11038SRao.Shoaib@Sun.COM  *
11*11038SRao.Shoaib@Sun.COM  * Permission to use, copy, modify, and/or distribute this software for any
12*11038SRao.Shoaib@Sun.COM  * purpose with or without fee is hereby granted, provided that the above
13*11038SRao.Shoaib@Sun.COM  * copyright notice and this permission notice appear in all copies.
14*11038SRao.Shoaib@Sun.COM  *
15*11038SRao.Shoaib@Sun.COM  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
16*11038SRao.Shoaib@Sun.COM  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
17*11038SRao.Shoaib@Sun.COM  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
18*11038SRao.Shoaib@Sun.COM  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
19*11038SRao.Shoaib@Sun.COM  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
20*11038SRao.Shoaib@Sun.COM  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21*11038SRao.Shoaib@Sun.COM  * PERFORMANCE OF THIS SOFTWARE.
22*11038SRao.Shoaib@Sun.COM  */
23*11038SRao.Shoaib@Sun.COM 
24*11038SRao.Shoaib@Sun.COM /* $Id: port_before.h.in,v 1.31 2008/02/28 05:36:10 marka Exp $ */
25*11038SRao.Shoaib@Sun.COM 
26*11038SRao.Shoaib@Sun.COM #ifndef port_before_h
27*11038SRao.Shoaib@Sun.COM #define port_before_h
28*11038SRao.Shoaib@Sun.COM /* Solaris-specific changes */
29*11038SRao.Shoaib@Sun.COM #include "sunw_port_before.h"
30*11038SRao.Shoaib@Sun.COM #include <config.h>
31*11038SRao.Shoaib@Sun.COM 
32*11038SRao.Shoaib@Sun.COM #ifdef NEED_SUN4PROTOS
33*11038SRao.Shoaib@Sun.COM #define _PARAMS(x) x
340Sstevel@tonic-gate #endif
350Sstevel@tonic-gate 
36*11038SRao.Shoaib@Sun.COM struct group;           /* silence warning */
37*11038SRao.Shoaib@Sun.COM struct passwd;          /* silence warning */
38*11038SRao.Shoaib@Sun.COM struct timeval;         /* silence warning */
39*11038SRao.Shoaib@Sun.COM struct timezone;        /* silence warning */
40*11038SRao.Shoaib@Sun.COM 
41*11038SRao.Shoaib@Sun.COM #ifdef HAVE_SYS_TIMERS_H
42*11038SRao.Shoaib@Sun.COM #include <sys/timers.h>
430Sstevel@tonic-gate #endif
44*11038SRao.Shoaib@Sun.COM #include <limits.h>
45*11038SRao.Shoaib@Sun.COM 
46*11038SRao.Shoaib@Sun.COM #ifdef ISC_PLATFORM_NEEDTIMESPEC
47*11038SRao.Shoaib@Sun.COM #include <time.h>		/* For time_t */
48*11038SRao.Shoaib@Sun.COM struct timespec {
49*11038SRao.Shoaib@Sun.COM 	time_t  tv_sec;         /* seconds */
50*11038SRao.Shoaib@Sun.COM 	long    tv_nsec;        /* nanoseconds */
51*11038SRao.Shoaib@Sun.COM };
52*11038SRao.Shoaib@Sun.COM #endif
53*11038SRao.Shoaib@Sun.COM #ifndef HAVE_MEMMOVE
54*11038SRao.Shoaib@Sun.COM #define memmove(a,b,c) bcopy(b,a,c)
550Sstevel@tonic-gate #endif
560Sstevel@tonic-gate 
57*11038SRao.Shoaib@Sun.COM #undef WANT_IRS_GR
58*11038SRao.Shoaib@Sun.COM #undef WANT_IRS_NIS
59*11038SRao.Shoaib@Sun.COM #undef WANT_IRS_PW
60*11038SRao.Shoaib@Sun.COM 
61*11038SRao.Shoaib@Sun.COM #define BSD_COMP 1
62*11038SRao.Shoaib@Sun.COM #define USE_POLL 1
63*11038SRao.Shoaib@Sun.COM #define HAVE_MD5 1
64*11038SRao.Shoaib@Sun.COM #define SOLARIS2 1
65*11038SRao.Shoaib@Sun.COM 
66*11038SRao.Shoaib@Sun.COM /* DO_PTHREADS is conditionally defined in sunw_port_before.h
67*11038SRao.Shoaib@Sun.COM  * #define DO_PTHREADS 1 */
68*11038SRao.Shoaib@Sun.COM #define GETGROUPLIST_ARGS const char *name, gid_t basegid, gid_t *groups, int *ngroups
69*11038SRao.Shoaib@Sun.COM #define GETNETBYADDR_ADDR_T long
70*11038SRao.Shoaib@Sun.COM #define SETPWENT_VOID 1
71*11038SRao.Shoaib@Sun.COM #define SETGRENT_VOID 1
72*11038SRao.Shoaib@Sun.COM 
73*11038SRao.Shoaib@Sun.COM #define NET_R_ARGS char *buf, int buflen
74*11038SRao.Shoaib@Sun.COM #define NET_R_BAD NULL
75*11038SRao.Shoaib@Sun.COM #define NET_R_COPY buf, buflen
76*11038SRao.Shoaib@Sun.COM #define NET_R_COPY_ARGS NET_R_ARGS
77*11038SRao.Shoaib@Sun.COM #define NET_R_END_RESULT(x) /*empty*/
78*11038SRao.Shoaib@Sun.COM #define NET_R_END_RETURN void
79*11038SRao.Shoaib@Sun.COM #undef NET_R_ENT_ARGS /*empty*/
80*11038SRao.Shoaib@Sun.COM #define NET_R_OK nptr
81*11038SRao.Shoaib@Sun.COM #define NET_R_RETURN struct netent *
82*11038SRao.Shoaib@Sun.COM #undef NET_R_SET_RESULT /*empty*/
83*11038SRao.Shoaib@Sun.COM #undef NET_R_SETANSWER
84*11038SRao.Shoaib@Sun.COM #define NET_R_SET_RETURN void
85*11038SRao.Shoaib@Sun.COM #undef NETENT_DATA
860Sstevel@tonic-gate 
870Sstevel@tonic-gate #define GROUP_R_RETURN struct group *
880Sstevel@tonic-gate #define GROUP_R_SET_RETURN void
890Sstevel@tonic-gate #undef GROUP_R_SET_RESULT /*empty*/
900Sstevel@tonic-gate #define GROUP_R_END_RETURN void
91*11038SRao.Shoaib@Sun.COM #define GROUP_R_END_RESULT(x) /*empty*/
920Sstevel@tonic-gate #define GROUP_R_ARGS char *buf, int buflen
93*11038SRao.Shoaib@Sun.COM #define GROUP_R_ENT_ARGS void
940Sstevel@tonic-gate #define GROUP_R_OK gptr
950Sstevel@tonic-gate #define GROUP_R_BAD NULL
960Sstevel@tonic-gate 
970Sstevel@tonic-gate #define HOST_R_ARGS char *buf, int buflen, int *h_errnop
98*11038SRao.Shoaib@Sun.COM #define HOST_R_BAD NULL
990Sstevel@tonic-gate #define HOST_R_COPY buf, buflen
1000Sstevel@tonic-gate #define HOST_R_COPY_ARGS char *buf, int buflen
101*11038SRao.Shoaib@Sun.COM #define HOST_R_END_RESULT(x) /*empty*/
102*11038SRao.Shoaib@Sun.COM #define HOST_R_END_RETURN void
103*11038SRao.Shoaib@Sun.COM #undef HOST_R_ENT_ARGS /*empty*/
1040Sstevel@tonic-gate #define HOST_R_ERRNO *h_errnop = h_errno
1050Sstevel@tonic-gate #define HOST_R_OK hptr
106*11038SRao.Shoaib@Sun.COM #define HOST_R_RETURN struct hostent *
107*11038SRao.Shoaib@Sun.COM #undef HOST_R_SETANSWER
108*11038SRao.Shoaib@Sun.COM #undef HOST_R_SET_RESULT
109*11038SRao.Shoaib@Sun.COM #define HOST_R_SET_RETURN void
110*11038SRao.Shoaib@Sun.COM #undef HOSTENT_DATA
1110Sstevel@tonic-gate 
1120Sstevel@tonic-gate #define NGR_R_ARGS char *buf, int buflen
113*11038SRao.Shoaib@Sun.COM #define NGR_R_BAD (0)
1140Sstevel@tonic-gate #define NGR_R_COPY buf, buflen
1150Sstevel@tonic-gate #define NGR_R_COPY_ARGS NGR_R_ARGS
116*11038SRao.Shoaib@Sun.COM #define NGR_R_CONST
117*11038SRao.Shoaib@Sun.COM #define NGR_R_END_RESULT(x)  /*empty*/
118*11038SRao.Shoaib@Sun.COM #define NGR_R_END_RETURN void
119*11038SRao.Shoaib@Sun.COM #undef NGR_R_END_ARGS /*empty*/
1200Sstevel@tonic-gate #define NGR_R_OK 1
121*11038SRao.Shoaib@Sun.COM #define NGR_R_RETURN int
122*11038SRao.Shoaib@Sun.COM #define NGR_R_SET_CONST const
123*11038SRao.Shoaib@Sun.COM #undef NGR_R_SET_RESULT /*empty*/
124*11038SRao.Shoaib@Sun.COM #define NGR_R_SET_RETURN void
125*11038SRao.Shoaib@Sun.COM #undef NGR_R_SET_ARGS
1260Sstevel@tonic-gate 
127*11038SRao.Shoaib@Sun.COM 
128*11038SRao.Shoaib@Sun.COM #if !defined(NGR_R_SET_ARGS) && defined(NGR_R_END_ARGS)
129*11038SRao.Shoaib@Sun.COM #define NGR_R_SET_ARGS NGR_R_END_ARGS
130*11038SRao.Shoaib@Sun.COM #endif
131*11038SRao.Shoaib@Sun.COM 
1320Sstevel@tonic-gate #define PROTO_R_ARGS char *buf, int buflen
133*11038SRao.Shoaib@Sun.COM #define PROTO_R_BAD NULL
1340Sstevel@tonic-gate #define PROTO_R_COPY buf, buflen
1350Sstevel@tonic-gate #define PROTO_R_COPY_ARGS PROTO_R_ARGS
136*11038SRao.Shoaib@Sun.COM #define PROTO_R_END_RESULT(x) /*empty*/
137*11038SRao.Shoaib@Sun.COM #define PROTO_R_END_RETURN void
138*11038SRao.Shoaib@Sun.COM #undef PROTO_R_ENT_ARGS /*empty*/
139*11038SRao.Shoaib@Sun.COM #undef PROTO_R_ENT_UNUSED
1400Sstevel@tonic-gate #define PROTO_R_OK pptr
141*11038SRao.Shoaib@Sun.COM #undef PROTO_R_SETANSWER
142*11038SRao.Shoaib@Sun.COM #define PROTO_R_RETURN struct protoent *
143*11038SRao.Shoaib@Sun.COM #undef PROTO_R_SET_RESULT
144*11038SRao.Shoaib@Sun.COM #define PROTO_R_SET_RETURN void
145*11038SRao.Shoaib@Sun.COM #undef PROTOENT_DATA
1460Sstevel@tonic-gate 
1470Sstevel@tonic-gate #define PASS_R_ARGS char *buf, int buflen
148*11038SRao.Shoaib@Sun.COM #define PASS_R_BAD NULL
1490Sstevel@tonic-gate #define PASS_R_COPY buf, buflen
1500Sstevel@tonic-gate #define PASS_R_COPY_ARGS PASS_R_ARGS
151*11038SRao.Shoaib@Sun.COM #define PASS_R_END_RESULT(x) /*empty*/
152*11038SRao.Shoaib@Sun.COM #define PASS_R_END_RETURN void
153*11038SRao.Shoaib@Sun.COM #undef PASS_R_ENT_ARGS
1540Sstevel@tonic-gate #define PASS_R_OK pwptr
155*11038SRao.Shoaib@Sun.COM #define PASS_R_RETURN struct passwd *
156*11038SRao.Shoaib@Sun.COM #undef PASS_R_SET_RESULT /*empty*/
157*11038SRao.Shoaib@Sun.COM #define PASS_R_SET_RETURN void
1580Sstevel@tonic-gate 
1590Sstevel@tonic-gate #define SERV_R_ARGS char *buf, int buflen
160*11038SRao.Shoaib@Sun.COM #define SERV_R_BAD NULL
1610Sstevel@tonic-gate #define SERV_R_COPY buf, buflen
1620Sstevel@tonic-gate #define SERV_R_COPY_ARGS SERV_R_ARGS
163*11038SRao.Shoaib@Sun.COM #define SERV_R_END_RESULT(x) /*empty*/
164*11038SRao.Shoaib@Sun.COM #define SERV_R_END_RETURN void
165*11038SRao.Shoaib@Sun.COM #undef SERV_R_ENT_ARGS /*empty*/
166*11038SRao.Shoaib@Sun.COM #undef SERV_R_ENT_UNUSED /*empty*/
1670Sstevel@tonic-gate #define SERV_R_OK sptr
168*11038SRao.Shoaib@Sun.COM #undef SERV_R_SETANSWER
169*11038SRao.Shoaib@Sun.COM #define SERV_R_RETURN struct servent *
170*11038SRao.Shoaib@Sun.COM #undef SERV_R_SET_RESULT
171*11038SRao.Shoaib@Sun.COM #define SERV_R_SET_RETURN void
172*11038SRao.Shoaib@Sun.COM 
173*11038SRao.Shoaib@Sun.COM 
1740Sstevel@tonic-gate 
175*11038SRao.Shoaib@Sun.COM #define DE_CONST(konst, var) \
176*11038SRao.Shoaib@Sun.COM 	do { \
177*11038SRao.Shoaib@Sun.COM 		union { const void *k; void *v; } _u; \
178*11038SRao.Shoaib@Sun.COM 		_u.k = konst; \
179*11038SRao.Shoaib@Sun.COM 		var = _u.v; \
180*11038SRao.Shoaib@Sun.COM 	} while (0)
1810Sstevel@tonic-gate 
182*11038SRao.Shoaib@Sun.COM #define UNUSED(x) (x) = (x)
183*11038SRao.Shoaib@Sun.COM 
184*11038SRao.Shoaib@Sun.COM #undef NEED_SOLARIS_BITTYPES
185*11038SRao.Shoaib@Sun.COM #define ISC_SOCKLEN_T int
1860Sstevel@tonic-gate 
1870Sstevel@tonic-gate #ifdef __GNUC__
1880Sstevel@tonic-gate #define ISC_FORMAT_PRINTF(fmt, args) \
1890Sstevel@tonic-gate 	__attribute__((__format__(__printf__, fmt, args)))
1900Sstevel@tonic-gate #else
1910Sstevel@tonic-gate #define ISC_FORMAT_PRINTF(fmt, args)
1920Sstevel@tonic-gate #endif
1930Sstevel@tonic-gate 
194*11038SRao.Shoaib@Sun.COM /* Pull in host order macros when _XOPEN_SOURCE_EXTENDED is defined. */
195*11038SRao.Shoaib@Sun.COM #if defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)
196*11038SRao.Shoaib@Sun.COM #include <sys/byteorder.h>
197*11038SRao.Shoaib@Sun.COM #endif
1980Sstevel@tonic-gate 
199*11038SRao.Shoaib@Sun.COM #endif
2000Sstevel@tonic-gate 
201*11038SRao.Shoaib@Sun.COM /*! \file */
202