xref: /dflybsd-src/share/man/man4/snp.4 (revision 0402ebbc7d4b6f34d02791995169d25c4aec3b15)
1.\"
2.\" $FreeBSD: src/share/man/man4/snp.4,v 1.15.2.6 2002/08/03 12:04:15 schweikh Exp $
3.\" $DragonFly: src/share/man/man4/snp.4,v 1.2 2003/06/17 04:36:59 dillon Exp $
4.\"
5.Dd February 24, 1995
6.Dt SNP 4
7.Os
8.Sh NAME
9.Nm snp
10.Nd tty snoop interface
11.Sh SYNOPSIS
12.In sys/snoop.h
13.Ft int
14.Fn ioctl fd SNPSTTY &dev
15.Ft int
16.Fn ioctl fd SNPGTTY &dev
17.Ft int
18.Fn ioctl fd FIONREAD &result
19.Sh DESCRIPTION
20/dev/snp? are 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
26device 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 SNPSTTY ioctl.
34The argument passed to the ioctl is the address of a variable of type
35dev_t.
36To detach the snp device from a tty use a pointer to a value of (dev_t)-1.
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