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 20and watch activities on it. 21The kernel must be compiled with 22.Cd "device snp" , 23or the 24.Nm 25device must be loaded, 26for these devices to be available. 27.Pp 28To associate a given 29.Nm 30device with a tty to be observed, open the 31.Nm 32device and then use the SNPSTTY ioctl. 33The argument passed to the ioctl is the address of a variable of type 34dev_t. 35To detach the snp device from a tty use a pointer to a value of (dev_t)-1. 36.Pp 37The SNPGTTY ioctl returns information about the current tty attached to 38the open 39.Nm 40device. 41.Pp 42The FIONREAD ioctl returns a positive value equal to the number of characters 43in a read buffer. 44Special values defined are: 45.Bl -tag -width SNP_TTYCLOSE 46.It Dv SNP_OFLOW 47device overflow occurred, device detached. 48.It Dv SNP_TTYCLOSE 49tty not attached. 50.It Dv SNP_DETACH 51.Nm 52device has been detached by user or tty device has been closed 53and 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 61Caveat emptor! 62This manual page is horribly stale and wildly inaccurate in some places. 63.Pp 64While in line mode, user input can't be seen. 65No 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 69The 70.Nm 71device first appeared in 72.Fx 2.1 . 73