Commit | Line | Data |
---|---|---|
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 | |
10 | getttyent, 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, | |
26 | and | |
27 | .I getttynam | |
28 | each return a pointer to an object with the | |
29 | following structure | |
30 | containing the broken-out | |
31 | fields 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 | |
42 | is the name of the character-special file in the directory ``/dev". | |
43 | For various reasons, it must reside in the directory ``/dev". | |
44 | .IP ty_getty | |
45 | is the command (usually | |
46 | .IR getty (8)) | |
47 | which is invoked by | |
48 | .I init | |
49 | to initialize tty line characteristics. | |
50 | In fact, any arbitrary command can be used; | |
51 | a typical use is to initiate a terminal emulator in a window system. | |
52 | .IP ty_type | |
53 | is the name of the default terminal type connected to this tty line. This | |
54 | is typically a name from the | |
55 | .IR termcap (5) | |
56 | data base. | |
57 | The environment variable `TERM' is initialized with this name by | |
49b0b294 MK |
58 | .IR getty (8) |
59 | or | |
53e9b2ee KM |
60 | .IR login (1). |
61 | .IP ty_status | |
62 | is a mask of bit fields which indicate various actions to be allowed on this | |
63 | tty line. The following is a description of each flag. | |
64 | .RS | |
65 | .IP TTY_ON \w'TTY_SECURE'u+3 | |
49b0b294 | 66 | Enables logins (i.e., |
53e9b2ee KM |
67 | .IR init (8) |
68 | will start the specified ``getty" command | |
49b0b294 | 69 | on this entry). |
53e9b2ee KM |
70 | .IP TTY_SECURE |
71 | Allows root to login on this terminal. Note that `TTY_ON' must be included | |
72 | for this to be useful. | |
73 | .RE | |
74 | .IP ty_window | |
bcba0a8e JL |
75 | is the command to execute for a window system |
76 | associated with the line. The window system will be started before | |
77 | the command specified in the | |
78 | .I ty_getty | |
79 | entry is executed. | |
49b0b294 | 80 | If none is specified, this will be null. |
53e9b2ee | 81 | .IP ty_comment |
49b0b294 MK |
82 | is the trailing comment field, if any; a leading delimiter and white space |
83 | will be removed. | |
53e9b2ee KM |
84 | .PP |
85 | .I Getttyent | |
86 | reads the next | |
49b0b294 | 87 | line from the ttys file, opening the file if necessary; |
53e9b2ee KM |
88 | .I setttyent |
89 | rewinds the file; | |
90 | .I endttyent | |
91 | closes it. | |
92 | .PP | |
93 | .I Getttynam | |
94 | searches from the beginning of the file until a matching | |
95 | .I name | |
96 | is found | |
97 | (or until EOF is encountered). | |
98 | .SH FILES | |
99 | /etc/ttys | |
100 | .SH "SEE ALSO" | |
49b0b294 | 101 | login(1), ttyslot(3), ttys(5), gettytab(5), termcap(5), getty(8), init(8) |
53e9b2ee KM |
102 | .SH DIAGNOSTICS |
103 | Null pointer | |
104 | (0) returned on EOF or error. | |
105 | .SH BUGS | |
106 | All information | |
107 | is contained in a static area | |
108 | so it must be copied if it is | |
109 | to be saved. |