share/mk/: build-html: Don't build mbind.2 and set_mempolicy.2
[man-pages.git] / man3 / getttyent.3
blob7c694e5fe5f51020bb40f90d055bf33432c790c9
1 '\" t
2 .\"  Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de)
3 .\"
4 .\" SPDX-License-Identifier: GPL-1.0-or-later
5 .\"
6 .TH getttyent 3 (date) "Linux man-pages (unreleased)"
7 .SH NAME
8 getttyent, getttynam, setttyent, endttyent \- get ttys file entry
9 .SH LIBRARY
10 Standard C library
11 .RI ( libc ", " \-lc )
12 .SH SYNOPSIS
13 .nf
14 .B "#include <ttyent.h>"
16 .B "struct ttyent *getttyent(void);"
17 .BI "struct ttyent *getttynam(const char *" name );
19 .B "int setttyent(void);"
20 .B "int endttyent(void);"
21 .fi
22 .SH DESCRIPTION
23 These functions provide an interface to the file
24 .B _PATH_TTYS
25 (e.g.,
26 .IR /etc/ttys ).
28 The function
29 .BR setttyent ()
30 opens the file or rewinds it if already open.
32 The function
33 .BR endttyent ()
34 closes the file.
36 The function
37 .BR getttynam ()
38 searches for a given terminal name in the file.
39 It returns a pointer to a
40 .I ttyent
41 structure (description below).
43 The function
44 .BR getttyent ()
45 opens the file
46 .B _PATH_TTYS
47 (if necessary) and returns the first entry.
48 If the file is already open, the next entry.
49 The
50 .I ttyent
51 structure has the form:
53 .in +4n
54 .EX
55 struct ttyent {
56     char *ty_name;     /* terminal device name */
57     char *ty_getty;    /* command to execute, usually getty */
58     char *ty_type;     /* terminal type for termcap */
59     int   ty_status;   /* status flags */
60     char *ty_window;   /* command to start up window manager */
61     char *ty_comment;  /* comment field */
63 .EE
64 .in
66 .I ty_status
67 can be:
69 .in +4n
70 .EX
71 #define TTY_ON     0x01  /* enable logins (start ty_getty program) */
72 #define TTY_SECURE 0x02  /* allow UID 0 to login */
73 .EE
74 .in
75 .SH ATTRIBUTES
76 For an explanation of the terms used in this section, see
77 .BR attributes (7).
78 .TS
79 allbox;
80 lbx lb lb
81 l l l.
82 Interface       Attribute       Value
84 .na
85 .nh
86 .BR getttyent (),
87 .BR setttyent (),
88 .BR endttyent (),
89 .BR getttynam ()
90 T}      Thread safety   MT-Unsafe race:ttyent
91 .TE
92 .SH STANDARDS
93 BSD.
94 .SH NOTES
95 Under Linux, the file
96 .IR /etc/ttys ,
97 and the functions described above, are not used.
98 .SH SEE ALSO
99 .BR ttyname (3),
100 .BR ttyslot (3)