OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / original / man3 / getttyent.3
1 .\"  Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de)
2 .\"  Distributed under GPL
3 .\"
4 .TH GETTTYENT 3 2002-07-18  "GNU" "Linux Programmer's Manual"
5 .SH NAME
6 getttyent, getttynam, setttyent, endttyent \- get ttys file entry
7 .SH SYNOPSIS
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
23 The function
24 .BR setttyent ()
25 opens the file or rewinds it if already open.
26
27 The function
28 .BR endttyent ()
29 closes the file.
30
31 The function
32 .BR getttynam ()
33 searches for a given ttyname in the file.
34 It returns a pointer to a
35 .I ttyent
36 structure (description below).
37
38 The function
39 .BR getttyent ()
40 opens the file
41 .B _PATH_TTYS
42 (if necessary) and returns the first entry.
43 If the file is already open, the next entry.
44 The
45 .I ttyent
46 structure has the form:
47 .in +4n
48 .nf
49
50 struct ttyent {
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 */
57 };
58 .fi
59 .in
60
61 .I ty_status
62 can be:
63 .br
64 .nf
65
66 #define TTY_ON     0x01  /* enable logins (start ty_getty program) */
67 #define TTY_SECURE 0x02  /* allow UID 0 to login */
68 .fi
69 .SH "CONFORMING TO"
70 Not in POSIX.1-2001.
71 Present on the BSDs, and perhaps other systems.
72 .SH NOTES
73 Under Linux the file
74 .IR /etc/ttys ,
75 and the functions described above, are not used.
76 .SH "SEE ALSO"
77 .BR ttyname (3),
78 .BR ttyslot (3)