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