1 .\" Copyright (c) 1989, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 4. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)getttyent.3 8.1 (Berkeley) 6/4/93
51 .Fn getttynam "const char *name"
57 .Fn isdialuptty "const char *name"
59 .Fn isnettty "const char *name"
66 each return a pointer to an object, with the following structure,
67 containing the broken-out fields of a line from the tty description
71 char *ty_name; /* terminal device name */
72 char *ty_getty; /* command to execute, usually getty */
73 char *ty_type; /* terminal type for termcap */
74 #define TTY_ON 0x01 /* enable logins (start ty_getty program) */
75 #define TTY_SECURE 0x02 /* allow uid of 0 to login */
76 #define TTY_DIALUP 0x04 /* is a dialup tty */
77 #define TTY_NETWORK 0x08 /* is a network tty */
78 int ty_status; /* status flags */
79 char *ty_window; /* command to start up window manager */
80 char *ty_comment; /* comment field */
81 char *ty_group; /* tty group name */
85 The fields are as follows:
86 .Bl -tag -width ty_comment
88 The name of the character-special file.
90 The name of the command invoked by
92 to initialize tty line characteristics.
94 The name of the default terminal type connected to this tty line.
96 A mask of bit fields which indicate various actions allowed on this
98 The possible flags are as follows:
99 .Bl -tag -width TTY_NETWORK
101 Enables logins (i.e.,
103 will start the command referenced by
107 Allow users with a uid of 0 to login on this terminal.
109 Identifies a tty as a dialin line.
110 If this flag is set, then
112 will return a non-zero value.
114 Identifies a tty used for network connections.
115 If this flag is set, then
117 will return a non-zero value.
120 The command to execute for a window system associated with the line.
122 A group name to which the tty belongs.
123 If no group is specified in the ttys description file,
124 then the tty is placed in an anonymous group called "none".
126 Any trailing comment field, with any leading hash marks (``#'') or
130 If any of the fields pointing to character strings are unspecified,
131 they are returned as null pointers.
134 will be zero if no flag values are specified.
138 for a more complete discussion of the meaning and usage of the
144 reads the next line from the ttys file, opening the file if necessary.
148 rewinds the file if open, or opens the file if it is unopened.
152 closes any open files.
157 searches from the beginning of the file until a matching
168 return a null pointer on
176 return 0 on failure and 1 on success.
182 return non-zero if the dialup or network flag is set for the
183 tty entry relating to the tty named by the argument, and
186 .Bl -tag -width /etc/ttys -compact
203 functions appeared in
206 These functions use static data storage;
207 if the data is needed for future use, it should be
208 copied before any subsequent calls overwrite it.