]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/snp.4
OpenSSL: update to 3.0.11
[FreeBSD/FreeBSD.git] / share / man / man4 / snp.4
1 .\"
2 .Dd September 24, 2022
3 .Dt SNP 4
4 .Os
5 .Sh NAME
6 .Nm snp
7 .Nd tty snoop interface
8 .Sh SYNOPSIS
9 .In sys/snoop.h
10 .Ft int
11 .Fn ioctl fd SNPSTTY &dev
12 .Ft int
13 .Fn ioctl fd SNPGTTY &dev
14 .Ft int
15 .Fn ioctl fd FIONREAD &result
16 .Sh DESCRIPTION
17 .Pa /dev/snp
18 is a snoop device which allows users to attach to any tty
19 and watch activities on it.
20 The kernel must be compiled with
21 .Cd "device snp" ,
22 or the
23 .Nm
24 module must be loaded,
25 for these devices to be available.
26 .Pp
27 To associate a given
28 .Nm
29 device with a tty to be observed, open the
30 .Nm
31 device and a tty device, and then issue the
32 .Dv SNPSTTY
33 ioctl on
34 .Nm
35 device.
36 The argument passed to the
37 .Xr ioctl 2
38 is the address of a variable of type
39 .Vt int ,
40 holding the file descriptor of a tty device.
41 To detach the
42 .Nm
43 device from a tty use a pointer to a value of
44 \-1.
45 .Pp
46 The
47 .Dv SNPGTTY
48 ioctl returns information about the current tty attached to
49 the open
50 .Nm
51 device.
52 .Pp
53 The
54 .Dv FIONREAD
55 ioctl returns a positive value equal to the number of characters
56 in a read buffer.
57 Special values defined are:
58 .Bl -tag -width ".Dv SNP_TTYCLOSE"
59 .It Dv SNP_TTYCLOSE
60 tty not attached.
61 .It Dv SNP_DETACH
62 .Nm
63 device has been detached by user or tty device has been closed
64 and detached.
65 .El
66 .Sh SEE ALSO
67 .Xr pty 4 ,
68 .Xr kldload 8 ,
69 .Xr watch 8
70 .Sh HISTORY
71 The
72 .Nm
73 device first appeared in
74 .Fx 2.1 .
75 In
76 .Fx 8.0
77 the
78 .Nm
79 driver was rewritten to work with the replaced TTY subsystem.
80 .Sh AUTHORS
81 .An -nosplit
82 The author of the current implementation is
83 .An \&Ed Schouten Aq Mt ed@FreeBSD.org .
84 Previous versions of
85 .Nm
86 were based on code written by
87 .An Ugen J.S. Antsilevich Aq Mt ugen@NetVision.net.il .