Path: utzoo!attcan!uunet!mcsun!ukc!edcastle!expc55 From: expc55@castle.ed.ac.uk (Andrew Myles) Newsgroups: comp.unix.questions Subject: Re: unopenable tty Message-ID: <6429@castle.ed.ac.uk> Date: 20 Sep 90 13:55:15 GMT Sender: expc55@castle.ed.ac.uk Organization: Edinburgh University Computing Service Lines: 25 Try (assuming file descriptor 1 is still your tty and not a pipe, else open the tty yourself for any operation e.g. read or write).. #include /* or whatever your machine needs */ int main() { ioctl(1,TIOCEXCL); /* no more opens - when I use this I find that mail demons cannot tell me of new mail, sysops cannot wall etc... :-) */ /* insert your code here. Any other processes attempting to do things like open(this tty,O_RDONLY); will fail now even if this tty is crwxrwxrwx... */ ioctl(1,TIOCNXCL); /* Free device on fildes 1. You didn't do close(1) did you ? If so, now you can't re-open it either - so do NOT do it to other peoples tty unless they know how to free it.*/ return (0); } Hope this works for you. Andrew.