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

FreeBSD Manual Pages

  
 
  

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

NAME
       tty - controlling terminal interface

DESCRIPTION
       The  file  /dev/tty  is,	in each	process, a synonym for the controlling
       terminal	of that	process, if any.  It is	useful for programs  or	 shell
       sequences  that	wish to	be sure	of writing messages on the terminal no
       matter how output has been redirected.  It can also be  used  for  pro-
       grams  that  demand the name of a file for output, when typed output is
       desired and it is tiresome to find out what terminal  is	 currently  in
       use.

IOCTLS
       In  addition  to	 the ioctl() requests supported	by the device that tty
       refers to, the following	ioctl()	request	is supported:

       TIOCNOTTY	 Detach	the current process from its controlling  ter-
			 minal,	 and remove it from its	current	process	group,
			 without attaching it to a new process group (that is,
			 set its process group ID to zero).  This ioctl() call
			 only works on file descriptors	connected to /dev/tty;
			 this  is  used	 by daemon processes when they are in-
			 voked by a user at a terminal.	 The process  attempts
			 to  open  /dev/tty; if	the open succeeds, it detaches
			 itself	from the terminal by using TIOCNOTTY, while if
			 the  open  fails,  it	is obviously not attached to a
			 terminal and does not need to detach itself.

FILES
       /dev/tty

SEE ALSO
       termio(4)

			       16 February 1988				TTY(4)

NAME | DESCRIPTION | IOCTLS | FILES | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=tty&sektion=4&manpath=SunOS+4.1.3>

home | help