1.\" 2.\" $FreeBSD$ 3.\" 4.Dd February 24, 1995 5.Dt SNP 4 6.Os FreeBSD 7.Sh NAME 8.Nm snp 9.Nd tty snoop interface 10.Sh SYNOPSIS 11.Fd #include <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 user to attach to any tty 20and watch activities on it. 21.Pp 22To associate a given 23.Nm 24device with a tty to be observed, open the 25.Nm 26device and then use the SNPSTTY ioctl. 27The argument passed to the IOCTL is the address of a variable of type 28dev_t. 29By setting the value of the variable pointed to -1, the user may detach 30the snp device from a tty. 31.Pp 32The SNPGTTY ioctl returns information about the current tty attached to 33the open 34.Nm 35device. 36.Pp 37The FIONREAD ioctl returns a positive value equal to the number of characters 38in a read buffer. 39Special values defined are: 40.Bl -tag -width SNP_TTYCLOSE 41.It Dv SNP_OFLOW 42device overflow occured, device detached. 43.It Dv SNP_TTYCLOSE 44tty not attached. 45.It Dv SNP_DETACH 46.Nm 47device has been detached by user or tty device has been closed 48and detached. 49.El 50.Sh SEE ALSO 51.Xr pty 4 , 52.Xr sio 4 , 53.Xr watch 8 54.Sh RESTRICTIONS 55Only the superuser may access the 56.Nm 57devices. 58.Sh BUGS 59While in line mode, user input can't be seen. 60No signals may be sent to the observed tty. 61.Sh AUTHORS 62.An Ugen J.S. Antsilevich Aq ugen@NetVision.net.il 63.Sh HISTORY 64The 65.Nm 66device first appeared in 67.Fx 2.1 . 68