grp.h revision 203964
111695Sache/*- 211695Sache * Copyright (c) 1989, 1993 311695Sache * The Regents of the University of California. All rights reserved. 411695Sache * (c) UNIX System Laboratories, Inc. 511695Sache * All or some portions of this file are derived from material licensed 611695Sache * to the University of California by American Telephone and Telegraph 711695Sache * Co. or Unix System Laboratories, Inc. and are reproduced herein with 811695Sache * the permission of UNIX System Laboratories, Inc. 911695Sache * 1011695Sache * Redistribution and use in source and binary forms, with or without 1111695Sache * modification, are permitted provided that the following conditions 1211695Sache * are met: 1311695Sache * 1. Redistributions of source code must retain the above copyright 1411695Sache * notice, this list of conditions and the following disclaimer. 1511695Sache * 2. Redistributions in binary form must reproduce the above copyright 1611695Sache * notice, this list of conditions and the following disclaimer in the 1711695Sache * documentation and/or other materials provided with the distribution. 1811695Sache * 3. Neither the name of the University nor the names of its contributors 1911695Sache * may be used to endorse or promote products derived from this software 2011695Sache * without specific prior written permission. 2111695Sache * 2211695Sache * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2311695Sache * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2411695Sache * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2511695Sache * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2611695Sache * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2711695Sache * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2811695Sache * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2911695Sache * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3011695Sache * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3111695Sache * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3211695Sache * SUCH DAMAGE. 3311695Sache * 3411695Sache * @(#)grp.h 8.2 (Berkeley) 1/21/94 3511695Sache * $FreeBSD: head/include/grp.h 203964 2010-02-16 19:39:50Z imp $ 3611695Sache */ 37117270Sache 38117270Sache#ifndef _GRP_H_ 39117270Sache#define _GRP_H_ 4092986Sobrien 4192986Sobrien#include <sys/cdefs.h> 4292986Sobrien#include <sys/_types.h> 4311695Sache 4411695Sache#define _PATH_GROUP "/etc/group" 4511695Sache 4611695Sache#ifndef _GID_T_DECLARED 4711695Sachetypedef __gid_t gid_t; 4811695Sache#define _GID_T_DECLARED 4924694Sache#endif 50121845Stjr 51117270Sache#ifndef _SIZE_T_DECLARED 5222330Sachetypedef __size_t size_t; 5311695Sache#define _SIZE_T_DECLARED 5492905Sobrien#endif 5592905Sobrien 56104828Stjrstruct group { 5792905Sobrien char *gr_name; /* group name */ 58118146Sache char *gr_passwd; /* group password */ 59115626Sache gid_t gr_gid; /* group id */ 6092905Sobrien char **gr_mem; /* group members */ 6192905Sobrien}; 62115626Sache 6311695Sache__BEGIN_DECLS 64121845Stjr#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE 65121845Stjrvoid endgrent(void); 66121845Stjrstruct group *getgrent(void); 67121845Stjr#endif 68121845Stjrstruct group *getgrgid(gid_t); 69121845Stjrstruct group *getgrnam(const char *); 70121845Stjr#if __BSD_VISIBLE 71121845Stjrconst char *group_from_gid(gid_t, int); 72121845Stjr#endif 73121845Stjr#if __BSD_VISIBLE || __XSI_VISIBLE 74117274Sache/* XXX IEEE Std 1003.1, 2003 specifies `void setgrent(void)' */ 75117270Sacheint setgrent(void); 76117270Sache#endif 7711695Sache#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE 78101498Sacheint getgrgid_r(gid_t, struct group *, char *, size_t, 7911695Sache struct group **); 80117270Sacheint getgrnam_r(const char *, struct group *, char *, size_t, 81117270Sache struct group **); 82117270Sache#endif 83117270Sache#if __BSD_VISIBLE 84117270Sacheint getgrent_r(struct group *, char *, size_t, struct group **); 85117270Sacheint setgroupent(int); 86117270Sache#endif 87117270Sache__END_DECLS 88117270Sache 89117270Sache#endif /* !_GRP_H_ */ 90117270Sache