]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de) |
2297bf0e | 2 | .\" |
38f20bb9 | 3 | .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE) |
b18188c5 | 4 | .\" Distributed under GPL |
38f20bb9 | 5 | .\" %%%LICENSE_END |
c13182ef | 6 | .\" |
4b8c67d9 | 7 | .TH GETTTYENT 3 2017-09-15 "GNU" "Linux Programmer's Manual" |
fea681da | 8 | .SH NAME |
c65433e6 | 9 | getttyent, getttynam, setttyent, endttyent \- get ttys file entry |
fea681da | 10 | .SH SYNOPSIS |
fea681da | 11 | .B "#include <ttyent.h>" |
68e4db0a | 12 | .PP |
fea681da | 13 | .B "struct ttyent *getttyent(void);" |
68e4db0a | 14 | .PP |
fea681da | 15 | .BI "struct ttyent *getttynam(const char *" name ); |
68e4db0a | 16 | .PP |
fea681da | 17 | .B "int setttyent(void);" |
68e4db0a | 18 | .PP |
fea681da MK |
19 | .B "int endttyent(void);" |
20 | .SH DESCRIPTION | |
21 | These functions provide an interface to the file | |
22 | .B _PATH_TTYS | |
23 | (e.g., | |
24 | .IR /etc/ttys ). | |
847e0d88 | 25 | .PP |
c13182ef | 26 | The function |
fea681da MK |
27 | .BR setttyent () |
28 | opens the file or rewinds it if already open. | |
847e0d88 | 29 | .PP |
fea681da | 30 | The function |
f87925c6 | 31 | .BR endttyent () |
fea681da | 32 | closes the file. |
847e0d88 | 33 | .PP |
c13182ef | 34 | The function |
fea681da | 35 | .BR getttynam () |
1285ff3d | 36 | searches for a given terminal name in the file. |
c13182ef | 37 | It returns a pointer to a |
433dc4d5 MK |
38 | .I ttyent |
39 | structure (description below). | |
847e0d88 | 40 | .PP |
fea681da MK |
41 | The function |
42 | .BR getttyent () | |
2f0af33b MK |
43 | opens the file |
44 | .B _PATH_TTYS | |
45 | (if necessary) and returns the first entry. | |
fea681da | 46 | If the file is already open, the next entry. |
5f90f492 MK |
47 | The |
48 | .I ttyent | |
49 | structure has the form: | |
e646a1ba | 50 | .PP |
088a639b | 51 | .in +4n |
e646a1ba | 52 | .EX |
fea681da | 53 | struct ttyent { |
5f90f492 MK |
54 | char *ty_name; /* terminal device name */ |
55 | char *ty_getty; /* command to execute, usually getty */ | |
56 | char *ty_type; /* terminal type for termcap */ | |
57 | int ty_status; /* status flags */ | |
58 | char *ty_window; /* command to start up window manager */ | |
59 | char *ty_comment; /* comment field */ | |
fea681da | 60 | }; |
b8302363 | 61 | .EE |
5f90f492 | 62 | .in |
847e0d88 | 63 | .PP |
fea681da | 64 | .I ty_status |
5f90f492 | 65 | can be: |
207050fa MK |
66 | .PP |
67 | .in +4n | |
68 | .EX | |
5f90f492 MK |
69 | #define TTY_ON 0x01 /* enable logins (start ty_getty program) */ |
70 | #define TTY_SECURE 0x02 /* allow UID 0 to login */ | |
207050fa MK |
71 | .EE |
72 | .in | |
8c3a681e | 73 | .SH ATTRIBUTES |
849df2a4 PH |
74 | For an explanation of the terms used in this section, see |
75 | .BR attributes (7). | |
76 | .TS | |
77 | allbox; | |
78 | lbw25 lb lb | |
79 | l l l. | |
80 | Interface Attribute Value | |
81 | T{ | |
82 | .BR getttyent (), | |
83 | .BR setttyent (), | |
84 | .BR endttyent (), | |
8c3a681e | 85 | .BR getttynam () |
849df2a4 PH |
86 | T} Thread safety MT-Unsafe race:ttyent |
87 | .TE | |
47297adb | 88 | .SH CONFORMING TO |
5b97d277 | 89 | Not in POSIX.1. |
2b2581ee | 90 | Present on the BSDs, and perhaps other systems. |
fea681da | 91 | .SH NOTES |
eb9a0b2f | 92 | Under Linux, the file |
fea681da MK |
93 | .IR /etc/ttys , |
94 | and the functions described above, are not used. | |
47297adb | 95 | .SH SEE ALSO |
fea681da MK |
96 | .BR ttyname (3), |
97 | .BR ttyslot (3) |