.\" Copyright (c) 1989 The Regents of the University of California.
.\" %sccs.include.redist.man%
.\" @(#)getttyent.3 6.6 (Berkeley) %G%
getttyent, getttynam, setttyent, endttyent \- get ttys file entry
.B struct ttyent *getttyent()
.B struct ttyent *getttynam(name)
each return a pointer to an object, with the following structure,
containing the broken-out fields of a line from the tty description
char *ty_name; /* terminal device name */
char *ty_getty; /* command to execute */
char *ty_type; /* terminal type */
#define TTY_ON 0x01 /* enable logins */
#define TTY_SECURE 0x02 /* allow uid of 0 to login */
int ty_status; /* flag values */
char *ty_window; /* command for window manager */
char *ty_comment; /* comment field */
The fields are as follows:
The name of the character-special file.
The name of the command invoked by
to initialize tty line characteristics.
The name of the default terminal type connected to this tty line.
A mask of bit fields which indicate various actions allowed on this
The possible flags are as follows:
will start the command referenced by
Allow users with a uid of 0 to login on this terminal.
The command to execute for a window system associated with the line.
Any trailing comment field, with any leading hash marks (``#'') or
If any of the fields pointing to character strings are unspecified,
they are returned as null pointers.
will be zero if no flag values are specified.
for a more complete discussion of the meaning and usage of the
reads the next line from the ttys file, opening the file if necessary.
rewinds the file if open, or opens the file if it is unopened.
searches from the beginning of the file until a matching
(or until EOF is encountered).
login(1), ttyslot(3), gettytab(5), termcap(5), ttys(5), getty(8), init(8)
return a null pointer on EOF or error.
return 0 on failure and 1 on success.
All information is contained in a static area so it must be copied if