xref: /freebsd/share/man/man4/snp.4 (revision df7f5d4de4592a8948a25ce01e5bddfbb7ce39dc)
1.\"
2.\"  $Id: snp.4,v 1.11 1997/02/22 13:24:43 peter Exp $
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/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 user to attach to any tty
21and watch activities on it.
22
23To associate a given
24.Nm snp
25device with a tty to be observed,  open the
26.Nm snp
27device and then use the SNPSTTY ioctl.
28The argument passed to the IOCTL is the address of a variable of type
29dev_t.
30By setting the value of the variable pointed to -1, the user may detach
31the snp device from a tty.
32.Pp
33The SNPGTTY ioctl returns information about the current tty attached to
34the open
35.Nm snp
36device.
37.Pp
38The FIONREAD ioctl returns a positive value equal to the number of characters
39in a read buffer.
40Special values defined are:
41.Bl -tag -width SNP_TTYCLOSE
42.It Dv SNP_OFLOW
43device overflow occured, device detached.
44.It Dv SNP_TTYCLOSE
45tty not attached.
46.It Dv SNP_DETACH
47.Nm snp
48device has been detached by user or tty device has been closed
49and detached.
50.Sh SEE ALSO
51.Xr pty 4 ,
52.Xr sio 4 ,
53.Xr watch 8
54.Sh RESTRICTIONS
55Only the superuser may access the
56.Nm snp
57devices.
58.Sh BUGS
59While in line mode, user input can't be seen.
60No signals may be sent to the observed tty.
61.Sh AUTHOR
62Ugen J.S. Antsilevich <ugen@NetVision.net.il>
63.Sh HISTORY
64The
65.Nm snp
66device first appeared in FreeBSD 2.1.
67