xref: /freebsd/share/man/man4/snp.4 (revision 6af83ee0d2941d18880b6aaa2b4facd1d30c6106)
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.Pa /dev/snp?
20are snoop devices which allow users to attach to any tty
21and watch activities on it.
22The kernel must be compiled with
23.Cd "device snp" ,
24or the
25.Nm
26module must be loaded,
27for these devices to be available.
28.Pp
29To associate a given
30.Nm
31device with a tty to be observed, open the
32.Nm
33device and then use the
34.Dv SNPSTTY
35ioctl.
36The argument passed to the
37.Xr ioctl 2
38is the address of a variable of type
39.Vt udev_t .
40To detach the
41.Nm
42device from a tty use a pointer to a value of
43.Dv NODEV .
44.Pp
45The
46.Dv SNPGTTY
47ioctl returns information about the current tty attached to
48the open
49.Nm
50device.
51.Pp
52The
53.Dv FIONREAD
54ioctl returns a positive value equal to the number of characters
55in a read buffer.
56Special values defined are:
57.Bl -tag -width ".Dv SNP_TTYCLOSE"
58.It Dv SNP_OFLOW
59device overflow occurred, device detached.
60.It Dv SNP_TTYCLOSE
61tty not attached.
62.It Dv SNP_DETACH
63.Nm
64device has been detached by user or tty device has been closed
65and detached.
66.El
67.Sh SEE ALSO
68.Xr pty 4 ,
69.Xr sio 4 ,
70.Xr kldload 8 ,
71.Xr watch 8
72.Sh HISTORY
73The
74.Nm
75device first appeared in
76.Fx 2.1 .
77.Sh AUTHORS
78.An Ugen J.S. Antsilevich Aq ugen@NetVision.net.il
79.Sh BUGS
80Caveat emptor!
81This manual page is horribly stale and wildly inaccurate in some places.
82.Pp
83While in line mode, user input cannot be seen.
84No signals may be sent to the observed tty.
85