grp.h revision 103515
11539Srgrimes/*- 21539Srgrimes * Copyright (c) 1989, 1993 31539Srgrimes * The Regents of the University of California. All rights reserved. 41539Srgrimes * (c) UNIX System Laboratories, Inc. 51539Srgrimes * All or some portions of this file are derived from material licensed 61539Srgrimes * to the University of California by American Telephone and Telegraph 71539Srgrimes * Co. or Unix System Laboratories, Inc. and are reproduced herein with 81539Srgrimes * the permission of UNIX System Laboratories, Inc. 91539Srgrimes * 101539Srgrimes * Redistribution and use in source and binary forms, with or without 111539Srgrimes * modification, are permitted provided that the following conditions 121539Srgrimes * are met: 131539Srgrimes * 1. Redistributions of source code must retain the above copyright 141539Srgrimes * notice, this list of conditions and the following disclaimer. 151539Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 161539Srgrimes * notice, this list of conditions and the following disclaimer in the 171539Srgrimes * documentation and/or other materials provided with the distribution. 181539Srgrimes * 3. All advertising materials mentioning features or use of this software 191539Srgrimes * must display the following acknowledgement: 201539Srgrimes * This product includes software developed by the University of 211539Srgrimes * California, Berkeley and its contributors. 221539Srgrimes * 4. Neither the name of the University nor the names of its contributors 231539Srgrimes * may be used to endorse or promote products derived from this software 241539Srgrimes * without specific prior written permission. 251539Srgrimes * 261539Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 271539Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 281539Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 291539Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 301539Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 311539Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 321539Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 331539Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 341539Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 351539Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 361539Srgrimes * SUCH DAMAGE. 371539Srgrimes * 381539Srgrimes * @(#)grp.h 8.2 (Berkeley) 1/21/94 3989663Smarkm * $FreeBSD: head/include/grp.h 103515 2002-09-18 02:07:08Z mike $ 401539Srgrimes */ 411539Srgrimes 421539Srgrimes#ifndef _GRP_H_ 431539Srgrimes#define _GRP_H_ 441539Srgrimes 4591245Ssobomax#include <sys/cdefs.h> 4694722Smike#include <sys/_types.h> 4791245Ssobomax 481539Srgrimes#define _PATH_GROUP "/etc/group" 491539Srgrimes 50102227Smike#ifndef _GID_T_DECLARED 51102227Smiketypedef __gid_t gid_t; 52102227Smike#define _GID_T_DECLARED 5391325Smike#endif 5491325Smike 551539Srgrimesstruct group { 561539Srgrimes char *gr_name; /* group name */ 571539Srgrimes char *gr_passwd; /* group password */ 5889663Smarkm gid_t gr_gid; /* group id */ 591539Srgrimes char **gr_mem; /* group members */ 601539Srgrimes}; 611539Srgrimes 621539Srgrimes__BEGIN_DECLS 63103515Smike#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE 64103515Smikevoid endgrent(void); 65103515Smikestruct group *getgrent(void); 66103515Smike#endif 67103509Smikestruct group *getgrgid(gid_t); 68103509Smikestruct group *getgrnam(const char *); 69103515Smike#if __BSD_VISIBLE 70103515Smikeconst char *group_from_gid(gid_t, int); 71103515Smike#endif 72103515Smike#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE 73103509Smikeint setgrent(void); 74103515Smike#endif 75103515Smike#if __BSD_VISIBLE 76103509Smikevoid setgrfile(const char *); 77103509Smikeint setgroupent(int); 781539Srgrimes#endif 79103515Smike/* 80103515Smike * XXX missing getgrgid_r(), getgrnam_r(). 81103515Smike */ 821539Srgrimes__END_DECLS 831539Srgrimes 841539Srgrimes#endif /* !_GRP_H_ */ 85