Annotation of 43BSDReno/lib/libc/gen/getttyent.3, revision 1.1.1.1

1.1       root        1: .\" Copyright (c) 1989 The Regents of the University of California.
                      2: .\" All rights reserved.
                      3: .\"
                      4: .\" Redistribution and use in source and binary forms are permitted provided
                      5: .\" that: (1) source distributions retain this entire copyright notice and
                      6: .\" comment, and (2) distributions including binaries display the following
                      7: .\" acknowledgement:  ``This product includes software developed by the
                      8: .\" University of California, Berkeley and its contributors'' in the
                      9: .\" documentation or other materials provided with the distribution and in
                     10: .\" all advertising materials mentioning features or use of this software.
                     11: .\" Neither the name of the University nor the names of its contributors may
                     12: .\" be used to endorse or promote products derived from this software without
                     13: .\" specific prior written permission.
                     14: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
                     15: .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
                     16: .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
                     17: .\"
                     18: .\"    @(#)getttyent.3 6.6 (Berkeley) 6/23/90
                     19: .\"
                     20: .TH GETTTYENT 3  "June 23, 1990"
                     21: .UC 6
                     22: .SH NAME
                     23: getttyent, getttynam, setttyent, endttyent \- get ttys file entry
                     24: .SH SYNOPSIS
                     25: .nf
                     26: .B #include <ttyent.h>
                     27: .PP
                     28: .B struct ttyent *getttyent()
                     29: .PP
                     30: .B struct ttyent *getttynam(name)
                     31: .B char *name;
                     32: .PP
                     33: .B setttyent()
                     34: .PP
                     35: .B endttyent()
                     36: .fi
                     37: .SH DESCRIPTION
                     38: .I Getttyent,
                     39: and
                     40: .I getttynam
                     41: each return a pointer to an object, with the following structure,
                     42: containing the broken-out fields of a line from the tty description
                     43: file.
                     44: .sp
                     45: .nf
                     46: struct ttyent {
                     47:        char    *ty_name;                       /* terminal device name */
                     48:        char    *ty_getty;              /* command to execute */
                     49:        char    *ty_type;                       /* terminal type */
                     50: #define        TTY_ON          0x01    /* enable logins */
                     51: #define        TTY_SECURE      0x02    /* allow uid of 0 to login */
                     52:        int     ty_status;              /* flag values */
                     53:        char    *ty_window;             /* command for window manager */
                     54:        char    *ty_comment;            /* comment field */
                     55: };
                     56: .fi
                     57: .PP
                     58: The fields are as follows:
                     59: .TP
                     60: ty_name
                     61: The name of the character-special file.
                     62: .TP
                     63: ty_getty
                     64: The name of the command invoked by
                     65: .IR init (8)
                     66: to initialize tty line characteristics.
                     67: .TP
                     68: ty_type
                     69: The name of the default terminal type connected to this tty line.
                     70: .TP
                     71: ty_status
                     72: A mask of bit fields which indicate various actions allowed on this
                     73: tty line.
                     74: The possible flags are as follows:
                     75: .IP
                     76: TTY_ON
                     77: .IP
                     78: Enables logins (i.e.,
                     79: .IR init (8)
                     80: will start the command referenced by
                     81: .I ty_getty
                     82: on this entry).
                     83: .IP
                     84: TTY_SECURE
                     85: .IP
                     86: Allow users with a uid of 0 to login on this terminal.
                     87: .TP
                     88: ty_window
                     89: The command to execute for a window system associated with the line.
                     90: .TP
                     91: ty_comment
                     92: Any trailing comment field, with any leading hash marks (``#'') or
                     93: whitespace removed.
                     94: .PP
                     95: If any of the fields pointing to character strings are unspecified,
                     96: they are returned as null pointers.
                     97: The field
                     98: .I ty_status
                     99: will be zero if no flag values are specified.
                    100: .PP
                    101: See
                    102: .IR ttys (5)
                    103: for a more complete discussion of the meaning and usage of the
                    104: fields.
                    105: .PP
                    106: .I Getttyent
                    107: reads the next line from the ttys file, opening the file if necessary.
                    108: .I Setttyent
                    109: rewinds the file if open, or opens the file if it is unopened.
                    110: .I Endttyent
                    111: closes any open files.
                    112: .PP
                    113: .I Getttynam
                    114: searches from the beginning of the file until a matching
                    115: .I name
                    116: is found
                    117: (or until EOF is encountered).
                    118: .SH FILES
                    119: /etc/ttys
                    120: .SH "SEE ALSO"
                    121: login(1), ttyslot(3), gettytab(5), termcap(5), ttys(5), getty(8), init(8)
                    122: .SH DIAGNOSTICS
                    123: The routines
                    124: .I getttyent
                    125: and
                    126: .I getttynam
                    127: return a null pointer on EOF or error.
                    128: .I Setttyent
                    129: and
                    130: .I endttyent
                    131: return 0 on failure and 1 on success.
                    132: .SH BUGS
                    133: All information is contained in a static area so it must be copied if
                    134: it is to be saved.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.