gethostby_door.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 1994-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <pwd.h>
#include <strings.h>
#include <errno.h>
#include <fcntl.h>
#include <synch.h>
#include <getxby_door.h>
#include "nss.h"
#ifdef PIC
nsc_data_t *);
struct hostent *
{
/*
* allocate space on the stack for the nscd to return
* host and host alias information
*/
union {
char s_b[8192];
} space;
int ndata;
int adata;
if (h_errnop)
return (NULL);
}
case SUCCESS: /* positive cache hit */
break;
case NOTFOUND: /* negative cache hit */
if (h_errnop)
return (NULL);
default:
}
/*
* check if doors realloced buffer underneath of us....
* munmap or suffer a memory leak
*/
}
return (resptr);
}
struct hostent *
{
/*
* allocate space on the stack for the nscd to return
* host and host alias information
*/
union {
char s_b[8192];
} space;
int ndata;
int adata;
if (h_errnop)
return (NULL);
}
case SUCCESS: /* positive cache hit */
break;
case NOTFOUND: /* negative cache hit */
if (h_errnop)
return (NULL);
default:
}
/*
* check if doors realloced buffer underneath of us....
* munmap it or suffer a memory leak
*/
}
return (resptr);
}
#if !defined(_LP64)
static struct hostent *
{
int i;
char *fixed;
/*
* no enough space allocated by user
*/
if (h_errnop)
return (NULL);
}
(int)buffer);
}
}
return (result);
}
#else /* _LP64 */
static struct hostent *
{
char *fixed;
char *dest;
char *start;
char **aliaseslist;
char **addrlist;
int *alias;
int *address;
int numaliases;
int numaddrs;
int i;
if (buflen < 0) {
/* no enough space allocated by user */
if (h_errnop)
return (NULL);
}
/* find out whether the user has provided sufficient space */
/* no enough space allocated by user */
if (h_errnop)
return (NULL);
}
/*
* allocat the h_aliases list and the h_addr_list first to align 'em.
*/
aliaseslist = (char **)dest;
/* fill out h_name */
/*
* fill out the h_aliases list
*/
for (i = 0; i < numaliases; i++) {
aliaseslist[i] = dest;
}
aliaseslist[i] = 0; /* null term ptr chain */
/*
* fill out the h_addr list
*/
for (i = 0; i < numaddrs; i++) {
}
addrlist[i] = 0; /* null term ptr chain */
return (result);
}
#endif /* _LP64 */
#endif /* PIC */