-
-
-
-GETTTYENT(3) 1990 GETTTYENT(3)
-
-
+GETTTYENT(3) BSD Programmer's Manual GETTTYENT(3)
N\bNA\bAM\bME\bE
- getttyent, getttynam, setttyent, endttyent - get ttys file
- entry
+ g\bge\bet\btt\btt\bty\bye\ben\bnt\bt, g\bge\bet\btt\btt\bty\byn\bna\bam\bm, s\bse\bet\btt\btt\bty\bye\ben\bnt\bt, e\ben\bnd\bdt\btt\bty\bye\ben\bnt\bt - get ttys file entry
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
#\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<t\btt\bty\bye\ben\bnt\bt.\b.h\bh>\b>
- s\bst\btr\bru\buc\bct\bt t\btt\bty\bye\ben\bnt\bt *\b*g\bge\bet\btt\btt\bty\bye\ben\bnt\bt(\b()\b)
+ _\bs_\bt_\br_\bu_\bc_\bt _\bt_\bt_\by_\be_\bn_\bt _\b*
+ g\bge\bet\btt\btt\bty\bye\ben\bnt\bt();
- s\bst\btr\bru\buc\bct\bt t\btt\bty\bye\ben\bnt\bt *\b*g\bge\bet\btt\btt\bty\byn\bna\bam\bm(\b(n\bna\bam\bme\be)\b)
- c\bch\bha\bar\br *\b*n\bna\bam\bme\be;\b;
+ _\bs_\bt_\br_\bu_\bc_\bt _\bt_\bt_\by_\be_\bn_\bt _\b*
+ g\bge\bet\btt\btt\bty\byn\bna\bam\bm(_\bc_\bh_\ba_\br _\b*_\bn_\ba_\bm_\be);
- s\bse\bet\btt\btt\bty\bye\ben\bnt\bt(\b()\b)
+ _\bi_\bn_\bt
+ s\bse\bet\btt\btt\bty\bye\ben\bnt\bt(_\bv_\bo_\bi_\bd);
- e\ben\bnd\bdt\btt\bty\bye\ben\bnt\bt(\b()\b)
+ _\bi_\bn_\bt
+ e\ben\bnd\bdt\btt\bty\bye\ben\bnt\bt(_\bv_\bo_\bi_\bd);
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
- _\bG_\be_\bt_\bt_\bt_\by_\be_\bn_\bt, and _\bg_\be_\bt_\bt_\bt_\by_\bn_\ba_\bm each return a pointer to an object,
- with the following structure, containing the broken-out
- fields of a line from the tty description file.
+ The g\bge\bet\btt\btt\bty\bye\ben\bnt\bt(), and g\bge\bet\btt\btt\bty\byn\bna\bam\bm() functions each return a pointer to an
+ object, with the following structure, containing the broken-out fields of
+ a line from the tty description file.
struct ttyent {
- char *ty_name; /* terminal device name */
- char *ty_getty; /* command to execute */
- char *ty_type; /* terminal type */
- #define TTY_ON 0x01 /* enable logins */
- #define TTY_SECURE 0x02 /* allow uid of 0 to login */
- int ty_status; /* flag values */
- char *ty_window; /* command for window manager */
- char *ty_comment; /* comment field */
+ char *ty_name; /* terminal device name */
+ char *ty_getty; /* command to execute */
+ char *ty_type; /* terminal type */
+ #define TTY_ON 0x01 /* enable logins */
+ #define TTY_SECURE 0x02 /* allow uid of 0 to login */
+ int ty_status; /* flag values */
+ char *ty_window; /* command for window manager */
+ char *ty_comment; /* comment field */
};
The fields are as follows:
- ty_name
- The name of the character-special file.
-
- ty_getty
- The name of the command invoked by _\bi_\bn_\bi_\bt(8) to initial-
- ize tty line characteristics.
-
- ty_type
- The name of the default terminal type connected to this
- tty line.
-
- ty_status
- A mask of bit fields which indicate various actions
- allowed on this tty line. The possible flags are as
- follows:
-
- TTY_ON
-
-
-
-
-Printed 7/27/90 June 1
-
-
-
+ _\bt_\by_\b__\bn_\ba_\bm_\be The name of the character-special file.
+ _\bt_\by_\b__\bg_\be_\bt_\bt_\by The name of the command invoked by init(8) to initialize tty
+ line characteristics.
+ _\bt_\by_\b__\bt_\by_\bp_\be The name of the default terminal type connected to this tty
+ line.
-GETTTYENT(3) 1990 GETTTYENT(3)
+ _\bt_\by_\b__\bs_\bt_\ba_\bt_\bu_\bs A mask of bit fields which indicate various actions allowed
+ on this tty line. The possible flags are as follows:
+ TTY_ON Enables logins (i.e., init(8) will start the com-
+ mand referenced by _\bt_\by_\b__\bg_\be_\bt_\bt_\by on this entry).
+ TTY_SECURE Allow users with a uid of 0 to login on this ter-
+ minal.
- Enables logins (i.e., _\bi_\bn_\bi_\bt(8) will start the command
- referenced by _\bt_\by__\bg_\be_\bt_\bt_\by on this entry).
+ _\bt_\by_\b__\bw_\bi_\bn_\bd_\bo_\bw The command to execute for a window system associated with
+ the line.
- TTY_SECURE
+ _\bt_\by_\b__\bc_\bo_\bm_\bm_\be_\bn_\bt Any trailing comment field, with any leading hash marks
+ (``#'') or whitespace removed.
- Allow users with a uid of 0 to login on this terminal.
+ If any of the fields pointing to character strings are unspecified, they
+ are returned as null pointers. The field _\bt_\by_\b__\bs_\bt_\ba_\bt_\bu_\bs will be zero if no
+ flag values are specified.
- ty_window
- The command to execute for a window system associated
- with the line.
- ty_comment
- Any trailing comment field, with any leading hash marks
- (``#'') or whitespace removed.
+ See ttys(5) for a more complete discussion of the meaning and usage of
+ the fields.
- If any of the fields pointing to character strings are
- unspecified, they are returned as null pointers. The field
- _\bt_\by__\bs_\bt_\ba_\bt_\bu_\bs will be zero if no flag values are specified.
+ The g\bge\bet\btt\btt\bty\bye\ben\bnt\bt() function reads the next line from the ttys file, opening
+ the file if necessary. The s\bse\bet\btt\btt\bty\bye\ben\bnt\bt() function rewinds the file if
+ open, or opens the file if it is unopened. The e\ben\bnd\bdt\btt\bty\bye\ben\bnt\bt() function
+ closes any open files.
- See _\bt_\bt_\by_\bs(5) for a more complete discussion of the meaning
- and usage of the fields.
-
- _\bG_\be_\bt_\bt_\bt_\by_\be_\bn_\bt reads the next line from the ttys file, opening
- the file if necessary. _\bS_\be_\bt_\bt_\bt_\by_\be_\bn_\bt rewinds the file if open,
- or opens the file if it is unopened. _\bE_\bn_\bd_\bt_\bt_\by_\be_\bn_\bt closes any
- open files.
-
- _\bG_\be_\bt_\bt_\bt_\by_\bn_\ba_\bm searches from the beginning of the file until a
+ The g\bge\bet\btt\btt\bty\byn\bna\bam\bm() function searches from the beginning of the file until a
matching _\bn_\ba_\bm_\be is found (or until EOF is encountered).
+R\bRE\bET\bTU\bUR\bRN\bN V\bVA\bAL\bLU\bUE\bES\bS
+ The routines g\bge\bet\btt\btt\bty\bye\ben\bnt\bt() and g\bge\bet\btt\btt\bty\byn\bna\bam\bm() return a null pointer on EOF or
+ error. The s\bse\bet\btt\btt\bty\bye\ben\bnt\bt() function and e\ben\bnd\bdt\btt\bty\bye\ben\bnt\bt() return 0 on failure and
+ 1 on success.
+
F\bFI\bIL\bLE\bES\bS
/etc/ttys
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
- login(1), ttyslot(3), gettytab(5), termcap(5), ttys(5),
- getty(8), init(8)
+ login(1), ttyslot(3), gettytab(5), termcap(5), ttys(5), getty(8),
+ init(8)
-D\bDI\bIA\bAG\bGN\bNO\bOS\bST\bTI\bIC\bCS\bS
- The routines _\bg_\be_\bt_\bt_\bt_\by_\be_\bn_\bt and _\bg_\be_\bt_\bt_\bt_\by_\bn_\ba_\bm return a null pointer
- on EOF or error. _\bS_\be_\bt_\bt_\bt_\by_\be_\bn_\bt and _\be_\bn_\bd_\bt_\bt_\by_\be_\bn_\bt return 0 on
- failure and 1 on success.
+H\bHI\bIS\bST\bTO\bOR\bRY\bY
+ The g\bge\bet\btt\btt\bty\bye\ben\bnt\bt(), g\bge\bet\btt\btt\bty\byn\bna\bam\bm(), s\bse\bet\btt\btt\bty\bye\ben\bnt\bt(), and e\ben\bnd\bdt\btt\bty\bye\ben\bnt\bt() functions ap-
+ peared in 4.3BSD.
B\bBU\bUG\bGS\bS
- All information is contained in a static area so it must be
- copied if it is to be saved.
-
-
-
-
-
-
-
-
-
-
-Printed 7/27/90 June 2
-
-
+ These functions use static data storage; if the data is needed for future
+ use, it should be copied before any subsequent calls overwrite it.
+4.3 Berkeley Distribution June 4, 1993 2