/*-1* SPDX-License-Identifier: BSD-3-Clause2*3* Copyright (c) 1989, 19934* The Regents of the University of California. All rights reserved.5* (c) UNIX System Laboratories, Inc.6* All or some portions of this file are derived from material licensed7* to the University of California by American Telephone and Telegraph8* Co. or Unix System Laboratories, Inc. and are reproduced herein with9* the permission of UNIX System Laboratories, Inc.10*11* Redistribution and use in source and binary forms, with or without12* modification, are permitted provided that the following conditions13* are met:14* 1. Redistributions of source code must retain the above copyright15* notice, this list of conditions and the following disclaimer.16* 2. Redistributions in binary form must reproduce the above copyright17* notice, this list of conditions and the following disclaimer in the18* documentation and/or other materials provided with the distribution.19* 3. Neither the name of the University nor the names of its contributors20* may be used to endorse or promote products derived from this software21* without specific prior written permission.22*23* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND24* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE25* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE26* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE27* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL28* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS29* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)30* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT31* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY32* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF33* SUCH DAMAGE.34*/3536#ifndef _GRP_H_37#define _GRP_H_3839#include <sys/cdefs.h>40#include <sys/_types.h>4142#define _PATH_GROUP "/etc/group"4344#ifndef _GID_T_DECLARED45typedef __gid_t gid_t;46#define _GID_T_DECLARED47#endif4849#ifndef _SIZE_T_DECLARED50typedef __size_t size_t;51#define _SIZE_T_DECLARED52#endif5354struct group {55char *gr_name; /* group name */56char *gr_passwd; /* group password */57gid_t gr_gid; /* group id */58char **gr_mem; /* group members */59};6061__BEGIN_DECLS62#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE63void endgrent(void);64struct group *getgrent(void);65#endif66struct group *getgrgid(gid_t);67struct group *getgrnam(const char *);68#if __BSD_VISIBLE69const char *group_from_gid(gid_t, int);70int gid_from_group(const char *, gid_t *);71int pwcache_groupdb(int (*)(int), void (*)(void),72struct group * (*)(const char *),73struct group * (*)(gid_t));74#endif75#if __XSI_VISIBLE76void setgrent(void);77#endif78#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE79int getgrgid_r(gid_t, struct group *, char *, size_t,80struct group **);81int getgrnam_r(const char *, struct group *, char *, size_t,82struct group **);83#endif84#if __BSD_VISIBLE85int getgrent_r(struct group *, char *, size_t, struct group **);86int setgroupent(int);87#endif88__END_DECLS8990#endif /* !_GRP_H_ */919293