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