summaryrefslogtreecommitdiffstats
path: root/share/man/man4/snp.4
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1995-02-23 01:25:48 +0000
committerpst <pst@FreeBSD.org>1995-02-23 01:25:48 +0000
commit2fb3bae3bf047f8e7c071c9761cd034e26247fe4 (patch)
treed27ddbfd42b9cffd1c4c8972c42c1af79ab6c160 /share/man/man4/snp.4
parenta1ca25ad6e6abcc464673b0caebe485fa238421c (diff)
downloadFreeBSD-src-2fb3bae3bf047f8e7c071c9761cd034e26247fe4.zip
FreeBSD-src-2fb3bae3bf047f8e7c071c9761cd034e26247fe4.tar.gz
Clean up man page
Diffstat (limited to 'share/man/man4/snp.4')
-rw-r--r--share/man/man4/snp.4113
1 files changed, 72 insertions, 41 deletions
diff --git a/share/man/man4/snp.4 b/share/man/man4/snp.4
index 47b97d8..f293070 100644
--- a/share/man/man4/snp.4
+++ b/share/man/man4/snp.4
@@ -1,49 +1,80 @@
-.Dd Februar 17, 1995
-.Dt SNP(4)
-.Os
+.\"
+.\" @(#)snp.4 1.1 (FreeBSD) 2/17/95
+.\"
+.Dd February 17, 1995
+.Dt SNP 4
+.Os FreeBSD
.Sh NAME
-
- snp - tty snoop interface.
-
+.Nm snp
+.Nd tty snoop interface
.Sh SYNOPSIS
-#include <sys/snoop.h>
-
+.Fd #include <sys/ioctl.h>
+.Fd #include <sys/snoop.h>
+.Ft int
+.Fn ioctl fd SNPSTTY &snptty
+.Ft int
+.Fn ioctl fd SNPGTTY &snptty
+.Ft int
+.Fn ioctl fd FIONREAD 0
.Sh DESCRIPTION
- /dev/snp? are snoop devices which allow user to attach to any tty
-and watch activities on it. Device can be used by root only.
- To connect device to tty use special iocontrol SNPSTTY.Argument to
-it is a structure 'snptty'.
- struct snptty {
- int st_type;
- int st_unit;
- }
-
-st_type - type of tty to attach. Currently supported are :
- ST_PTY - pseudo-tty devices.
- ST_VTY - virtual ttys (syscons).
- ST_SIO - serial ttys.
+/dev/snp? are snoop devices which allow user to attach to any tty
+and watch activities on it.
-st_unit - number of tty unit.
-By specifying ever st_type or st_unit -1 user can detach snp
-device from tty.
+To associate a given
+.Nm snp
+device with a tty to be observed, open the
+.Nm snp
+device and then use the SNPSTTY ioctl.
+The argument passed to the IOCTL is the address of a structure of
+the following type:
+.Bd -literal -ffset indent
+struct snptty {
+ int st_type; /* type of the tty to attach */
+ int st_unit; /* number of the tty unit */
+}
- SNPGTTY - iocontrol returns current tty attached.
- FIONREAD - iocontrol returns ever positive value equal to number of
- characters in read buffer. Also special values defined:
- SNP_OFLOW - device overflow occured,device automatically
- detached.
- SNP_TTYCLOSE - tty still has not been attached.
- SNP_DETACH - snp device has been detached by user or
- tty device has been closed and detached
- automatically.
-
+#define ST_PTY 0 /* regular pty */
+#define ST_VTY 1 /* syscons vty */
+#define ST_SIO 2 /* serial lines */
+.Ed
+.Pp
+By setting st_type or st_unit to -1, the user may detach the snp device
+for a tty.
+.Pp
+The SNPGTTY ioctl returns information about the current tty attached to
+the open
+.Nm snp
+device.
+.Pp
+The FIONREAD ioctl returns a positive value equal to the number of characters
+in a read buffer.
+Special values defined are:
+.Bl -tag -width SNP_TTYCLOSE
+.It Dv SNP_OFLOW
+device overflow occured, device detatched.
+.It Dv SNP_TTYCLOSE
+tty not attached.
+.It Dv SNP_DETACH
+.Nm snp
+device has been detatched by user or tty device has been closed
+and detatched.
.Sh SEE ALSO
-
-watch(8), pty(4), sio(4)
+.Xr watch 8 ,
+.Xr pty 4 ,
+.Xr sio 4
+.Sh RESTRICTIONS
+Only the superuser may access the
+.Nm snp
+devices.
.Sh BUGS
-
-While in line mode,user input can't be seen.
-Has no ability to write to attached tty device.
-
+While in line mode, user input can't be seen.
+.Nm
+snp
+is a read-only device, there is no ability to write to attached tty device.
+.Sh AUTHOR
+Ugen J.S. Antsilevich <ugen@NetVision.net.il>
.Sh HISTORY
-FreeBSD 2.1 by Ugen J.S.Antsilevich <ugen@NetVision.net.il>
+The
+.Nm
+snp
+device first appeared in FreeBSD 2.1.
OpenPOWER on IntegriCloud