Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ucsbcsl.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!vax135!cornell!uw-beaver!tektronix!hplabs!sdcrdcf!trwrba!cepu!ucsbcsl!discolo From: discolo@ucsbcsl.UUCP (Anthony V. Discolo) Newsgroups: net.unix-wizards Subject: 4.2BSD signal question. Message-ID: <158@ucsbcsl.UUCP> Date: Thu, 30-Aug-84 14:10:36 EDT Article-I.D.: ucsbcsl.158 Posted: Thu Aug 30 14:10:36 1984 Date-Received: Mon, 3-Sep-84 08:44:25 EDT Organization: U.C. Santa Barbara Lines: 64 A friend of mine had an interesting problem with signals. He has a program that catches SIGHUP and SIGQUIT. When the process is stopped, sending it a SIGHUP will restart it, but sending it a SIGQUIT will not restart it. The SIGQUIT signal is received when the process is restarted, either by a SIGQUIT, or by a SIGCONT. For example, a.out continuously prints periods, it will print an H when it receives a SIGHUP, and it will print a Q when it receives a SIGQUIT. The following is a script that should explain the situation. My comments are within {}. % a.out > OUT ^Z Stopped % cat OUT ...................... % cat OUT ...................... { a.out is stopped and is not printing periods at this time } % jobs [1] + Stopped a.out % kill -HUP %1 % cat OUT ......................H......... % cat OUT ......................H...................... { a.out has received the SIGHUP, and has been restarted } % jobs [1] + Stopped a.out { csh doesn't know that the process has been restarted } % fg ^Z Stopped % kill -QUIT %1 % cat OUT ......................H.......................... % cat OUT ......................H.......................... { a.out has not received the SIGQUIT yet, and has not been restarted } % fg ^Z % cat OUT ......................H..........................Q... % cat OUT ......................H..........................Q.......... { now a.out has received the SIGQUIT and is running } Can someone please explain to me in detail why this is so? I've briefly searched the source code, but haven't found an explanation. Please reply by mail, and I'll post satisfactory explanations. -- uucp: ucbvax!ucsbcsl!discolo arpa: ucsbcsl!discolo@berkeley csnet: discolo@ucsb USMail: Computer Systems Lab U.C. Santa Barbara Santa Barbara, CA 93106 GTE: (805) 961-3221