getpass()

NAME

getpass() - get user's password

SYNOPSIS

char * getpass (const char *prompt);

DESCRIPTION

The getpass(3) function prompts the user for his or her password, using the specified prompt. It turns off terminal echo while the password is being entered.

The function reads and writes to /dev/tty if possible; otherwise it reads from standard in and writes to standard error.

The password may be up to _PASSWORD_LEN (currently 128) characters in length. Any additional characters and the terminating newline character are discarded.

DIAGNOSTICS

The getpass(3) utility returns a pointer to the null terminated password.

FILES

The getpass(3) routine makes use of the following files:

/dev/tty
The terminal.