diff options
author | davidn <davidn@FreeBSD.org> | 1997-04-13 15:16:03 +0000 |
---|---|---|
committer | davidn <davidn@FreeBSD.org> | 1997-04-13 15:16:03 +0000 |
commit | 77f2b2acb55da534446a8624a498892b398bc81d (patch) | |
tree | e3921e438f02c376ff2c94702eae3c5f03f9b159 /lib/libc/gen/getttyent.3 | |
parent | e20e33863e423d446bb3517ea426bc0229734ef9 (diff) | |
download | FreeBSD-src-77f2b2acb55da534446a8624a498892b398bc81d.zip FreeBSD-src-77f2b2acb55da534446a8624a498892b398bc81d.tar.gz |
Implement two new keywords and status flags for entries in /etc/ttys;
TTY_NETWORK (network), TTY_DIALUP (dialup), which determine a basic
connection type. TTY_DIALUP in particular will replace the old out of
date heuristic "tty[dD]*" in login.c (and better than the current
hard-coded method).
Diffstat (limited to 'lib/libc/gen/getttyent.3')
-rw-r--r-- | lib/libc/gen/getttyent.3 | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/lib/libc/gen/getttyent.3 b/lib/libc/gen/getttyent.3 index 06b1e94..51290d9 100644 --- a/lib/libc/gen/getttyent.3 +++ b/lib/libc/gen/getttyent.3 @@ -40,6 +40,9 @@ .Nm setttyent , .Nm endttyent .Nd get ttys file entry +.Nm isdialuptty , +.Nm isnetworktty +.Nd determine tty type from ttys file entry .Sh SYNOPSIS .Fd #include <ttyent.h> .Ft struct ttyent * @@ -50,6 +53,10 @@ .Fn setttyent void .Ft int .Fn endttyent void +.Ft int +.Fn isdialuptty "const char *name" +.Ft int +.Fn isnetworktty "const char *name" .Sh DESCRIPTION The .Fn getttyent , @@ -66,6 +73,8 @@ struct ttyent { char *ty_type; /* terminal type for termcap */ #define TTY_ON 0x01 /* enable logins (start ty_getty program) */ #define TTY_SECURE 0x02 /* allow uid of 0 to login */ +#define TTY_DIALUP 0x04 /* is a dialup tty */ +#define TTY_NETWORK 0x08 /* is a network tty */ int ty_status; /* status flags */ char *ty_window; /* command to start up window manager */ char *ty_comment; /* comment field */ @@ -87,7 +96,7 @@ The name of the default terminal type connected to this tty line. A mask of bit fields which indicate various actions allowed on this tty line. The possible flags are as follows: -.Bl -tag -width TTY_SECURE +.Bl -tag -width TTY_NETWORK .It Dv TTY_ON Enables logins (i.e., .Xr init 8 @@ -96,6 +105,16 @@ will start the command referenced by on this entry). .It Dv TTY_SECURE Allow users with a uid of 0 to login on this terminal. +.It Dv TTY_DIALUP +Identifies a tty as a dialin line. +If this flag is set, then +.Fn isdialuptty +will return a non-zero value. +.It Dv TTY_NETWORK +Identifies a tty used for network connections. +If this flag is set, then +.Fn isnetworktty +will return a non-zero value. .El .It Fa ty_window The command to execute for a window system associated with the line. @@ -155,6 +174,14 @@ function and .Fn endttyent return 0 on failure and 1 on success. +.Pp +The routines +.Fn isdialuptty +and +.Fn isnetworktty +return non-zero if the dialup or network flag is set for the +tty entry relating to the tty named by the parameter, and +zero otherwise. .Sh FILES .Bl -tag -width /etc/ttys -compact .It Pa /etc/ttys |