Skip site navigation (1)Skip section navigation (2)

  
 
  

home | help
SNP(4)			     Kernel Interfaces Manual			  SNP(4)

NAME
     snp -- tty snoop interface

SYNOPSIS
     #include <sys/snoop.h>

     int
     ioctl(fd, SNPSTTY, &dev);

     int
     ioctl(fd, SNPGTTY, &dev);

     int
     ioctl(fd, FIONREAD, &result);

DESCRIPTION
     /dev/snp  is  a  snoop  device  which allows users to attach to any tty and
     watch activities on it.  The kernel must be compiled with	device	snp,  or
     the snp module must be loaded, for these devices to be available.

     To associate a given snp device with a tty to be observed, open the snp de-
     vice and a tty device, and then issue the SNPSTTY ioctl on snp device.  The
     argument  passed  to the ioctl(2) is the address of a variable of type int,
     holding the file descriptor of a tty device.  To detach the snp device from
     a tty use a pointer to a value of -1.

     The SNPGTTY ioctl returns information about the current tty attached to the
     open snp device.

     The FIONREAD ioctl returns a positive value equal to the number of  charac-
     ters in a read buffer.  Special values defined are:

     SNP_TTYCLOSE  tty not attached.

     SNP_DETACH    snp	device	has been detached by user or tty device has been
		   closed and detached.

SEE ALSO
     pty(4), kldload(8), watch(8)

HISTORY
     The snp device first appeared in FreeBSD 2.1.  In FreeBSD 8.0 the snp  dri-
     ver was rewritten to work with the replaced TTY subsystem.

AUTHORS
     The  author  of the current implementation is Ed Schouten <ed@FreeBSD.org>.
     Previous  versions  of  snp  were	based  on  code  written  by  Ugen  J.S.
     Antsilevich <ugen@NetVision.net.il>.

FreeBSD 15.1		       September 24, 2022			  SNP(4)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=snp&sektion=4&manpath=FreeBSD+15.1-RELEASE+and+Ports>

home | help