1.\" 2.\" $FreeBSD: src/share/man/man4/snp.4,v 1.15.2.6 2002/08/03 12:04:15 schweikh Exp $ 3.\" $DragonFly: src/share/man/man4/snp.4,v 1.4 2007/08/04 03:32:49 swildner Exp $ 4.\" 5.Dd February 24, 1995 6.Dt SNP 4 7.Os 8.Sh NAME 9.Nm snp 10.Nd tty snoop interface 11.Sh SYNOPSIS 12.In sys/snoop.h 13.Ft int 14.Fn ioctl fd SNPSTTY &dev 15.Ft int 16.Fn ioctl fd SNPGTTY &dev 17.Ft int 18.Fn ioctl fd FIONREAD &result 19.Sh DESCRIPTION 20.Pa /dev/snp? 21are snoop devices which allow users to attach to any tty 22and watch activities on it. 23The kernel must be compiled with 24.Cd "device snp" , 25or the 26.Nm 27module must be loaded, for these devices to be available. 28.Pp 29To associate a given 30.Nm 31device with a tty to be observed, open the 32.Nm 33device and then use the 34.Dv SNPSTTY 35ioctl. 36The argument passed to the ioctl is the address of a variable of type 37.Vt dev_t . 38To detach the snp device from a tty use a pointer to a value of 39.Vt ( dev_t ) Ns Li -1 . 40.Pp 41The 42.Dv SNPGTTY 43ioctl returns information about the current tty attached to the open 44.Nm 45device. 46.Pp 47The 48.Dv FIONREAD 49ioctl returns a positive value equal to the number of characters 50in a read buffer. 51Special values defined are: 52.Bl -tag -width ".Dv SNP_TTYCLOSE" 53.It Dv SNP_OFLOW 54device overflow occurred, device detached. 55.It Dv SNP_TTYCLOSE 56tty not attached. 57.It Dv SNP_DETACH 58.Nm 59device has been detached by user or tty device has been closed 60and detached. 61.El 62.Sh SEE ALSO 63.Xr pty 4 , 64.Xr sio 4 , 65.Xr kldload 8 , 66.Xr watch 8 67.Sh HISTORY 68The 69.Nm 70device first appeared in 71.Fx 2.1 . 72.Sh AUTHORS 73.An Ugen J.S. Antsilevich Aq ugen@NetVision.net.il 74.Sh BUGS 75Caveat emptor! 76This manual page is horribly stale and wildly inaccurate in some places. 77.Pp 78While in line mode, user input can't be seen. 79No signals may be sent to the observed tty. 80