xref: /freebsd/share/man/man4/snp.4 (revision 7f3dea244c40159a41ab22da77a434d7c5b5e85a)
1.\"
2.\" $FreeBSD$
3.\"
4.Dd February 24, 1995
5.Dt SNP 4
6.Os FreeBSD
7.Sh NAME
8.Nm snp
9.Nd tty snoop interface
10.Sh SYNOPSIS
11.Fd #include <sys/snoop.h>
12.Ft int
13.Fn ioctl fd SNPSTTY &dev
14.Ft int
15.Fn ioctl fd SNPGTTY &dev
16.Ft int
17.Fn ioctl fd FIONREAD &result
18.Sh DESCRIPTION
19/dev/snp? are snoop devices which allow user to attach to any tty
20and watch activities on it.
21
22To associate a given
23.Nm snp
24device with a tty to be observed,  open the
25.Nm snp
26device and then use the SNPSTTY ioctl.
27The argument passed to the IOCTL is the address of a variable of type
28dev_t.
29By setting the value of the variable pointed to -1, the user may detach
30the snp device from a tty.
31.Pp
32The SNPGTTY ioctl returns information about the current tty attached to
33the open
34.Nm snp
35device.
36.Pp
37The FIONREAD ioctl returns a positive value equal to the number of characters
38in a read buffer.
39Special values defined are:
40.Bl -tag -width SNP_TTYCLOSE
41.It Dv SNP_OFLOW
42device overflow occured, device detached.
43.It Dv SNP_TTYCLOSE
44tty not attached.
45.It Dv SNP_DETACH
46.Nm snp
47device has been detached by user or tty device has been closed
48and detached.
49.Sh SEE ALSO
50.Xr pty 4 ,
51.Xr sio 4 ,
52.Xr watch 8
53.Sh RESTRICTIONS
54Only the superuser may access the
55.Nm snp
56devices.
57.Sh BUGS
58While in line mode, user input can't be seen.
59No signals may be sent to the observed tty.
60.Sh AUTHORS
61.An Ugen J.S. Antsilevich Aq ugen@NetVision.net.il
62.Sh HISTORY
63The
64.Nm snp
65device first appeared in
66.Fx 2.1 .
67