]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/getttyent.3
membarrier.2: Remove redundant mention of return value of MEMBARRIER_CMD_SHARED
[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 2015-03-02 "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 .sp
13 .B "struct ttyent *getttyent(void);"
14 .sp
15 .BI "struct ttyent *getttynam(const char *" name );
16 .sp
17 .B "int setttyent(void);"
18 .sp
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
26 The function
27 .BR setttyent ()
28 opens the file or rewinds it if already open.
29
30 The function
31 .BR endttyent ()
32 closes the file.
33
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
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 .in +4n
51 .nf
52
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 .fi
62 .in
63
64 .I ty_status
65 can be:
66 .br
67 .nf
68
69 #define TTY_ON 0x01 /* enable logins (start ty_getty program) */
70 #define TTY_SECURE 0x02 /* allow UID 0 to login */
71 .fi
72 .SH ATTRIBUTES
73 For an explanation of the terms used in this section, see
74 .BR attributes (7).
75 .TS
76 allbox;
77 lbw25 lb lb
78 l l l.
79 Interface Attribute Value
80 T{
81 .BR getttyent (),
82 .BR setttyent (),
83 .BR endttyent (),
84 .BR getttynam ()
85 T} Thread safety MT-Unsafe race:ttyent
86 .TE
87 .SH CONFORMING TO
88 Not in POSIX.1.
89 Present on the BSDs, and perhaps other systems.
90 .SH NOTES
91 Under Linux, the file
92 .IR /etc/ttys ,
93 and the functions described above, are not used.
94 .SH SEE ALSO
95 .BR ttyname (3),
96 .BR ttyslot (3)