getgrent.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright 1997-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 1996-1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#if !defined(LINT) && !defined(CODECENTER)
static const char rcsid[] = "$Id: getgrent.c,v 1.20 2001/05/29 05:48:41 marka Exp $";
#endif
/* Imports */
#include "port_before.h"
#if !defined(WANT_IRS_GR) || defined(__BIND_NOSTATIC)
static int __bind_irs_gr_unneeded;
#else
#include <errno.h>
#include <grp.h>
#include <resolv.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <irs.h>
#include "port_after.h"
#include "irs_data.h"
/* Forward */
void endgrent(void);
/* Public */
struct group *
getgrent() {
return (getgrent_p(net_data));
}
struct group *
}
struct group *
}
int
setgroupent(int stayopen) {
}
#ifdef SETGRENT_VOID
void
setgrent(void) {
}
#else
int
setgrent(void) {
return (setgrent_p(net_data));
}
#endif /* SETGRENT_VOID */
void
endgrent() {
}
int
}
/* Shared private. */
struct group *
return (NULL);
}
struct group *
return (NULL);
if (!net_data->gr_stayopen)
endgrent();
}
struct group *
return (NULL);
if (!net_data->gr_stayopen)
endgrent();
}
int
return (0);
if (stayopen == 0)
return (1);
}
#ifdef SETGRENT_VOID
void
(void)setgroupent_p(0, net_data);
}
#else
int
return (setgroupent_p(0, net_data));
}
#endif /* SETGRENT_VOID */
void
}
int
*ngroups = 0;
return (-1);
}
}
/* Private */
static struct net_data *
init() {
goto error;
return (NULL);
}
NULL);
}
return (net_data);
}
#endif /* WANT_IRS_GR */