.\" Copyright (c) 1989, 1991 The Regents of the University of California.
.\" %sccs.include.redist.man%
.\" @(#)getttyent.3 6.7 (Berkeley) %G%
.Fn getttynam "char *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:
.Bl -tag -width ty_comment
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:
.Bl -tag -width TTY_SECURE
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
return 0 on failure and 1 on success.
.Bl -tag -width /etc/ttys -compact
These functions use static data storage;
if the data is needed for future use, it should be
copied before any subsequent calls overwrite it.