]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/getttyent.3
_exit.2, bpf.2, cacheflush.2, capget.2, chdir.2, chmod.2, chroot.2, clock_getres...
[thirdparty/man-pages.git] / man3 / getttyent.3
CommitLineData
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.\"
fe0fefbf 7.TH GETTTYENT 3 2015-03-02 "GNU" "Linux Programmer's Manual"
fea681da 8.SH NAME
c65433e6 9getttyent, 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
21These functions provide an interface to the file
22.B _PATH_TTYS
23(e.g.,
24.IR /etc/ttys ).
25
c13182ef 26The function
fea681da
MK
27.BR setttyent ()
28opens the file or rewinds it if already open.
29
30The function
f87925c6 31.BR endttyent ()
fea681da
MK
32closes the file.
33
c13182ef 34The function
fea681da 35.BR getttynam ()
1285ff3d 36searches for a given terminal name in the file.
c13182ef 37It returns a pointer to a
433dc4d5
MK
38.I ttyent
39structure (description below).
fea681da
MK
40
41The function
42.BR getttyent ()
2f0af33b
MK
43opens the file
44.B _PATH_TTYS
45(if necessary) and returns the first entry.
fea681da 46If the file is already open, the next entry.
5f90f492
MK
47The
48.I ttyent
49structure has the form:
088a639b 50.in +4n
fea681da 51.nf
5f90f492 52
fea681da 53struct 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
MK
60};
61.fi
5f90f492 62.in
fea681da
MK
63
64.I ty_status
5f90f492 65can be:
fea681da
MK
66.br
67.nf
5f90f492
MK
68
69#define TTY_ON 0x01 /* enable logins (start ty_getty program) */
70#define TTY_SECURE 0x02 /* allow UID 0 to login */
fea681da 71.fi
8c3a681e 72.SH ATTRIBUTES
849df2a4
PH
73For an explanation of the terms used in this section, see
74.BR attributes (7).
75.TS
76allbox;
77lbw25 lb lb
78l l l.
79Interface Attribute Value
80T{
81.BR getttyent (),
82.BR setttyent (),
83.BR endttyent (),
8c3a681e 84.BR getttynam ()
849df2a4
PH
85T} Thread safety MT-Unsafe race:ttyent
86.TE
47297adb 87.SH CONFORMING TO
5b97d277 88Not in POSIX.1.
2b2581ee 89Present on the BSDs, and perhaps other systems.
fea681da 90.SH NOTES
eb9a0b2f 91Under Linux, the file
fea681da
MK
92.IR /etc/ttys ,
93and the functions described above, are not used.
47297adb 94.SH SEE ALSO
fea681da
MK
95.BR ttyname (3),
96.BR ttyslot (3)