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? 20are snoop devices which allow users to attach to any tty 21and watch activities on it. 22The kernel must be compiled with 23.Cd "device snp" , 24or the 25.Nm 26module must be loaded, for 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 33.Dv SNPSTTY 34ioctl. 35The argument passed to the ioctl is the address of a variable of type 36.Vt dev_t . 37To detach the snp device from a tty use a pointer to a value of 38.Vt ( dev_t ) Ns Li -1 . 39.Pp 40The 41.Dv SNPGTTY 42ioctl returns information about the current tty attached to the open 43.Nm 44device. 45.Pp 46The 47.Dv FIONREAD 48ioctl returns a positive value equal to the number of characters 49in a read buffer. 50Special values defined are: 51.Bl -tag -width ".Dv SNP_TTYCLOSE" 52.It Dv SNP_OFLOW 53device overflow occurred, device detached. 54.It Dv SNP_TTYCLOSE 55tty not attached. 56.It Dv SNP_DETACH 57.Nm 58device has been detached by user or tty device has been closed 59and 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 67The 68.Nm 69device 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 74Caveat emptor! 75This manual page is horribly stale and wildly inaccurate in some places. 76.Pp 77While in line mode, user input can't be seen. 78No signals may be sent to the observed tty. 79