$FreeBSD: head/share/man/man4/snp.4 140561 2005-01-21 08:36:40Z ru $
.Dd February 24, 1995 .Dt SNP 4 .Os .Sh NAME .Nm snp .Nd tty snoop interface .Sh SYNOPSIS n sys/snoop.h .Ft int .Fn ioctl fd SNPSTTY &dev .Ft int .Fn ioctl fd SNPGTTY &dev .Ft int .Fn ioctl fd FIONREAD &result .Sh DESCRIPTION
a /dev/snp? are snoop devices which allow users to attach to any tty and watch activities on it. The kernel must be compiled with .Cd "device snp" , or the .Nm module must be loaded, for these devices to be available.
p To associate a given .Nm device with a tty to be observed, open the .Nm device and then use the .Dv SNPSTTY ioctl. The argument passed to the .Xr ioctl 2 is the address of a variable of type .Vt udev_t . To detach the .Nm device from a tty use a pointer to a value of .Dv NODEV .
p The .Dv SNPGTTY ioctl returns information about the current tty attached to the open .Nm device.
p The .Dv FIONREAD ioctl returns a positive value equal to the number of characters in a read buffer. Special values defined are: l -tag -width ".Dv SNP_TTYCLOSE" t Dv SNP_OFLOW device overflow occurred, device detached. t Dv SNP_TTYCLOSE tty not attached. t Dv SNP_DETACH .Nm device has been detached by user or tty device has been closed and detached. .El .Sh SEE ALSO .Xr pty 4 , .Xr sio 4 , .Xr kldload 8 , .Xr watch 8 .Sh HISTORY The .Nm device first appeared in .Fx 2.1 . .Sh AUTHORS .An Ugen J.S. Antsilevich Aq ugen@NetVision.net.il .Sh BUGS Caveat emptor! This manual page is horribly stale and wildly inaccurate in some places.
p While in line mode, user input cannot be seen. No signals may be sent to the observed tty.