]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/getttyent.3
user_namespaces.7: Minor rewordings of recently added text
[thirdparty/man-pages.git] / man3 / getttyent.3
1 .\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de)
2 .\"
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Distributed under GPL
5 .\" %%%LICENSE_END
6 .\"
7 .TH GETTTYENT 3 2017-09-15 "GNU" "Linux Programmer's Manual"
8 .SH NAME
9 getttyent, getttynam, setttyent, endttyent \- get ttys file entry
10 .SH SYNOPSIS
11 .B "#include <ttyent.h>"
12 .PP
13 .B "struct ttyent *getttyent(void);"
14 .PP
15 .BI "struct ttyent *getttynam(const char *" name );
16 .PP
17 .B "int setttyent(void);"
18 .PP
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 ).
25 .PP
26 The function
27 .BR setttyent ()
28 opens the file or rewinds it if already open.
29 .PP
30 The function
31 .BR endttyent ()
32 closes the file.
33 .PP
34 The function
35 .BR getttynam ()
36 searches for a given terminal name in the file.
37 It returns a pointer to a
38 .I ttyent
39 structure (description below).
40 .PP
41 The function
42 .BR getttyent ()
43 opens the file
44 .B _PATH_TTYS
45 (if necessary) and returns the first entry.
46 If the file is already open, the next entry.
47 The
48 .I ttyent
49 structure has the form:
50 .PP
51 .in +4n
52 .EX
53 struct ttyent {
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 */
60 };
61 .EE
62 .in
63 .PP
64 .I ty_status
65 can be:
66 .PP
67 .in +4n
68 .EX
69 #define TTY_ON 0x01 /* enable logins (start ty_getty program) */
70 #define TTY_SECURE 0x02 /* allow UID 0 to login */
71 .EE
72 .in
73 .SH ATTRIBUTES
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 (),
85 .BR getttynam ()
86 T} Thread safety MT-Unsafe race:ttyent
87 .TE
88 .SH CONFORMING TO
89 Not in POSIX.1.
90 Present on the BSDs, and perhaps other systems.
91 .SH NOTES
92 Under Linux, the file
93 .IR /etc/ttys ,
94 and the functions described above, are not used.
95 .SH SEE ALSO
96 .BR ttyname (3),
97 .BR ttyslot (3)