getty, which is invoked by init.8 opens and initializes a tty line, reads a login name, and invokes login.1
The tty argument is the name of the character-special file in /dev that corresponds to the terminal. If there is no tty argument, or the argument is `-', the tty line is assumed to be opened as file descriptor 0.
The type argument, if supplied, is used as an index into the gettytab.5 database--to determine the characteristics of the line. If this argument is absent, or if there is no such entry, the default entry is used. If there is no /etc/gettytab file, a set of system-supplied defaults is used.
When the indicated entry is located, getty clears the terminal screen, prints a banner heading, and prompts for a login name. Usually, either the banner or the login prompt includes the system's hostname.
Next, getty prompts for a login and reads the login name, one character at a time. When it receives a null character (which is assumed to be the result pressing the BREAK , or ``interrupt'' key), getty switches to the entry gettytab entry named in the nx field. It reinitializes the line to the new characteristics, and then prompts for a login once again. This mechanism typically is used to cycle through a set of line speeds (baud rates) for each terminal line. For instance, a rotary dialup might have entries for the speeds: 300, 1200, 150, and 110 baud, with each nx field pointing to the next one in succession.
The user terminates login input line with a NEWLINE or RETURN character. The latter is preferable; it sets up the proper treatment of RETURN characters (see tty.4 getty checks to see if the terminal has only upper-case alphabetical characters. If all alphabetical characters in the login name are in upper case, the system maps them along with all subsequent upper-case input characters to lower-case internally; they are displayed in upper case for the benefit of the terminal. To force recognition of an upper-case character, the shell allows them to be quoted (typically by preceding each with a backslash, `\').
Finally, getty calls login.1 with the login name as an argument.
getty can be set to time out after a certain interval; this hangs up dial-up lines if the login name is not entered in time.
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97