Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!brutus.cs.uiuc.edu!psuvax1!gatech!emcard!wa4mei!nanovx!msa3b!kevin From: kevin@msa3b.UUCP (Kevin P. Kleinfelter) Newsgroups: comp.unix.aix Subject: Losing /dev/tty in a process Message-ID: <1159@msa3b.UUCP> Date: 18 Oct 89 17:14:05 GMT Organization: Management Science America, Inc., Atlanta, GA Lines: 27 Is this a bug in AIX or a bug in my brain? Consider the following code fragment: pid = getpid (); setpgrp (); ioctl (2, TIOCSPGRP, &pid); I assert that this should create a new process group with the current process as the "process group leader," and attach the process group to the terminal (file handle 2 = stderr = the tty). However, after executing the above code, the following fragment produces "open failed:No such device or address" as output. f = fopen ("/dev/tty", "r"); if (f == NULL) perror ("open failed"); If this is not a bug, please suggest how one should create a new process group, and attach it to the terminal. I can't believe this is really a bug in AIX, because "csh" must do something similar to this. HHHHHEEEEELLLLLLPPPPPPP!!!!! -- Kevin Kleinfelter @ Management Science America, Inc (404) 239-2347 gatech!nanovx!msa3b!kevin