1GETTTYENT(3)               Linux Programmer's Manual              GETTTYENT(3)
2
3
4

NAME

6       getttyent, getttynam, setttyent, endttyent - get ttys file entry
7

SYNOPSIS

9       #include <ttyent.h>
10
11       struct ttyent *getttyent(void);
12
13       struct ttyent *getttynam(const char *name);
14
15       int setttyent(void);
16
17       int endttyent(void);
18

DESCRIPTION

20       These  functions  provide  an  interface  to the file _PATH_TTYS (e.g.,
21       /etc/ttys).
22
23       The function setttyent() opens the file or rewinds it if already open.
24
25       The function endttyent() closes the file.
26
27       The function getttynam() searches for a  given  terminal  name  in  the
28       file.  It returns a pointer to a ttyent structure (description below).
29
30       The  function  getttyent() opens the file _PATH_TTYS (if necessary) and
31       returns the first entry.  If the file is already open, the next  entry.
32       The ttyent structure has the form:
33
34           struct ttyent {
35               char *ty_name;     /* terminal device name */
36               char *ty_getty;    /* command to execute, usually getty */
37               char *ty_type;     /* terminal type for termcap */
38               int   ty_status;   /* status flags */
39               char *ty_window;   /* command to start up window manager */
40               char *ty_comment;  /* comment field */
41           };
42
43       ty_status can be:
44
45       #define TTY_ON     0x01  /* enable logins (start ty_getty program) */
46       #define TTY_SECURE 0x02  /* allow UID 0 to login */
47

ATTRIBUTES

49   Multithreading (see pthreads(7))
50       The  getttyent() function returns a pointer to a static variable, so it
51       is not thread-safe.
52
53       The setttyent() and endttyent() functions use  a  static  variable,  so
54       they are not thread-safe.
55
56       The getttynam() function calls thread-unsafe function getttyent() so it
57       is not thread-safe.
58

CONFORMING TO

60       Not in POSIX.1-2001.  Present on the BSDs, and perhaps other systems.
61

NOTES

63       Under Linux the file /etc/ttys, and the functions described above,  are
64       not used.
65

SEE ALSO

67       ttyname(3), ttyslot(3)
68

COLOPHON

70       This  page  is  part of release 3.53 of the Linux man-pages project.  A
71       description of the project, and information about reporting  bugs,  can
72       be found at http://www.kernel.org/doc/man-pages/.
73
74
75
76GNU                               2013-07-22                      GETTTYENT(3)
Impressum