1995-02-23 01:25:48 +00:00
|
|
|
.\"
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1995-02-23 01:25:48 +00:00
|
|
|
.\"
|
1995-02-25 20:15:20 +00:00
|
|
|
.Dd February 24, 1995
|
1995-02-23 01:25:48 +00:00
|
|
|
.Dt SNP 4
|
2001-07-10 15:31:11 +00:00
|
|
|
.Os
|
1995-02-17 18:48:36 +00:00
|
|
|
.Sh NAME
|
1995-02-23 01:25:48 +00:00
|
|
|
.Nm snp
|
|
|
|
.Nd tty snoop interface
|
1995-02-17 18:48:36 +00:00
|
|
|
.Sh SYNOPSIS
|
2001-10-01 16:09:29 +00:00
|
|
|
.In sys/snoop.h
|
1995-02-23 01:25:48 +00:00
|
|
|
.Ft int
|
1995-02-25 20:15:20 +00:00
|
|
|
.Fn ioctl fd SNPSTTY &dev
|
1995-02-23 01:25:48 +00:00
|
|
|
.Ft int
|
1995-02-25 20:15:20 +00:00
|
|
|
.Fn ioctl fd SNPGTTY &dev
|
1995-02-23 01:25:48 +00:00
|
|
|
.Ft int
|
1995-02-25 20:15:20 +00:00
|
|
|
.Fn ioctl fd FIONREAD &result
|
1995-02-17 18:48:36 +00:00
|
|
|
.Sh DESCRIPTION
|
1995-02-23 01:25:48 +00:00
|
|
|
/dev/snp? are snoop devices which allow user to attach to any tty
|
|
|
|
and watch activities on it.
|
2001-11-24 17:02:58 +00:00
|
|
|
The kernel must be compiled with
|
|
|
|
.Cd "device snp" ,
|
|
|
|
or the
|
|
|
|
.Nm
|
|
|
|
device must be loaded,
|
|
|
|
for these devices to be available.
|
2000-12-29 09:18:45 +00:00
|
|
|
.Pp
|
1995-02-23 01:25:48 +00:00
|
|
|
To associate a given
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
1995-02-23 01:25:48 +00:00
|
|
|
device with a tty to be observed, open the
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
1995-02-23 01:25:48 +00:00
|
|
|
device and then use the SNPSTTY ioctl.
|
1995-02-25 20:15:20 +00:00
|
|
|
The argument passed to the IOCTL is the address of a variable of type
|
|
|
|
dev_t.
|
1996-10-05 18:37:31 +00:00
|
|
|
By setting the value of the variable pointed to -1, the user may detach
|
1995-02-25 20:15:20 +00:00
|
|
|
the snp device from a tty.
|
1995-02-23 01:25:48 +00:00
|
|
|
.Pp
|
|
|
|
The SNPGTTY ioctl returns information about the current tty attached to
|
|
|
|
the open
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
1995-02-23 01:25:48 +00:00
|
|
|
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
|
1996-01-30 13:52:50 +00:00
|
|
|
device overflow occured, device detached.
|
1995-02-23 01:25:48 +00:00
|
|
|
.It Dv SNP_TTYCLOSE
|
|
|
|
tty not attached.
|
|
|
|
.It Dv SNP_DETACH
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
1996-01-30 13:52:50 +00:00
|
|
|
device has been detached by user or tty device has been closed
|
|
|
|
and detached.
|
2000-12-29 09:18:45 +00:00
|
|
|
.El
|
1995-02-17 18:48:36 +00:00
|
|
|
.Sh SEE ALSO
|
1995-02-23 01:25:48 +00:00
|
|
|
.Xr pty 4 ,
|
1996-12-26 16:16:37 +00:00
|
|
|
.Xr sio 4 ,
|
2001-11-24 17:02:58 +00:00
|
|
|
.Xr kldload 8 ,
|
1996-12-26 16:16:37 +00:00
|
|
|
.Xr watch 8
|
1995-02-23 01:25:48 +00:00
|
|
|
.Sh RESTRICTIONS
|
|
|
|
Only the superuser may access the
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
1995-02-23 01:25:48 +00:00
|
|
|
devices.
|
1995-02-17 18:48:36 +00:00
|
|
|
.Sh BUGS
|
1995-02-23 01:25:48 +00:00
|
|
|
While in line mode, user input can't be seen.
|
1995-02-28 00:24:47 +00:00
|
|
|
No signals may be sent to the observed tty.
|
1998-03-12 07:31:21 +00:00
|
|
|
.Sh AUTHORS
|
|
|
|
.An Ugen J.S. Antsilevich Aq ugen@NetVision.net.il
|
1995-02-17 18:48:36 +00:00
|
|
|
.Sh HISTORY
|
1995-02-23 01:25:48 +00:00
|
|
|
The
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
1997-03-21 20:14:15 +00:00
|
|
|
device first appeared in
|
|
|
|
.Fx 2.1 .
|