1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate 23*7c478bd9Sstevel@tonic-gate /* 24*7c478bd9Sstevel@tonic-gate * Copyright 1994-2002 Sun Microsystems, Inc. All rights reserved. 25*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 26*7c478bd9Sstevel@tonic-gate */ 27*7c478bd9Sstevel@tonic-gate 28*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate #include <pwd.h> 31*7c478bd9Sstevel@tonic-gate #include <strings.h> 32*7c478bd9Sstevel@tonic-gate #include <sys/mman.h> 33*7c478bd9Sstevel@tonic-gate #include <sys/door.h> 34*7c478bd9Sstevel@tonic-gate #include <errno.h> 35*7c478bd9Sstevel@tonic-gate #include <fcntl.h> 36*7c478bd9Sstevel@tonic-gate #include <synch.h> 37*7c478bd9Sstevel@tonic-gate #include <getxby_door.h> 38*7c478bd9Sstevel@tonic-gate #include "nss.h" 39*7c478bd9Sstevel@tonic-gate 40*7c478bd9Sstevel@tonic-gate #ifdef PIC 41*7c478bd9Sstevel@tonic-gate 42*7c478bd9Sstevel@tonic-gate static struct hostent *process_gethost(struct hostent *, char *, int, int *, 43*7c478bd9Sstevel@tonic-gate nsc_data_t *); 44*7c478bd9Sstevel@tonic-gate 45*7c478bd9Sstevel@tonic-gate struct hostent * 46*7c478bd9Sstevel@tonic-gate _door_gethostbyname_r(const char *name, struct hostent *result, char *buffer, 47*7c478bd9Sstevel@tonic-gate int buflen, int *h_errnop) 48*7c478bd9Sstevel@tonic-gate { 49*7c478bd9Sstevel@tonic-gate 50*7c478bd9Sstevel@tonic-gate /* 51*7c478bd9Sstevel@tonic-gate * allocate space on the stack for the nscd to return 52*7c478bd9Sstevel@tonic-gate * host and host alias information 53*7c478bd9Sstevel@tonic-gate */ 54*7c478bd9Sstevel@tonic-gate union { 55*7c478bd9Sstevel@tonic-gate nsc_data_t s_d; 56*7c478bd9Sstevel@tonic-gate char s_b[8192]; 57*7c478bd9Sstevel@tonic-gate } space; 58*7c478bd9Sstevel@tonic-gate nsc_data_t *sptr; 59*7c478bd9Sstevel@tonic-gate int ndata; 60*7c478bd9Sstevel@tonic-gate int adata; 61*7c478bd9Sstevel@tonic-gate struct hostent *resptr = NULL; 62*7c478bd9Sstevel@tonic-gate 63*7c478bd9Sstevel@tonic-gate if ((name == (const char *)NULL) || 64*7c478bd9Sstevel@tonic-gate (strlen(name) >= (sizeof (space) - sizeof (nsc_data_t)))) { 65*7c478bd9Sstevel@tonic-gate errno = ERANGE; 66*7c478bd9Sstevel@tonic-gate if (h_errnop) 67*7c478bd9Sstevel@tonic-gate *h_errnop = HOST_NOT_FOUND; 68*7c478bd9Sstevel@tonic-gate return (NULL); 69*7c478bd9Sstevel@tonic-gate } 70*7c478bd9Sstevel@tonic-gate 71*7c478bd9Sstevel@tonic-gate adata = (sizeof (nsc_call_t) + strlen(name) + 1); 72*7c478bd9Sstevel@tonic-gate ndata = sizeof (space); 73*7c478bd9Sstevel@tonic-gate space.s_d.nsc_call.nsc_callnumber = GETHOSTBYNAME; 74*7c478bd9Sstevel@tonic-gate strcpy(space.s_d.nsc_call.nsc_u.name, name); 75*7c478bd9Sstevel@tonic-gate sptr = &space.s_d; 76*7c478bd9Sstevel@tonic-gate 77*7c478bd9Sstevel@tonic-gate switch (_nsc_trydoorcall(&sptr, &ndata, &adata)) { 78*7c478bd9Sstevel@tonic-gate case SUCCESS: /* positive cache hit */ 79*7c478bd9Sstevel@tonic-gate break; 80*7c478bd9Sstevel@tonic-gate case NOTFOUND: /* negative cache hit */ 81*7c478bd9Sstevel@tonic-gate if (h_errnop) 82*7c478bd9Sstevel@tonic-gate *h_errnop = space.s_d.nsc_ret.nsc_errno; 83*7c478bd9Sstevel@tonic-gate return (NULL); 84*7c478bd9Sstevel@tonic-gate default: 85*7c478bd9Sstevel@tonic-gate return ((struct hostent *)_switch_gethostbyname_r(name, 86*7c478bd9Sstevel@tonic-gate result, buffer, buflen, h_errnop)); 87*7c478bd9Sstevel@tonic-gate } 88*7c478bd9Sstevel@tonic-gate resptr = process_gethost(result, buffer, buflen, h_errnop, sptr); 89*7c478bd9Sstevel@tonic-gate 90*7c478bd9Sstevel@tonic-gate /* 91*7c478bd9Sstevel@tonic-gate * check if doors realloced buffer underneath of us.... 92*7c478bd9Sstevel@tonic-gate * munmap or suffer a memory leak 93*7c478bd9Sstevel@tonic-gate */ 94*7c478bd9Sstevel@tonic-gate 95*7c478bd9Sstevel@tonic-gate if (sptr != &space.s_d) { 96*7c478bd9Sstevel@tonic-gate munmap((char *)sptr, ndata); /* return memory */ 97*7c478bd9Sstevel@tonic-gate } 98*7c478bd9Sstevel@tonic-gate 99*7c478bd9Sstevel@tonic-gate return (resptr); 100*7c478bd9Sstevel@tonic-gate } 101*7c478bd9Sstevel@tonic-gate 102*7c478bd9Sstevel@tonic-gate struct hostent * 103*7c478bd9Sstevel@tonic-gate _door_gethostbyaddr_r(const char *addr, int length, int type, 104*7c478bd9Sstevel@tonic-gate struct hostent *result, char *buffer, int buflen, int *h_errnop) 105*7c478bd9Sstevel@tonic-gate { 106*7c478bd9Sstevel@tonic-gate /* 107*7c478bd9Sstevel@tonic-gate * allocate space on the stack for the nscd to return 108*7c478bd9Sstevel@tonic-gate * host and host alias information 109*7c478bd9Sstevel@tonic-gate */ 110*7c478bd9Sstevel@tonic-gate union { 111*7c478bd9Sstevel@tonic-gate nsc_data_t s_d; 112*7c478bd9Sstevel@tonic-gate char s_b[8192]; 113*7c478bd9Sstevel@tonic-gate } space; 114*7c478bd9Sstevel@tonic-gate nsc_data_t *sptr; 115*7c478bd9Sstevel@tonic-gate int ndata; 116*7c478bd9Sstevel@tonic-gate int adata; 117*7c478bd9Sstevel@tonic-gate struct hostent *resptr = NULL; 118*7c478bd9Sstevel@tonic-gate 119*7c478bd9Sstevel@tonic-gate if (addr == (const char *)NULL) { 120*7c478bd9Sstevel@tonic-gate if (h_errnop) 121*7c478bd9Sstevel@tonic-gate *h_errnop = HOST_NOT_FOUND; 122*7c478bd9Sstevel@tonic-gate return (NULL); 123*7c478bd9Sstevel@tonic-gate } 124*7c478bd9Sstevel@tonic-gate 125*7c478bd9Sstevel@tonic-gate ndata = sizeof (space); 126*7c478bd9Sstevel@tonic-gate adata = length + sizeof (nsc_call_t) + 1; 127*7c478bd9Sstevel@tonic-gate sptr = &space.s_d; 128*7c478bd9Sstevel@tonic-gate 129*7c478bd9Sstevel@tonic-gate space.s_d.nsc_call.nsc_callnumber = GETHOSTBYADDR; 130*7c478bd9Sstevel@tonic-gate space.s_d.nsc_call.nsc_u.addr.a_type = type; 131*7c478bd9Sstevel@tonic-gate space.s_d.nsc_call.nsc_u.addr.a_length = length; 132*7c478bd9Sstevel@tonic-gate memcpy(space.s_d.nsc_call.nsc_u.addr.a_data, addr, length); 133*7c478bd9Sstevel@tonic-gate 134*7c478bd9Sstevel@tonic-gate switch (_nsc_trydoorcall(&sptr, &ndata, &adata)) { 135*7c478bd9Sstevel@tonic-gate case SUCCESS: /* positive cache hit */ 136*7c478bd9Sstevel@tonic-gate break; 137*7c478bd9Sstevel@tonic-gate case NOTFOUND: /* negative cache hit */ 138*7c478bd9Sstevel@tonic-gate if (h_errnop) 139*7c478bd9Sstevel@tonic-gate *h_errnop = space.s_d.nsc_ret.nsc_errno; 140*7c478bd9Sstevel@tonic-gate return (NULL); 141*7c478bd9Sstevel@tonic-gate default: 142*7c478bd9Sstevel@tonic-gate return ((struct hostent *)_switch_gethostbyaddr_r(addr, 143*7c478bd9Sstevel@tonic-gate length, type, result, buffer, buflen, h_errnop)); 144*7c478bd9Sstevel@tonic-gate } 145*7c478bd9Sstevel@tonic-gate 146*7c478bd9Sstevel@tonic-gate resptr = process_gethost(result, buffer, buflen, h_errnop, sptr); 147*7c478bd9Sstevel@tonic-gate 148*7c478bd9Sstevel@tonic-gate /* 149*7c478bd9Sstevel@tonic-gate * check if doors realloced buffer underneath of us.... 150*7c478bd9Sstevel@tonic-gate * munmap it or suffer a memory leak 151*7c478bd9Sstevel@tonic-gate */ 152*7c478bd9Sstevel@tonic-gate 153*7c478bd9Sstevel@tonic-gate if (sptr != &space.s_d) { 154*7c478bd9Sstevel@tonic-gate munmap((char *)sptr, ndata); /* return memory */ 155*7c478bd9Sstevel@tonic-gate } 156*7c478bd9Sstevel@tonic-gate 157*7c478bd9Sstevel@tonic-gate return (resptr); 158*7c478bd9Sstevel@tonic-gate 159*7c478bd9Sstevel@tonic-gate } 160*7c478bd9Sstevel@tonic-gate 161*7c478bd9Sstevel@tonic-gate #if !defined(_LP64) 162*7c478bd9Sstevel@tonic-gate 163*7c478bd9Sstevel@tonic-gate static struct hostent * 164*7c478bd9Sstevel@tonic-gate process_gethost(struct hostent *result, char *buffer, int buflen, 165*7c478bd9Sstevel@tonic-gate int *h_errnop, nsc_data_t *sptr) 166*7c478bd9Sstevel@tonic-gate { 167*7c478bd9Sstevel@tonic-gate int i; 168*7c478bd9Sstevel@tonic-gate 169*7c478bd9Sstevel@tonic-gate char *fixed; 170*7c478bd9Sstevel@tonic-gate 171*7c478bd9Sstevel@tonic-gate fixed = (char *)(((int)buffer +3) & ~3); 172*7c478bd9Sstevel@tonic-gate buflen -= fixed - buffer; 173*7c478bd9Sstevel@tonic-gate buffer = fixed; 174*7c478bd9Sstevel@tonic-gate 175*7c478bd9Sstevel@tonic-gate if (buflen + sizeof (struct hostent) 176*7c478bd9Sstevel@tonic-gate < sptr->nsc_ret.nsc_bufferbytesused) { 177*7c478bd9Sstevel@tonic-gate /* 178*7c478bd9Sstevel@tonic-gate * no enough space allocated by user 179*7c478bd9Sstevel@tonic-gate */ 180*7c478bd9Sstevel@tonic-gate errno = ERANGE; 181*7c478bd9Sstevel@tonic-gate if (h_errnop) 182*7c478bd9Sstevel@tonic-gate *h_errnop = HOST_NOT_FOUND; 183*7c478bd9Sstevel@tonic-gate return (NULL); 184*7c478bd9Sstevel@tonic-gate } 185*7c478bd9Sstevel@tonic-gate 186*7c478bd9Sstevel@tonic-gate memcpy(buffer, sptr->nsc_ret.nsc_u.buff + sizeof (struct hostent), 187*7c478bd9Sstevel@tonic-gate sptr->nsc_ret.nsc_bufferbytesused - sizeof (struct hostent)); 188*7c478bd9Sstevel@tonic-gate 189*7c478bd9Sstevel@tonic-gate sptr->nsc_ret.nsc_u.hst.h_name += (int)buffer; 190*7c478bd9Sstevel@tonic-gate sptr->nsc_ret.nsc_u.hst.h_aliases = 191*7c478bd9Sstevel@tonic-gate (char **)((char *)sptr->nsc_ret.nsc_u.hst.h_aliases + (int)buffer); 192*7c478bd9Sstevel@tonic-gate sptr->nsc_ret.nsc_u.hst.h_addr_list = 193*7c478bd9Sstevel@tonic-gate (char **)((char *)sptr->nsc_ret.nsc_u.hst.h_addr_list + 194*7c478bd9Sstevel@tonic-gate (int)buffer); 195*7c478bd9Sstevel@tonic-gate for (i = 0; sptr->nsc_ret.nsc_u.hst.h_aliases[i]; i++) { 196*7c478bd9Sstevel@tonic-gate sptr->nsc_ret.nsc_u.hst.h_aliases[i] += (int)buffer; 197*7c478bd9Sstevel@tonic-gate } 198*7c478bd9Sstevel@tonic-gate for (i = 0; sptr->nsc_ret.nsc_u.hst.h_addr_list[i]; i++) { 199*7c478bd9Sstevel@tonic-gate sptr->nsc_ret.nsc_u.hst.h_addr_list[i] += (int)buffer; 200*7c478bd9Sstevel@tonic-gate } 201*7c478bd9Sstevel@tonic-gate 202*7c478bd9Sstevel@tonic-gate *result = sptr->nsc_ret.nsc_u.hst; 203*7c478bd9Sstevel@tonic-gate 204*7c478bd9Sstevel@tonic-gate return (result); 205*7c478bd9Sstevel@tonic-gate } 206*7c478bd9Sstevel@tonic-gate 207*7c478bd9Sstevel@tonic-gate #else /* _LP64 */ 208*7c478bd9Sstevel@tonic-gate 209*7c478bd9Sstevel@tonic-gate #define RNDUP(buf, n) (((uintptr_t)buf + n - 1l) & ~(n - 1l)) 210*7c478bd9Sstevel@tonic-gate 211*7c478bd9Sstevel@tonic-gate static struct hostent * 212*7c478bd9Sstevel@tonic-gate process_gethost(struct hostent *result, char *buffer, int buflen, 213*7c478bd9Sstevel@tonic-gate int *h_errnop, nsc_data_t *sptr) 214*7c478bd9Sstevel@tonic-gate { 215*7c478bd9Sstevel@tonic-gate char *fixed; 216*7c478bd9Sstevel@tonic-gate char *dest; 217*7c478bd9Sstevel@tonic-gate char *start; 218*7c478bd9Sstevel@tonic-gate char **aliaseslist; 219*7c478bd9Sstevel@tonic-gate char **addrlist; 220*7c478bd9Sstevel@tonic-gate int *alias; 221*7c478bd9Sstevel@tonic-gate int *address; 222*7c478bd9Sstevel@tonic-gate size_t strs; 223*7c478bd9Sstevel@tonic-gate int numaliases; 224*7c478bd9Sstevel@tonic-gate int numaddrs; 225*7c478bd9Sstevel@tonic-gate int i; 226*7c478bd9Sstevel@tonic-gate 227*7c478bd9Sstevel@tonic-gate fixed = (char *)RNDUP(buffer, sizeof (char *)); 228*7c478bd9Sstevel@tonic-gate buflen -= fixed - buffer; 229*7c478bd9Sstevel@tonic-gate buffer = fixed; 230*7c478bd9Sstevel@tonic-gate 231*7c478bd9Sstevel@tonic-gate if (buflen < 0) { 232*7c478bd9Sstevel@tonic-gate /* no enough space allocated by user */ 233*7c478bd9Sstevel@tonic-gate errno = ERANGE; 234*7c478bd9Sstevel@tonic-gate if (h_errnop) 235*7c478bd9Sstevel@tonic-gate *h_errnop = HOST_NOT_FOUND; 236*7c478bd9Sstevel@tonic-gate return (NULL); 237*7c478bd9Sstevel@tonic-gate } 238*7c478bd9Sstevel@tonic-gate 239*7c478bd9Sstevel@tonic-gate /* find out whether the user has provided sufficient space */ 240*7c478bd9Sstevel@tonic-gate 241*7c478bd9Sstevel@tonic-gate start = sptr->nsc_ret.nsc_u.buff + sizeof (struct hostent32); 242*7c478bd9Sstevel@tonic-gate strs = 1 + strlen(sptr->nsc_ret.nsc_u.hst.h_name + start); 243*7c478bd9Sstevel@tonic-gate alias = (int *)(start + sptr->nsc_ret.nsc_u.hst.h_aliases); 244*7c478bd9Sstevel@tonic-gate for (numaliases = 0; alias[numaliases]; numaliases++) 245*7c478bd9Sstevel@tonic-gate strs += 1 + strlen(start + alias[numaliases]); 246*7c478bd9Sstevel@tonic-gate strs = RNDUP(strs, sizeof (int)); 247*7c478bd9Sstevel@tonic-gate strs += sizeof (char *) * (numaliases + 1); 248*7c478bd9Sstevel@tonic-gate address = (int *)(start + sptr->nsc_ret.nsc_u.hst.h_addr_list); 249*7c478bd9Sstevel@tonic-gate for (numaddrs = 0; address[numaddrs]; numaddrs++) 250*7c478bd9Sstevel@tonic-gate strs += RNDUP(sptr->nsc_ret.nsc_u.hst.h_length, sizeof (int)); 251*7c478bd9Sstevel@tonic-gate strs += sizeof (char *) * (numaddrs + 1); 252*7c478bd9Sstevel@tonic-gate 253*7c478bd9Sstevel@tonic-gate if (buflen < strs) { 254*7c478bd9Sstevel@tonic-gate 255*7c478bd9Sstevel@tonic-gate /* no enough space allocated by user */ 256*7c478bd9Sstevel@tonic-gate 257*7c478bd9Sstevel@tonic-gate errno = ERANGE; 258*7c478bd9Sstevel@tonic-gate if (h_errnop) 259*7c478bd9Sstevel@tonic-gate *h_errnop = HOST_NOT_FOUND; 260*7c478bd9Sstevel@tonic-gate return (NULL); 261*7c478bd9Sstevel@tonic-gate } 262*7c478bd9Sstevel@tonic-gate 263*7c478bd9Sstevel@tonic-gate 264*7c478bd9Sstevel@tonic-gate /* 265*7c478bd9Sstevel@tonic-gate * allocat the h_aliases list and the h_addr_list first to align 'em. 266*7c478bd9Sstevel@tonic-gate */ 267*7c478bd9Sstevel@tonic-gate 268*7c478bd9Sstevel@tonic-gate dest = buffer; 269*7c478bd9Sstevel@tonic-gate aliaseslist = (char **)dest; 270*7c478bd9Sstevel@tonic-gate dest += sizeof (char *) * (numaliases + 1); 271*7c478bd9Sstevel@tonic-gate addrlist = (char **)dest; 272*7c478bd9Sstevel@tonic-gate dest += sizeof (char *) * (numaddrs + 1); 273*7c478bd9Sstevel@tonic-gate 274*7c478bd9Sstevel@tonic-gate /* fill out h_name */ 275*7c478bd9Sstevel@tonic-gate 276*7c478bd9Sstevel@tonic-gate start = sptr->nsc_ret.nsc_u.buff + sizeof (struct hostent32); 277*7c478bd9Sstevel@tonic-gate strcpy(dest, sptr->nsc_ret.nsc_u.hst.h_name + start); 278*7c478bd9Sstevel@tonic-gate strs = 1 + strlen(sptr->nsc_ret.nsc_u.hst.h_name + start); 279*7c478bd9Sstevel@tonic-gate result->h_name = dest; 280*7c478bd9Sstevel@tonic-gate dest += strs; 281*7c478bd9Sstevel@tonic-gate 282*7c478bd9Sstevel@tonic-gate /* 283*7c478bd9Sstevel@tonic-gate * fill out the h_aliases list 284*7c478bd9Sstevel@tonic-gate */ 285*7c478bd9Sstevel@tonic-gate for (i = 0; i < numaliases; i++) { 286*7c478bd9Sstevel@tonic-gate alias = (int *)(start + sptr->nsc_ret.nsc_u.hst.h_aliases); 287*7c478bd9Sstevel@tonic-gate strcpy(dest, start + alias[i]); 288*7c478bd9Sstevel@tonic-gate strs = 1 + strlen(start + alias[i]); 289*7c478bd9Sstevel@tonic-gate aliaseslist[i] = dest; 290*7c478bd9Sstevel@tonic-gate dest += strs; 291*7c478bd9Sstevel@tonic-gate } 292*7c478bd9Sstevel@tonic-gate aliaseslist[i] = 0; /* null term ptr chain */ 293*7c478bd9Sstevel@tonic-gate 294*7c478bd9Sstevel@tonic-gate result->h_aliases = aliaseslist; 295*7c478bd9Sstevel@tonic-gate 296*7c478bd9Sstevel@tonic-gate /* 297*7c478bd9Sstevel@tonic-gate * fill out the h_addr list 298*7c478bd9Sstevel@tonic-gate */ 299*7c478bd9Sstevel@tonic-gate 300*7c478bd9Sstevel@tonic-gate dest = (char *)RNDUP(dest, sizeof (int)); 301*7c478bd9Sstevel@tonic-gate 302*7c478bd9Sstevel@tonic-gate for (i = 0; i < numaddrs; i++) { 303*7c478bd9Sstevel@tonic-gate address = (int *)(start + sptr->nsc_ret.nsc_u.hst.h_addr_list); 304*7c478bd9Sstevel@tonic-gate memcpy(dest, start + address[i], 305*7c478bd9Sstevel@tonic-gate sptr->nsc_ret.nsc_u.hst.h_length); 306*7c478bd9Sstevel@tonic-gate strs = sptr->nsc_ret.nsc_u.hst.h_length; 307*7c478bd9Sstevel@tonic-gate addrlist[i] = dest; 308*7c478bd9Sstevel@tonic-gate dest += strs; 309*7c478bd9Sstevel@tonic-gate dest = (char *)RNDUP(dest, sizeof (int)); 310*7c478bd9Sstevel@tonic-gate } 311*7c478bd9Sstevel@tonic-gate 312*7c478bd9Sstevel@tonic-gate addrlist[i] = 0; /* null term ptr chain */ 313*7c478bd9Sstevel@tonic-gate 314*7c478bd9Sstevel@tonic-gate result->h_addr_list = addrlist; 315*7c478bd9Sstevel@tonic-gate 316*7c478bd9Sstevel@tonic-gate result->h_length = sptr->nsc_ret.nsc_u.hst.h_length; 317*7c478bd9Sstevel@tonic-gate result->h_addrtype = sptr->nsc_ret.nsc_u.hst.h_addrtype; 318*7c478bd9Sstevel@tonic-gate 319*7c478bd9Sstevel@tonic-gate return (result); 320*7c478bd9Sstevel@tonic-gate } 321*7c478bd9Sstevel@tonic-gate #endif /* _LP64 */ 322*7c478bd9Sstevel@tonic-gate #endif /* PIC */ 323