📄 getpass.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>getpass</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_005_635"> </a>NAME</h4><blockquote>getpass - read a string of characters without echo(<b>LEGACY</b>)</blockquote><h4><a name = "tag_000_005_636"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="unistd.h.html">unistd.h</a>>char *getpass(const char *<i>prompt</i>);</code></pre></blockquote><h4><a name = "tag_000_005_637"> </a>DESCRIPTION</h4><blockquote>The<i>getpass()</i>function opens the process' controlling terminal,writes to that device the null-terminated string<i>prompt,</i>disables echoing,reads a string of characters up to the next newline character or EOF,restores the terminal state and closes the terminal.<p>This interface need not be reentrant.</blockquote><h4><a name = "tag_000_005_638"> </a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>getpass()</i>returns a pointer to a null-terminated string of at most {PASS_MAX} bytesthat were read from the terminal device.If an error is encountered, the terminal state is restored anda null pointer is returned.</blockquote><h4><a name = "tag_000_005_639"> </a>ERRORS</h4><blockquote>The<i>getpass()</i>function may fail if:<dl compact><dt>[EINTR]<dd>The<i>getpass()</i>function was interrupted by a signal.<dt>[EIO]<dd>The process is a memberof a background process attempting to read from its controllingterminal, the process is ignoring or blocking the SIGTTIN signalor the process group is orphaned. This error may also be generated forimplementation-dependent reasons.<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.<dt>[ENXIO]<dd>The process does not have a controlling terminal.</dl></blockquote><h4><a name = "tag_000_005_640"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_641"> </a>APPLICATION USAGE</h4><blockquote>The return value points to static datawhose content may be overwritten by each call.<p>This function was marked <b>LEGACY</b> since it provides no functionalitywhich a user could not easily implement, and its name is misleading.</blockquote><h4><a name = "tag_000_005_642"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_643"> </a>SEE ALSO</h4><blockquote><i><a href="limits.h.html"><limits.h></a></i>,<i><a href="unistd.h.html"><unistd.h></a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from System V Release 2.0.</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 + -