grp.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* $NetBSD: grp.h,v 1.7 1995/04/29 05:30:40 cgd Exp $ */
  2. /*-
  3. * Copyright (c) 1989, 1993
  4. * 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 licensed
  7. * to the University of California by American Telephone and Telegraph
  8. * Co. or Unix System Laboratories, Inc. and are reproduced herein with
  9. * the permission of UNIX System Laboratories, Inc.
  10. *
  11. * Redistribution and use in source and binary forms, with or without
  12. * modification, are permitted provided that the following conditions
  13. * are met:
  14. * 1. Redistributions of source code must retain the above copyright
  15. * notice, this list of conditions and the following disclaimer.
  16. * 2. Redistributions in binary form must reproduce the above copyright
  17. * notice, this list of conditions and the following disclaimer in the
  18. * documentation and/or other materials provided with the distribution.
  19. * 3. Neither the name of the University nor the names of its contributors
  20. * may be used to endorse or promote products derived from this software
  21. * without specific prior written permission.
  22. *
  23. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  24. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  25. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  26. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  27. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  28. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  29. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  30. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  31. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  32. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  33. * SUCH DAMAGE.
  34. *
  35. * @(#)grp.h 8.2 (Berkeley) 1/21/94
  36. */
  37. #ifndef _GRP_H_
  38. #define _GRP_H_
  39. #include <sys/cdefs.h>
  40. #include <sys/types.h>
  41. #ifdef __CYGWIN__
  42. #include <cygwin/grp.h>
  43. #endif
  44. #if __BSD_VISIBLE
  45. #define _PATH_GROUP "/etc/group"
  46. #endif
  47. struct group {
  48. char *gr_name; /* group name */
  49. char *gr_passwd; /* group password */
  50. gid_t gr_gid; /* group id */
  51. char **gr_mem; /* group members */
  52. };
  53. #ifdef __cplusplus
  54. extern "C" {
  55. #endif
  56. #ifndef __INSIDE_CYGWIN__
  57. struct group *getgrgid (gid_t);
  58. struct group *getgrnam (const char *);
  59. #if __MISC_VISIBLE || __POSIX_VISIBLE
  60. int getgrnam_r (const char *, struct group *,
  61. char *, size_t, struct group **);
  62. int getgrgid_r (gid_t, struct group *,
  63. char *, size_t, struct group **);
  64. #endif /* __MISC_VISIBLE || __POSIX_VISIBLE */
  65. #if __MISC_VISIBLE || __XSI_VISIBLE >= 4
  66. struct group *getgrent (void);
  67. void setgrent (void);
  68. void endgrent (void);
  69. #endif /* __MISC_VISIBLE || __XSI_VISIBLE >= 4 */
  70. #if __BSD_VISIBLE
  71. int initgroups (const char *, gid_t);
  72. #endif /* __BSD_VISIBLE */
  73. #endif /* !__INSIDE_CYGWIN__ */
  74. #ifdef __cplusplus
  75. }
  76. #endif
  77. #endif /* !_GRP_H_ */