*BSD News Article 29236


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!ihnp4.ucsd.edu!mvb.saic.com!MathWorks.Com!uhog.mit.edu!grapevine.lcs.mit.edu!ginger.lcs.mit.edu!wollman
From: wollman@ginger.lcs.mit.edu (Garrett Wollman)
Newsgroups: comp.unix.bsd
Subject: Re: BSD->Sys V Porting Question (TIOC[CNOTTY)
Date: 6 Apr 1994 18:42:16 GMT
Organization: MIT Laboratory for Computer Science
Lines: 28
Message-ID: <2nuvq8$l4b@GRAPEVINE.LCS.MIT.EDU>
References: <Cnu4xE.BwH@lunatix.lex.ky.us>
NNTP-Posting-Host: ginger.lcs.mit.edu

In article <Cnu4xE.BwH@lunatix.lex.ky.us>,
Robert Sexton <robert@lunatix.lex.ky.us> wrote:

>Can anybody enlighten me on the use of the TIOCNOTTY ioctl under
>BSD?  I am faminiliar with the termio interface, so a termio man
>page might just do the trick.  Thanks.

Typical usage is (with better error checking):

	int fd;
	int dummy;

	fd = open("/dev/null", O_RDWR, 0);
	dup2(fd, 0);
	dup2(fd, 1);
	dup2(fd, 3);
	close(fd);

	fd = open("/dev/tty", O_RDWR, 0);
	ioctl(fd, TIOCNOTTY, &dummy);

-GAWollman

-- 
Garrett A. Wollman   | Shashish is simple, it's discreet, it's brief. ... 
wollman@lcs.mit.edu  | Shashish is the bonding of hearts in spite of distance.
formerly known as    | It is a bond more powerful than absence.  We like people
wollman@emba.uvm.edu | who like Shashish.  - Claude McKenzie + Florent Vollant