1995-02-22 20:25:48 -05:00
|
|
|
.\"
|
1999-08-27 20:22:10 -04:00
|
|
|
.\" $FreeBSD$
|
1995-02-22 20:25:48 -05:00
|
|
|
.\"
|
1995-02-25 15:15:20 -05:00
|
|
|
.Dd February 24, 1995
|
1995-02-22 20:25:48 -05:00
|
|
|
.Dt SNP 4
|
2001-07-10 11:31:11 -04:00
|
|
|
.Os
|
1995-02-17 13:48:36 -05:00
|
|
|
.Sh NAME
|
1995-02-22 20:25:48 -05:00
|
|
|
.Nm snp
|
|
|
|
|
.Nd tty snoop interface
|
1995-02-17 13:48:36 -05:00
|
|
|
.Sh SYNOPSIS
|
2001-10-01 12:09:29 -04:00
|
|
|
.In sys/snoop.h
|
1995-02-22 20:25:48 -05:00
|
|
|
.Ft int
|
1995-02-25 15:15:20 -05:00
|
|
|
.Fn ioctl fd SNPSTTY &dev
|
1995-02-22 20:25:48 -05:00
|
|
|
.Ft int
|
1995-02-25 15:15:20 -05:00
|
|
|
.Fn ioctl fd SNPGTTY &dev
|
1995-02-22 20:25:48 -05:00
|
|
|
.Ft int
|
1995-02-25 15:15:20 -05:00
|
|
|
.Fn ioctl fd FIONREAD &result
|
1995-02-17 13:48:36 -05:00
|
|
|
.Sh DESCRIPTION
|
2002-08-13 10:12:31 -04:00
|
|
|
.Pa /dev/snp?
|
|
|
|
|
are snoop devices which allow users to attach to any tty
|
1995-02-22 20:25:48 -05:00
|
|
|
and watch activities on it.
|
2001-11-24 12:02:58 -05:00
|
|
|
The kernel must be compiled with
|
|
|
|
|
.Cd "device snp" ,
|
|
|
|
|
or the
|
|
|
|
|
.Nm
|
2002-08-13 10:12:31 -04:00
|
|
|
module must be loaded,
|
2001-11-24 12:02:58 -05:00
|
|
|
for these devices to be available.
|
2000-12-29 04:18:45 -05:00
|
|
|
.Pp
|
1995-02-22 20:25:48 -05:00
|
|
|
To associate a given
|
2000-11-20 13:41:33 -05:00
|
|
|
.Nm
|
2002-07-31 05:32:22 -04:00
|
|
|
device with a tty to be observed, open the
|
2000-11-20 13:41:33 -05:00
|
|
|
.Nm
|
2002-08-13 10:12:31 -04:00
|
|
|
device and then use the
|
|
|
|
|
.Dv SNPSTTY
|
|
|
|
|
ioctl.
|
|
|
|
|
The argument passed to the
|
|
|
|
|
.Xr ioctl 2
|
|
|
|
|
is the address of a variable of type
|
2002-11-11 05:59:28 -05:00
|
|
|
.Vt udev_t .
|
2002-08-13 10:12:31 -04:00
|
|
|
To detach the
|
|
|
|
|
.Nm
|
|
|
|
|
device from a tty use a pointer to a value of
|
2002-11-11 05:59:28 -05:00
|
|
|
.Dv NODEV .
|
1995-02-22 20:25:48 -05:00
|
|
|
.Pp
|
2002-08-13 10:12:31 -04:00
|
|
|
The
|
|
|
|
|
.Dv SNPGTTY
|
|
|
|
|
ioctl returns information about the current tty attached to
|
1995-02-22 20:25:48 -05:00
|
|
|
the open
|
2000-11-20 13:41:33 -05:00
|
|
|
.Nm
|
1995-02-22 20:25:48 -05:00
|
|
|
device.
|
|
|
|
|
.Pp
|
2002-08-13 10:12:31 -04:00
|
|
|
The
|
|
|
|
|
.Dv FIONREAD
|
|
|
|
|
ioctl returns a positive value equal to the number of characters
|
1995-02-22 20:25:48 -05:00
|
|
|
in a read buffer.
|
|
|
|
|
Special values defined are:
|
2002-08-13 10:12:31 -04:00
|
|
|
.Bl -tag -width ".Dv SNP_TTYCLOSE"
|
1995-02-22 20:25:48 -05:00
|
|
|
.It Dv SNP_OFLOW
|
2002-01-21 07:09:13 -05:00
|
|
|
device overflow occurred, device detached.
|
1995-02-22 20:25:48 -05:00
|
|
|
.It Dv SNP_TTYCLOSE
|
|
|
|
|
tty not attached.
|
|
|
|
|
.It Dv SNP_DETACH
|
2000-11-20 13:41:33 -05:00
|
|
|
.Nm
|
1996-01-30 08:52:50 -05:00
|
|
|
device has been detached by user or tty device has been closed
|
|
|
|
|
and detached.
|
2000-12-29 04:18:45 -05:00
|
|
|
.El
|
1995-02-17 13:48:36 -05:00
|
|
|
.Sh SEE ALSO
|
1995-02-22 20:25:48 -05:00
|
|
|
.Xr pty 4 ,
|
1996-12-26 11:16:37 -05:00
|
|
|
.Xr sio 4 ,
|
2001-11-24 12:02:58 -05:00
|
|
|
.Xr kldload 8 ,
|
1996-12-26 11:16:37 -05:00
|
|
|
.Xr watch 8
|
1995-02-17 13:48:36 -05:00
|
|
|
.Sh BUGS
|
2001-11-24 12:06:20 -05:00
|
|
|
Caveat emptor!
|
|
|
|
|
This manual page is horribly stale and wildly inaccurate in some places.
|
|
|
|
|
.Pp
|
2002-08-13 10:12:31 -04:00
|
|
|
While in line mode, user input cannot be seen.
|
1995-02-27 19:24:47 -05:00
|
|
|
No signals may be sent to the observed tty.
|
1998-03-12 02:31:21 -05:00
|
|
|
.Sh AUTHORS
|
|
|
|
|
.An Ugen J.S. Antsilevich Aq ugen@NetVision.net.il
|
1995-02-17 13:48:36 -05:00
|
|
|
.Sh HISTORY
|
1995-02-22 20:25:48 -05:00
|
|
|
The
|
2000-11-20 13:41:33 -05:00
|
|
|
.Nm
|
1997-03-21 15:14:15 -05:00
|
|
|
device first appeared in
|
|
|
|
|
.Fx 2.1 .
|