Received: from SOUTH-STATION-ANNEX.MIT.EDU by po7.MIT.EDU (5.61/4.7) id AA05693; Tue, 20 Feb 96 15:04:57 EST
Received: from cygnus.com by MIT.EDU with SMTP
	id AA26139; Tue, 20 Feb 96 15:04:34 EST
Received: (from green@localhost) by cygnus.com (8.6.12/8.6.9) id MAA09885; Tue, 20 Feb 1996 12:05:01 -0800
Date: Tue, 20 Feb 1996 12:05:01 -0800
Message-Id: <199602202005.MAA09885@cygnus.com>
From: Anthony Green <green@cygnus.com>
To: proven@MIT.EDU
In-Reply-To: <9602201934.AA11115@yaz-pistachio.MIT.EDU> (message from
	Christopher Provenzano on Tue, 20 Feb 1996 14:34:42 EST)
Subject: Re: more pthreads questions


Thanks - it doesn't hang anymore, however, when I run it, it spits out
"0", but I think it should say "1".

On another note, signals seem deferred during fgetc(). Is this right?
I have an interactive cmdline program that should react to a Ctrl-C
during user input, but it is postponed until after the user has
entered the command.

(Here's that last program in case you deleted it)

   > ---- cut here ----------------------------------------------------
   > #include <stdio.h>
   > #include <signal.h>
   > #include <sys/wait.h>
   > 
   > int gotSignal = 0;
   > 
   > sigProc(sig)
   >      int sig;
   > {
   >   gotSignal = 1;
   > }
   > 
   > main()
   > {
   >   int pid, sts;
   >   (void) signal(SIGCHLD, sigProc);
   >   pid = vfork();
   >   if (pid <  0) {
   >     exit(1);
   >   } else if (pid == 0) {
   >     (void) signal(SIGCHLD, SIG_DFL);
   >     _exit(0);
   >   } else {
   >     (void) wait(&sts);
   >   }
   >   printf("%d\n", gotSignal);
   >   exit((gotSignal) ? 0 : 1);
   > }
   > 
   > ---- cut here ----------------------------------------------------
   > 

Thanks,
Anthony

-- 
Anthony Green                                                 Cygnus Support
                                                             Toronto, Canada
