xref: /freebsd/share/man/man4/snp.4 (revision b52b9d56d4e96089873a75f9e29062eec19fabba)
1.\"
2.\" $FreeBSD$
3.\"
4.Dd February 24, 1995
5.Dt SNP 4
6.Os
7.Sh NAME
8.Nm snp
9.Nd tty snoop interface
10.Sh SYNOPSIS
11.In 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.
21The kernel must be compiled with
22.Cd "device snp" ,
23or the
24.Nm
25device must be loaded,
26for these devices to be available.
27.Pp
28To associate a given
29.Nm
30device with a tty to be observed,  open the
31.Nm
32device and then use the SNPSTTY ioctl.
33The argument passed to the IOCTL is the address of a variable of type
34dev_t.
35By setting the value of the variable pointed to -1, the user may detach
36the snp device from a tty.
37.Pp
38The SNPGTTY ioctl returns information about the current tty attached to
39the open
40.Nm
41device.
42.Pp
43The FIONREAD ioctl returns a positive value equal to the number of characters
44in a read buffer.
45Special values defined are:
46.Bl -tag -width SNP_TTYCLOSE
47.It Dv SNP_OFLOW
48device overflow occurred, device detached.
49.It Dv SNP_TTYCLOSE
50tty not attached.
51.It Dv SNP_DETACH
52.Nm
53device has been detached by user or tty device has been closed
54and detached.
55.El
56.Sh SEE ALSO
57.Xr pty 4 ,
58.Xr sio 4 ,
59.Xr kldload 8 ,
60.Xr watch 8
61.Sh BUGS
62Caveat emptor!
63This manual page is horribly stale and wildly inaccurate in some places.
64.Pp
65While in line mode, user input can't be seen.
66No signals may be sent to the observed tty.
67.Sh AUTHORS
68.An Ugen J.S. Antsilevich Aq ugen@NetVision.net.il
69.Sh HISTORY
70The
71.Nm
72device first appeared in
73.Fx 2.1 .
74