logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

endgrent.3p (4935B)


  1. '\" et
  2. .TH ENDGRENT "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. endgrent,
  12. getgrent,
  13. setgrent
  14. \(em group database entry functions
  15. .SH SYNOPSIS
  16. .LP
  17. .nf
  18. #include <grp.h>
  19. .P
  20. void endgrent(void);
  21. struct group *getgrent(void);
  22. void setgrent(void);
  23. .fi
  24. .SH DESCRIPTION
  25. The
  26. \fIgetgrent\fR()
  27. function shall return a pointer to a structure containing the broken-out
  28. fields of an entry in the group database. If the group database
  29. is not already open,
  30. \fIgetgrent\fR()
  31. shall open it and return a pointer to a
  32. .BR group
  33. structure containing the first entry in the database. Thereafter,
  34. it shall return a pointer to a
  35. .BR group
  36. structure containing the next
  37. .BR group
  38. structure in the group database, so successive calls may be used
  39. to search the entire database.
  40. .P
  41. An implementation that provides extended security controls may impose
  42. further implementation-defined restrictions on accessing the group
  43. database. In particular, the system may deny the existence of some or
  44. all of the group database entries associated with groups other than
  45. those groups associated with the caller and may omit users other than
  46. the caller from the list of members of groups in database entries that
  47. are returned.
  48. .P
  49. The
  50. \fIsetgrent\fR()
  51. function shall rewind the group database so that the next
  52. \fIgetgrent\fR()
  53. call returns the first entry, allowing repeated searches.
  54. .P
  55. The
  56. \fIendgrent\fR()
  57. function shall close the group database.
  58. .P
  59. The
  60. \fIsetgrent\fR()
  61. and
  62. \fIendgrent\fR()
  63. functions shall not change the setting of
  64. .IR errno
  65. if successful.
  66. .P
  67. On error, the
  68. \fIsetgrent\fR()
  69. and
  70. \fIendgrent\fR()
  71. functions shall set
  72. .IR errno
  73. to indicate the error.
  74. .P
  75. Since no value is returned by the
  76. \fIsetgrent\fR()
  77. and
  78. \fIendgrent\fR()
  79. functions, an application wishing to check for error situations
  80. should set
  81. .IR errno
  82. to 0, then call the function, then check
  83. .IR errno .
  84. .P
  85. These functions need not be thread-safe.
  86. .SH "RETURN VALUE"
  87. On successful completion,
  88. \fIgetgrent\fR()
  89. shall return a pointer to a
  90. .BR group
  91. structure. On end-of-file,
  92. \fIgetgrent\fR()
  93. shall return a null pointer and shall not change the setting of
  94. .IR errno .
  95. On error,
  96. \fIgetgrent\fR()
  97. shall return a null pointer and
  98. .IR errno
  99. shall be set to indicate the error.
  100. .P
  101. The application shall not modify the structure to which the return
  102. value points, nor any storage areas pointed to by pointers within the
  103. structure. The returned pointer, and pointers within the structure,
  104. might be invalidated or the structure or the storage areas might be
  105. overwritten by a subsequent call to
  106. \fIgetgrgid\fR(),
  107. \fIgetgrnam\fR(),
  108. or
  109. \fIgetgrent\fR().
  110. The returned pointer, and pointers within the structure, might
  111. also be invalidated if the calling thread is terminated.
  112. .SH ERRORS
  113. These functions may fail if:
  114. .TP
  115. .BR EINTR
  116. A signal was caught during the operation.
  117. .TP
  118. .BR EIO
  119. An I/O error has occurred.
  120. .P
  121. In addition, the
  122. \fIgetgrent\fR()
  123. and
  124. \fIsetgrent\fR()
  125. functions may fail if:
  126. .TP
  127. .BR EMFILE
  128. All file descriptors available to the process are currently open.
  129. .TP
  130. .BR ENFILE
  131. The maximum allowable number of files is currently open in the system.
  132. .LP
  133. .IR "The following sections are informative."
  134. .SH EXAMPLES
  135. None.
  136. .SH "APPLICATION USAGE"
  137. These functions are provided due to their historical usage.
  138. Applications should avoid dependencies on fields in the group database,
  139. whether the database is a single file, or where in the file system
  140. name space the database resides. Applications should use
  141. \fIgetgrnam\fR()
  142. and
  143. \fIgetgrgid\fR()
  144. whenever possible because it avoids these dependencies.
  145. .SH RATIONALE
  146. None.
  147. .SH "FUTURE DIRECTIONS"
  148. None.
  149. .SH "SEE ALSO"
  150. .IR "\fIendpwent\fR\^(\|)",
  151. .IR "\fIgetgrgid\fR\^(\|)",
  152. .IR "\fIgetgrnam\fR\^(\|)",
  153. .IR "\fIgetlogin\fR\^(\|)"
  154. .P
  155. The Base Definitions volume of POSIX.1\(hy2017,
  156. .IR "\fB<grp.h>\fP"
  157. .\"
  158. .SH COPYRIGHT
  159. Portions of this text are reprinted and reproduced in electronic form
  160. from IEEE Std 1003.1-2017, Standard for Information Technology
  161. -- Portable Operating System Interface (POSIX), The Open Group Base
  162. Specifications Issue 7, 2018 Edition,
  163. Copyright (C) 2018 by the Institute of
  164. Electrical and Electronics Engineers, Inc and The Open Group.
  165. In the event of any discrepancy between this version and the original IEEE and
  166. The Open Group Standard, the original IEEE and The Open Group Standard
  167. is the referee document. The original Standard can be obtained online at
  168. http://www.opengroup.org/unix/online.html .
  169. .PP
  170. Any typographical or formatting errors that appear
  171. in this page are most likely
  172. to have been introduced during the conversion of the source files to
  173. man page format. To report such errors, see
  174. https://www.kernel.org/doc/man-pages/reporting_bugs.html .