getpass - Reads a password
Standard C Library (libc.so, libc.a)
const char *prompt);
Interfaces documented on this reference page conform to industry standards as follows:
getpass(): XPG4, XPG4-UNIX
Refer to the standards(5) reference page for more information about industry standards and associated tags.
Points to the prompt string that is written to stderr.
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.
[DIGITAL] 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.
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.
The getpass() function sets errno to the specified values for the following conditions: [DIGITAL] Search permission is denied on a component 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).
Files: tty(7), termios(4).
Standards: standards(5) delim off