📄 endgrent.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>endgrent</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_003_205"> </a>NAME</h4><blockquote>endgrent, getgrent, setgrent - group database entry functions</blockquote><h4><a name = "tag_000_003_206"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="grp.h.html">grp.h</a>>void endgrent(void);struct group *getgrent(void);void setgrent(void);</code></pre></blockquote><h4><a name = "tag_000_003_207"> </a>DESCRIPTION</h4><blockquote>The<i><a href="getgrent.html">getgrent()</a></i>function returns a pointer to a structure containing the broken-out fields ofan entry in the group database. When first called,<i><a href="getgrent.html">getgrent()</a></i>returns a pointer to a <b>group</b> structure containing the first entry in thegroup database. Thereafter, it returns a pointer to a <b>group</b> structurecontaining the next group structure in the group database, so successivecalls may be used to search the entire database.<p>The<i><a href="setgrent.html">setgrent()</a></i>function effectively rewinds the group database to allow repeated searches.<p>The<i>endgrent()</i>function may be called to close the group database when processing iscomplete.<p>These interfaces need not be reentrant.</blockquote><h4><a name = "tag_000_003_208"> </a>RETURN VALUE</h4><blockquote>When first called,<i><a href="getgrent.html">getgrent()</a></i>will return a pointer to the first group structure in the group database.Upon subsequent calls it returns the next group structure in the groupdatabase. The<i><a href="getgrent.html">getgrent()</a></i>function returns a null pointer on end-of-file or an error and<i>errno</i>may be set to indicate the error.<p>The return value may point to a static area which is overwrittenby a subsequent call to<i><a href="getgrgid.html">getgrgid()</a></i>,<i><a href="getgrnam.html">getgrnam()</a></i>or<i><a href="getgrent.html">getgrent()</a></i>.</blockquote><h4><a name = "tag_000_003_209"> </a>ERRORS</h4><blockquote>The<i><a href="getgrent.html">getgrent()</a></i>function may fail if:<dl compact><dt>[EINTR]<dd>A signal was caught during the operation.<dt>[EIO]<dd>An I/O error has occurred.<dt>[EMFILE]<dd>{OPEN_MAX} file descriptors are currently open in the calling process.<dt>[ENFILE]<dd>The maximum allowable number of files is currently open in the system.</dl></blockquote><h4><a name = "tag_000_003_210"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_003_211"> </a>APPLICATION USAGE</h4><blockquote>These functions are provided due to their historical usage. Applicationsshould avoid dependencies on fields in the group database, whether thedatabase is a single file, or where in the filesystem namespace the databaseresides. Applications should use<i><a href="getgrnam.html">getgrnam()</a></i>and<i><a href="getgrgid.html">getgrgid()</a></i>whenever possible both because it avoids these dependencies and for greaterportability with systems that conform to earlier versions of thisspecification.</blockquote><h4><a name = "tag_000_003_212"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_003_213"> </a>SEE ALSO</h4><blockquote><i><a href="getgrgid.html">getgrgid()</a></i>,<i><a href="getgrnam.html">getgrnam()</a></i>,<i><a href="getlogin.html">getlogin()</a></i>,<i><a href="getpwent.html">getpwent()</a></i>,<i><a href="grp.h.html"><grp.h></a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -