modern syntax for asgops & inits cause Donn's latest ccom rejects the old.
[unix-history] / usr / src / lib / libc / gen / getttyent.3
CommitLineData
53e9b2ee
KM
1.\" Copyright (c) 1985 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
49b0b294 5.\" @(#)getttyent.3 6.4 (Berkeley) %G%
53e9b2ee
KM
6.\"
7.TH GETTTYENT 3 ""
8.UC 6
9.SH NAME
10getttyent, getttynam, setttyent, endttyent \- get ttys file entry
11.SH SYNOPSIS
12.nf
13.B #include <ttyent.h>
14.PP
15.B struct ttyent *getttyent()
16.PP
17.B struct ttyent *getttynam(name)
18.B char *name;
19.PP
1b848515 20.B setttyent()
53e9b2ee 21.PP
1b848515 22.B endttyent()
53e9b2ee
KM
23.fi
24.SH DESCRIPTION
25.I Getttyent,
26and
27.I getttynam
28each return a pointer to an object with the
29following structure
30containing the broken-out
31fields of a line from the tty description file.
32.RS
33.PP
34.nf
35.so /usr/include/ttyent.h
36.ft R
37.ad
38.fi
39.RE
40.PP
41.IP ty_name \w'ty_comment'u+3
42is the name of the character-special file in the directory ``/dev".
43For various reasons, it must reside in the directory ``/dev".
44.IP ty_getty
45is the command (usually
46.IR getty (8))
47which is invoked by
48.I init
49to initialize tty line characteristics.
50In fact, any arbitrary command can be used;
51a typical use is to initiate a terminal emulator in a window system.
52.IP ty_type
53is the name of the default terminal type connected to this tty line. This
54is typically a name from the
55.IR termcap (5)
56data base.
57The environment variable `TERM' is initialized with this name by
49b0b294
MK
58.IR getty (8)
59or
53e9b2ee
KM
60.IR login (1).
61.IP ty_status
62is a mask of bit fields which indicate various actions to be allowed on this
63tty line. The following is a description of each flag.
64.RS
65.IP TTY_ON \w'TTY_SECURE'u+3
49b0b294 66Enables logins (i.e.,
53e9b2ee
KM
67.IR init (8)
68will start the specified ``getty" command
49b0b294 69on this entry).
53e9b2ee
KM
70.IP TTY_SECURE
71Allows root to login on this terminal. Note that `TTY_ON' must be included
72for this to be useful.
73.RE
74.IP ty_window
bcba0a8e
JL
75is the command to execute for a window system
76associated with the line. The window system will be started before
77the command specified in the
78.I ty_getty
79entry is executed.
49b0b294 80If none is specified, this will be null.
53e9b2ee 81.IP ty_comment
49b0b294
MK
82is the trailing comment field, if any; a leading delimiter and white space
83will be removed.
53e9b2ee
KM
84.PP
85.I Getttyent
86reads the next
49b0b294 87line from the ttys file, opening the file if necessary;
53e9b2ee
KM
88.I setttyent
89rewinds the file;
90.I endttyent
91closes it.
92.PP
93.I Getttynam
94searches from the beginning of the file until a matching
95.I name
96is found
97(or until EOF is encountered).
98.SH FILES
99/etc/ttys
100.SH "SEE ALSO"
49b0b294 101login(1), ttyslot(3), ttys(5), gettytab(5), termcap(5), getty(8), init(8)
53e9b2ee
KM
102.SH DIAGNOSTICS
103Null pointer
104(0) returned on EOF or error.
105.SH BUGS
106All information
107is contained in a static area
108so it must be copied if it is
109to be saved.