Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!rutgers!clyde!burl!codas!mtune!whuts!picuxa!gp From: gp@picuxa.UUCP (Greg Pasquariello X1190) Newsgroups: comp.unix.questions Subject: setting the control terminal (how?) Message-ID: <435@picuxa.UUCP> Date: 30 Dec 87 14:05:02 GMT Organization: AT&T Information Systems, Parsippany NJ Lines: 44 I was wondering if anyone out there could help me with this. I have a process that needs to set it's own process group, and it's own control terminal. From what I thought, the terminal device driver would set the process group control terminal upon the first tty open after the setpgrp() (phew!). Here is a peice of sample code to show what I am doing (no error checking is done to save space) : main(argc,argv) int argc; char **argv; { char **arg_ptr; if(!(fork())) { close(0); close(1); close(2): setpgrp(); tty = open("/dev/tty14",2 | O_NDELAY); dup(tty) dup(tty) arg_ptr = &argv[1]; execvp(argv[1],arg_ptr); } wait((int *) 0); exit(0); } When I look at the u area for this process, the control terminal is NOT set to /dev/tty14. In fact, if I exec ps as the argv[1], it shows the console as the control terminal for the parent, and no control terminal ("?") for the child. If you could give me any help, I would greatly appreciate it. Thanks. Greg Pasquariello