Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

getpass(3) [osf1 man page]

getpass(3)						     Library Functions Manual							getpass(3)

NAME
getpass - Reads a password LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <unistd.h> char *getpass( const char *prompt); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: getpass(): XSH4.2 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Points to the prompt string that is written to stderr. DESCRIPTION
The getpass() function opens the process' controlling terminal file, flushes output, disables echoing, and reads up to a newline character or an end-of-file (EOF) character. The terminal state is then restored and the controlling terminal is closed. If the getpass() function is interrupted by the SIGINT signal, the terminal state is restored before the signal is delivered to the calling process. NOTES
[Tru64 UNIX] The getpass() function is not threadsafe because it manipulates global signal state. The getpass() function is scheduled to be withdrawn from a future version of the X/Open CAE Specification. RETURN VALUES
Upon successful completion, the getpass() function returns a pointer string of no more than PASS_MAX bytes plus a terminating null value. This return value points to data that is overwritten by successive calls. If the controlling terminal file cannot be opened, the terminal state is restored and a null pointer is returned. ERRORS
The getpass() function sets errno to the specified values for the following conditions: [Tru64 UNIX] Search permission is denied on a com- ponent of the pathname prefix; or the file exists and the permissions specified by the mode parameter are denied; or the file does not exist and write permission is denied for the parent directory of the file to be created. The function was interrupted by a signal that was caught. Too many file descriptors are currently open in the calling process (exceeding OPEN_MAX). [Tru64 UNIX] Either the OPEN_MAX value or the per-process soft descriptor limit is checked. Too many files are currently open in the system. [Tru64 UNIX] The named file does not exist or the path parameter points to an empty string. The process does not have a controlling terminal. RELATED INFORMATION
Functions: fopen(3). Files: tty(7), termios(4). Standards: standards(5) delim off getpass(3)

Check Out this Related Man Page

getpass(3C)						   Standard C Library Functions 					       getpass(3C)

NAME
getpass, getpassphrase - read a string of characters without echo SYNOPSIS
#include <stdlib.h> char *getpass(const char *prompt); char *getpassphrase(const char *prompt); XPG4, SUS, SUSv2 #include <unistd.h> char *getpass(const char *prompt); DESCRIPTION
The getpass() function opens the process's controlling terminal, writes to that device the null-terminated string prompt, disables echoing, reads a string of characters up to the next newline character or EOF, restores the terminal state and closes the terminal. The getpassphrase() function is identical to getpass(), except that it reads and returns a string of up to 257 characters in length. RETURN VALUES
Upon successful completion, getpass() returns a pointer to a null-terminated string of at most 9 bytes that were read from the terminal device. If an error is encountered, the terminal state is restored and a null pointer is returned. ERRORS
The getpass() and getpassphrase() functions may fail if: EINTR The function was interrupted by a signal. EIO The process is a member of a background process attempting to read from its controlling terminal, the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. EMFILE OPEN_MAX file descriptors are currently open in the calling process. ENFILE The maximum allowable number of files is currently open in the system. ENXIO The process does not have a controlling terminal. USAGE
The return value points to static data whose content may be overwritten by each call. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |getpass() is Standard. | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5), standards(5) SunOS 5.10 2 Sep 2003 getpass(3C)
Man Page