]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/getttyent.3
getent.1, intro.1, time.1, _exit.2, _syscall.2, accept.2, access.2, acct.2, adjtimex...
[thirdparty/man-pages.git] / man3 / getttyent.3
CommitLineData
fea681da
MK
1.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de)
2.\" Distributed under GPL
c13182ef 3.\"
69962544 4.TH GETTTYENT 3 2002-07-18 "GNU" "Linux Programmer's Manual"
fea681da 5.SH NAME
c65433e6 6getttyent, getttynam, setttyent, endttyent \- get ttys file entry
fea681da 7.SH SYNOPSIS
fea681da
MK
8.B "#include <ttyent.h>"
9.sp
10.B "struct ttyent *getttyent(void);"
11.sp
12.BI "struct ttyent *getttynam(const char *" name );
13.sp
14.B "int setttyent(void);"
15.sp
16.B "int endttyent(void);"
17.SH DESCRIPTION
18These functions provide an interface to the file
19.B _PATH_TTYS
20(e.g.,
21.IR /etc/ttys ).
22
c13182ef 23The function
fea681da
MK
24.BR setttyent ()
25opens the file or rewinds it if already open.
26
27The function
f87925c6 28.BR endttyent ()
fea681da
MK
29closes the file.
30
c13182ef 31The function
fea681da 32.BR getttynam ()
1285ff3d 33searches for a given terminal name in the file.
c13182ef 34It returns a pointer to a
433dc4d5
MK
35.I ttyent
36structure (description below).
fea681da
MK
37
38The function
39.BR getttyent ()
2f0af33b
MK
40opens the file
41.B _PATH_TTYS
42(if necessary) and returns the first entry.
fea681da 43If the file is already open, the next entry.
5f90f492
MK
44The
45.I ttyent
46structure has the form:
088a639b 47.in +4n
fea681da 48.nf
5f90f492 49
fea681da 50struct ttyent {
5f90f492
MK
51 char *ty_name; /* terminal device name */
52 char *ty_getty; /* command to execute, usually getty */
53 char *ty_type; /* terminal type for termcap */
54 int ty_status; /* status flags */
55 char *ty_window; /* command to start up window manager */
56 char *ty_comment; /* comment field */
fea681da
MK
57};
58.fi
5f90f492 59.in
fea681da
MK
60
61.I ty_status
5f90f492 62can be:
fea681da
MK
63.br
64.nf
5f90f492
MK
65
66#define TTY_ON 0x01 /* enable logins (start ty_getty program) */
67#define TTY_SECURE 0x02 /* allow UID 0 to login */
fea681da 68.fi
47297adb 69.SH CONFORMING TO
2b2581ee
MK
70Not in POSIX.1-2001.
71Present on the BSDs, and perhaps other systems.
fea681da
MK
72.SH NOTES
73Under Linux the file
74.IR /etc/ttys ,
75and the functions described above, are not used.
47297adb 76.SH SEE ALSO
fea681da
MK
77.BR ttyname (3),
78.BR ttyslot (3)