Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getpass(S) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought


 getpass(S)                     6 January 1993                     getpass(S)


 Name

    getpass - read a password

 Syntax


    cc  . . .  -lc


    char *getpass (prompt)
    char *prompt;


 Description

    The getpass function opens /dev/tty, 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 /dev/tty.

 Return value

    Upon successful completion, getpass returns a pointer to a null-
    terminated string of at most [PASSMAX] characters that were read from
    the terminal device.  If an error is encountered, for example if /dev/tty
    cannot be opened, the terminal state is restored and a NULL pointer is
    returned.  An interrupt terminates input and sends an interrupt signal to
    the calling program before returning.

 Diagnostics

    If the following condition occurs, the getpass routine may fail and errno
    is set to the following value:

    [EINTR]   The getpass routine was interrupted by a signal.

    [ENXIO]   The process does not have a controlling terminal.


 Note

    The return value points to static data whose content is overwritten by
    each call.

 Files

    /dev/tty

 Standards conformance

    getpass conforms with:
    AT&T SVID Issue 2;
    and X/Open Portability Guide, Issue 3, 1989.


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026