GETPASS(3C) BSD GETPASS(3C)
NAME
getpass - read a password
SYNOPSIS
#include <stdlib.h>
char *getpass (prompt)
const char *prompt;
DESCRIPTION
getpass displays the null terminated string prompt on the standard error
output, disables echoing, and then reads up to a newline or EOF from the
file /dev/tty. It returns a pointer to a null terminated string of at
most 8 characters.
The getpass function marks for update the st_atime and st_mtime fields of
the file /dev/tty.
DIAGNOSTICS
Upon successful completion, the getpass function returns a pointer to a
null-terminated string of no more than PASS_MAX characters. This return
value points to data that is overwritten by successive calls. If the
/dev/tty file cannot be opened, a NULL pointer is returned. An interrupt
terminates input and sends an interrupt signal to the calling program
before returning.
NOTES
The return value points to static data whose content is overwritten by
each call.
getpass uses <stdio.h>, which causes it to increase the size of programs
not otherwise using standard I/O more than might be expected.
FILES
/dev/tty