Print this page


   1 /*
   2  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
   3  * Use is subject to license terms.
   4  */
   5 
   6 #pragma ident   "%Z%%M% %I%     %E% SMI"
   7 
   8 #ifdef SUNW_OPTIONS
   9 #include "conf/sunoptions.h"

























  10 #endif
  11 
  12 #define __EXTENSIONS__
  13 /* #define SVR4 */
  14 #ifdef  WANT_IRS_NIS
  15 #undef  WANT_IRS_NIS



  16 #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
  27 
  28 #if defined(HAS_PTHREADS) && defined(_REENTRANT)
  29 #define DO_PTHREADS




  30 #endif



  31 






























  32 #define GROUP_R_RETURN struct group *
  33 #define GROUP_R_SET_RETURN void
  34 #undef GROUP_R_SET_RESULT /*empty*/
  35 #define GROUP_R_END_RETURN void
  36 #undef GROUP_R_END_RESULT  /*empty*/
  37 #define GROUP_R_ARGS char *buf, int buflen
  38 #undef GROUP_R_ENT_ARGS /*empty*/
  39 #define GROUP_R_OK gptr
  40 #define GROUP_R_BAD NULL
  41 #define GETGROUPLIST_ARGS const char *name, gid_t basegid, gid_t *groups, \
  42                       int *ngroups
  43 
  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 #define HOST_R_ARGS char *buf, int buflen, int *h_errnop
  50 #undef HOST_R_ENT_ARGS /*empty*/
  51 #define HOST_R_COPY buf, buflen
  52 #define HOST_R_COPY_ARGS char *buf, int buflen



  53 #define HOST_R_ERRNO *h_errnop = h_errno
  54 #define HOST_R_OK hptr
  55 #define HOST_R_BAD NULL




  56 
  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 #define NGR_R_ARGS char *buf, int buflen
  79 #undef NGR_R_ENT_ARGS /*empty*/
  80 #define NGR_R_COPY buf, buflen
  81 #define NGR_R_COPY_ARGS NGR_R_ARGS




  82 #define NGR_R_OK 1
  83 #define NGR_R_BAD (0)




  84 
  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*/
  90 #define PROTO_R_ARGS char *buf, int buflen
  91 #undef PROTO_R_ENT_ARGS /*empty*/
  92 #define PROTO_R_COPY buf, buflen
  93 #define PROTO_R_COPY_ARGS PROTO_R_ARGS




  94 #define PROTO_R_OK pptr
  95 #define PROTO_R_BAD NULL




  96 
  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 #define PASS_R_ARGS char *buf, int buflen
 103 #undef PASS_R_ENT_ARGS /*empty*/
 104 #define PASS_R_COPY buf, buflen
 105 #define PASS_R_COPY_ARGS PASS_R_ARGS



 106 #define PASS_R_OK pwptr
 107 #define PASS_R_BAD NULL


 108 
 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 #define SERV_R_ARGS char *buf, int buflen
 115 #undef SERV_R_ENT_ARGS /*empty*/
 116 #define SERV_R_COPY buf, buflen
 117 #define SERV_R_COPY_ARGS SERV_R_ARGS




 118 #define SERV_R_OK sptr
 119 #define SERV_R_BAD NULL



 120 
 121 /* make #include <sys/ioctl.h> also #include <sys/sockio.h> */
 122 #define BSD_COMP
 123 
 124 #include <limits.h>       /* _POSIX_PATH_MAX */
 125 












 126 #ifdef __GNUC__
 127 #define ISC_FORMAT_PRINTF(fmt, args) \
 128         __attribute__((__format__(__printf__, fmt, args)))
 129 #else
 130 #define ISC_FORMAT_PRINTF(fmt, args)
 131 #endif
 132 
 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>
 140 
 141 #include <sys/types.h>
 142 #include "sys/bitypes.h"
 143 #include "sys/cdefs.h"
 144 
 145 #define HAS_INET6_STRUCTS
 146 #define H_ERRNO_IS_FUNCTION
   1 /*
   2  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
   3  * Use is subject to license terms.
   4  */
   5 

   6 
   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
  34 #endif
  35 
  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>
  43 #endif
  44 #include <limits.h>









  45 
  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 };
  52 #endif
  53 #ifndef HAVE_MEMMOVE
  54 #define memmove(a,b,c) bcopy(b,a,c)
  55 #endif
  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 
  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


  96 





  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
 110 #undef HOSTENT_DATA
 111 





















 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
 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*/
 120 #define NGR_R_OK 1
 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
 126 
 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 
 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
 145 #undef PROTOENT_DATA
 146 





 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
 158 





 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
 172 


 173 

 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 
 187 #ifdef __GNUC__
 188 #define ISC_FORMAT_PRINTF(fmt, args) \
 189         __attribute__((__format__(__printf__, fmt, args)))
 190 #else
 191 #define ISC_FORMAT_PRINTF(fmt, args)
 192 #endif
 193 
 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



 198 
 199 #endif


 200 
 201 /*! \file */