]>
Commit | Line | Data |
---|---|---|
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 | 6 | getttyent, 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 | |
18 | These functions provide an interface to the file | |
19 | .B _PATH_TTYS | |
20 | (e.g., | |
21 | .IR /etc/ttys ). | |
22 | ||
c13182ef | 23 | The function |
fea681da MK |
24 | .BR setttyent () |
25 | opens the file or rewinds it if already open. | |
26 | ||
27 | The function | |
f87925c6 | 28 | .BR endttyent () |
fea681da MK |
29 | closes the file. |
30 | ||
c13182ef | 31 | The function |
fea681da | 32 | .BR getttynam () |
1285ff3d | 33 | searches for a given terminal name in the file. |
c13182ef | 34 | It returns a pointer to a |
433dc4d5 MK |
35 | .I ttyent |
36 | structure (description below). | |
fea681da MK |
37 | |
38 | The function | |
39 | .BR getttyent () | |
2f0af33b MK |
40 | opens the file |
41 | .B _PATH_TTYS | |
42 | (if necessary) and returns the first entry. | |
fea681da | 43 | If the file is already open, the next entry. |
5f90f492 MK |
44 | The |
45 | .I ttyent | |
46 | structure has the form: | |
088a639b | 47 | .in +4n |
fea681da | 48 | .nf |
5f90f492 | 49 | |
fea681da | 50 | struct 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 | 62 | can 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 |
70 | Not in POSIX.1-2001. |
71 | Present on the BSDs, and perhaps other systems. | |
fea681da MK |
72 | .SH NOTES |
73 | Under Linux the file | |
74 | .IR /etc/ttys , | |
75 | and the functions described above, are not used. | |
47297adb | 76 | .SH SEE ALSO |
fea681da MK |
77 | .BR ttyname (3), |
78 | .BR ttyslot (3) |