Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!seismo!gatech!dcc1!douglas From: douglas@dcc1.UUCP Newsgroups: comp.unix.wizards Subject: SIGTTOU ?/need help Message-ID: <274@dcc1.UUCP> Date: Wed, 29-Apr-87 12:07:13 EDT Article-I.D.: dcc1.274 Posted: Wed Apr 29 12:07:13 1987 Date-Received: Fri, 1-May-87 02:45:49 EDT Sender: root@dcc1.UUCP Organization: DeKalb College, Clarkston GA Lines: 52 Keywords: SIGTTOU ioctl stty curses su Hi, I need some help here. The following program is a test program I wrote to so my problem. The PROBLEM: After a succesfull call to /bin/su user_name (ie: I went into the sub-shell as the user I su'ed to), the calling program below gets a SIGTTOU and returns to the csh. I must then do a '%fg' to complete the program. This does not happen until some ioctl() is done. If I di a 'fprintf(stderr,"message\n")' after the 'system()' call, it would print up, but then stop on the 'raw()' statement. QUESTION: Why does this happen, and how can I solve the problem. NOTE: I'm on a VAX 11/750 unber BRL 4.2 UNIX. ---------------------------------------------------------------------- #include /* %cc -DDO_IOCTL t.c -lcurses -ltermcap */ main(argc,argv) int argc; char *argv[]; { char buf[80]; if (argc != 2) { fprintf(stderr,"usage: t login_name\n"); exit(1); } initscr(); sprintf(buf,"/bin/su %s",argv[1]); system(buf); #ifdef DO_IOCTL raw(); noecho(); noraw(); echo(); #endif DO_IOCTL clear(); move(LINES-2,0); printw("BYE"); move(LINES-1,0); refresh(); endwin(); } ---------------------------------------------------------------------- Thanks in advance for any help. Douglas