Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!gatech!dcc1!douglas From: douglas@dcc1.UUCP (Douglas B. Jones) Newsgroups: comp.unix.wizards Subject: HELP: stop job (csh) su because of tty output Message-ID: <275@dcc1.UUCP> Date: Sat, 23-May-87 21:45:47 EDT Article-I.D.: dcc1.275 Posted: Sat May 23 21:45:47 1987 Date-Received: Sun, 24-May-87 03:21:12 EDT Sender: root@dcc1.UUCP Organization: DeKalb College, Clarkston GA Lines: 116 Keywords: stop jobs, csh, su Hi UWs, I need some help here. The below shar file has the problem in it. Here is a description of the porblem: After compiling (instruction in program) the program below, I execute it with: %a.out username %^D (now in users csh shell) (I typed in the control-d above and exited back to my shell). After leaving the shell, I get the message that my a.out program is stopped due to tty output. I must then do a: %fg to get it to continue the program. Well, I don't want this to happen, but I want to go on and execute the rest of the program without this interuption. This program is actually a small example of a much bigger program. In the bigger program, I have input afterwords. So, I can't do a: signal(SIGTTOU,SIG_IGN) in the program, because it (the program) will go into an inifinite loop trying to read from the terminal. I don't know why, but it does happen. I even try running this from the 'sh' under my csh login, the csh suspended both the sh and the a.out with the tty output message. The interuption (tty output stop) is pointed output in the below program by the DO_IOCTL flag. If this is not defined, then the program will run fine. If you define this, you get the stop message. It appears, then, that when some ioctl() is done that the csh gets a SIGTTOU signal. I'm not really sure here, but I could sure use some help. You will also notice that I have a rlogin line commented out. If you use the rlogin command instead of the su command, everything works ok (even with DO_IOCTL defined). About the rlogin command below: This program was written on machince dcc2, so I am doing an rlogin on to the machine I am on when I wrote this program. I am mailing this mail from another machince (dcc1). If you decide not to reply to the net, but to me, please mail to me on dcc1. Well, I hope my above comments are explanatory enough. Thanks for any help in advance, Douglas =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= U.S. MAIL | UUCP Douglas B. Jones | |akgua----\ Academic Computer Center | |cbosgd----\ DeKalb College | ...!|hplabs---->!gatech!{dcc1,dcc2}!douglas 555 N. Indian Creek Drive | |ihnp4---- / or Clarkston, Georgia 30021 | |seismo---/ douglas@dcc1 | |ulysses-/ douglas@dcc2 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # t.c # This archive created: Sat May 23 21:27:22 1987 # By: Douglas B. Jones (DeKalb College, Clarkston GA) export PATH; PATH=/bin:$PATH echo shar: extracting "'t.c'" '(457 characters)' if test -f 't.c' then echo shar: will not over-write existing file "'t.c'" else sed 's/^X//' << \SHAR_EOF > 't.c' X#include X/* %cc -DDO_IOCTL t.c -lcurses -ltermcap */ X Xmain(argc,argv) Xint argc; Xchar *argv[]; X{ Xchar buf[80]; X Xif (argc != 2) { X fprintf(stderr,"usage: t login_name\n"); X exit(1); X} X Xinitscr(); X Xsprintf(buf,"/bin/su %s",argv[1]); X/*sprintf(buf,"/usr/ucb/rlogin dcc2 -l %s",argv[1]);*/ Xsystem(buf); X X#ifdef DO_IOCTL Xraw(); Xnoecho(); Xnoraw(); Xecho(); X#endif DO_IOCTL Xclear(); Xmove(LINES-2,0); Xprintw("BYE"); Xmove(LINES-1,0); Xrefresh(); Xendwin(); X} SHAR_EOF if test 457 -ne "`wc -c < 't.c'`" then echo shar: error transmitting "'t.c'" '(should have been 457 characters)' fi fi # end of overwriting check # End of shell archive exit 0