Path: utzoo!utgpu!watserv1!watmath!att!tut.cis.ohio-state.edu!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!wuarchive!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.unix.questions Subject: Re: How to make a tty un'open(2)'able after another process opens it Message-ID: <22431:Sep1119:31:0190@kramden.acf.nyu.edu> Date: 11 Sep 90 19:31:01 GMT References: <2699@unccvax.uncc.edu> Organization: IR Lines: 14 In article <2699@unccvax.uncc.edu> cs00chs@unccvax.uncc.edu (charles spell) writes: > Is there a way (besides lock files) that I can set a /dev/tty* to be > unopenable by other processes once it is opened by a process? The optimal > way would be for open() to return -1 if the tty is already being used. No, the optimal way would be for ttys not to be in the filesystem in the first place. My pty package (BSD variants only) includes PD ``exclon'' and ``excloff'' to turn exclusive use on and off for a tty. Look up the TIOCEXCL ioctl. You may or may not consider it a bug that this also stops controlling terminal access through /dev/tty. ---Dan