📄 endpwent.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>endpwent</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_214"> </a>NAME</h4><blockquote>endpwent, getpwent, setpwent - user database functions</blockquote><h4><a name = "tag_000_003_215"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="pwd.h.html">pwd.h</a>>void endpwent(void);struct passwd *getpwent(void);void setpwent(void);</code></pre></blockquote><h4><a name = "tag_000_003_216"> </a>DESCRIPTION</h4><blockquote>The<i><a href="getpwent.html">getpwent()</a></i>function returns a pointer to a structure containing the broken-out fields ofan entry in the user database. Each entry in the user database contains a<b>passwd</b> structure. When first called,<i><a href="getpwent.html">getpwent()</a></i>returns a pointer to a <b>passwd</b> structure containing the first entry inthe user database. Thereafter, it returns a pointer to a <b>passwd</b>structure containing the next entry in the user database. Successive callscan be used to search the entire user database.<p>If an end-of-file or an error is encountered on reading,<i><a href="getpwent.html">getpwent()</a></i>returns a null pointer.<p>The<i><a href="setpwent.html">setpwent()</a></i>function effectively rewinds the user database to allow repeated searches.<p>The<i>endpwent()</i>function may be called to close the user database when processing is complete.<p>These interfaces need not be reentrant.</blockquote><h4><a name = "tag_000_003_217"> </a>RETURN VALUE</h4><blockquote>The<i><a href="getpwent.html">getpwent()</a></i>function returns a null pointer on end-of-file or error.</blockquote><h4><a name = "tag_000_003_218"> </a>ERRORS</h4><blockquote>The<i><a href="getpwent.html">getpwent()</a></i>,<i><a href="setpwent.html">setpwent()</a></i>and<i>endpwent()</i>functions may fail if:<dl compact><dt>[EIO]<dd>An I/O error has occurred.</dl><p>In addition,<i><a href="getpwent.html">getpwent()</a></i>and<i><a href="setpwent.html">setpwent()</a></i>may fail if:<dl compact><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><p>The return value may point to a static area which is overwrittenby a subsequent call to<i><a href="getpwuid.html">getpwuid()</a></i>,<i><a href="getpwnam.html">getpwnam()</a></i>or<i><a href="getpwent.html">getpwent()</a></i>.</blockquote><h4><a name = "tag_000_003_219"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_003_220"> </a>APPLICATION USAGE</h4><blockquote>These functions are provided due to their historical usage. Applicationsshould avoid dependencies on fields in the password database, whether thedatabase is a single file, or where in the filesystem namespace the databaseresides. Applications should use<i><a href="getpwuid.html">getpwuid()</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_221"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_003_222"> </a>SEE ALSO</h4><blockquote><i><a href="endgrent.html">endgrent()</a></i>,<i><a href="getlogin.html">getlogin()</a></i>,<i><a href="getpwnam.html">getpwnam()</a></i>,<i><a href="getpwuid.html">getpwuid()</a></i>,<i><a href="pwd.h.html"><pwd.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 + -