grp.h revision 93514
1108983Simp/*- 2108983Simp * Copyright (c) 1989, 1993 3108983Simp * The Regents of the University of California. All rights reserved. 4108983Simp * (c) UNIX System Laboratories, Inc. 5108983Simp * All or some portions of this file are derived from material licensed 6108983Simp * to the University of California by American Telephone and Telegraph 7108983Simp * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8108983Simp * the permission of UNIX System Laboratories, Inc. 9108983Simp * 10108983Simp * Redistribution and use in source and binary forms, with or without 11225861Swblock * modification, are permitted provided that the following conditions 12225861Swblock * are met: 13225861Swblock * 1. Redistributions of source code must retain the above copyright 14225861Swblock * notice, this list of conditions and the following disclaimer. 15108983Simp * 2. Redistributions in binary form must reproduce the above copyright 16108983Simp * notice, this list of conditions and the following disclaimer in the 17108983Simp * documentation and/or other materials provided with the distribution. 18108983Simp * 3. All advertising materials mentioning features or use of this software 19108983Simp * must display the following acknowledgement: 20148471Simp * This product includes software developed by the University of 21108983Simp * California, Berkeley and its contributors. 22139027Sbrueffer * 4. Neither the name of the University nor the names of its contributors 23146969Smarius * may be used to endorse or promote products derived from this software 24139027Sbrueffer * without specific prior written permission. 25108983Simp * 26108983Simp * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 27108983Simp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 28108983Simp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 29108983Simp * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 30108983Simp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31159126Sthompsa * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32159126Sthompsa * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33108983Simp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34187743Ssam * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35225861Swblock * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36225861Swblock * SUCH DAMAGE. 37187743Ssam * 38187743Ssam * @(#)grp.h 8.2 (Berkeley) 1/21/94 39159126Sthompsa * $FreeBSD: head/include/grp.h 93514 2002-04-01 08:12:25Z mike $ 40159126Sthompsa */ 41159126Sthompsa 42159126Sthompsa#ifndef _GRP_H_ 43108983Simp#define _GRP_H_ 44108983Simp 45147088Sbrooks#include <sys/cdefs.h> 46225861Swblock#include <machine/ansi.h> 47147088Sbrooks 48216983Sjpaetzel#ifndef _POSIX_SOURCE 49147088Sbrooks#define _PATH_GROUP "/etc/group" 50147088Sbrooks#endif 51147088Sbrooks 52147088Sbrooks#ifdef _BSD_GID_T_ 53147088Sbrookstypedef _BSD_GID_T_ gid_t; 54148642Ssam#undef _BSD_GID_T_ 55175683Smtm#endif 56147088Sbrooks 57147088Sbrooksstruct group { 58148642Ssam char *gr_name; /* group name */ 59148642Ssam char *gr_passwd; /* group password */ 60148642Ssam gid_t gr_gid; /* group id */ 61148642Ssam char **gr_mem; /* group members */ 62148642Ssam}; 63148642Ssam 64148642Ssam__BEGIN_DECLS 65148642Ssamstruct group *getgrgid(gid_t); 66148642Ssamstruct group *getgrnam(const char *); 67148642Ssam#ifndef _POSIX_SOURCE 68148642Ssamstruct group *getgrent(void); 69148642Ssamint setgrent(void); 70148642Ssamvoid endgrent(void); 71148642Ssamvoid setgrfile(const char *); 72148642Ssamint setgroupent(int); 73148642Ssamconst char *group_from_gid(gid_t, int); 74148642Ssam#endif 75175683Smtm__END_DECLS 76148642Ssam 77148642Ssam#endif /* !_GRP_H_ */ 78108983Simp