Initial import from FreeBSD RELENG_4:
[dragonfly.git] / share / man / man4 / snp.4
1 .\"
2 .\" $FreeBSD: src/share/man/man4/snp.4,v 1.15.2.6 2002/08/03 12:04:15 schweikh Exp $
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 users to attach to any tty
20 and watch activities on it.
21 The kernel must be compiled with
22 .Cd "device snp" ,
23 or the
24 .Nm
25 device must be loaded,
26 for these devices to be available.
27 .Pp
28 To associate a given
29 .Nm
30 device with a tty to be observed, open the
31 .Nm
32 device and then use the SNPSTTY ioctl.
33 The argument passed to the ioctl is the address of a variable of type
34 dev_t.
35 To detach the snp device from a tty use a pointer to a value of (dev_t)-1.
36 .Pp
37 The SNPGTTY ioctl returns information about the current tty attached to
38 the open
39 .Nm
40 device.
41 .Pp
42 The FIONREAD ioctl returns a positive value equal to the number of characters
43 in a read buffer.
44 Special values defined are:
45 .Bl -tag -width SNP_TTYCLOSE
46 .It Dv SNP_OFLOW
47 device overflow occurred, device detached.
48 .It Dv SNP_TTYCLOSE
49 tty not attached.
50 .It Dv SNP_DETACH
51 .Nm
52 device has been detached by user or tty device has been closed
53 and detached.
54 .El
55 .Sh SEE ALSO
56 .Xr pty 4 ,
57 .Xr sio 4 ,
58 .Xr kldload 8 ,
59 .Xr watch 8
60 .Sh BUGS
61 Caveat emptor!
62 This manual page is horribly stale and wildly inaccurate in some places.
63 .Pp
64 While in line mode, user input can't be seen.
65 No signals may be sent to the observed tty.
66 .Sh AUTHORS
67 .An Ugen J.S. Antsilevich Aq ugen@NetVision.net.il
68 .Sh HISTORY
69 The
70 .Nm
71 device first appeared in
72 .Fx 2.1 .