%% "J. Grant" <[EMAIL PROTECTED]> writes:

  jg> Ok. thank you for explaining. So is the reason the two main.exe do
  jg> not terminate because my main.c program does not handle SIGINT?

I was assuming they don't terminate because the operating system
(Windows) is sending the SIGINT to only the "main" program (in this case
make), and not sending it to all the processes that make invokes.  In
other words, Windows doesn't have the concept of a process group or, at
least, it doesn't work the same way.

But, I know nothing about Windows so I don't know if my assumption is
accurate or not.

  jg> If so, I wonder why SIGINT (ctrl+C) terminates the two "main"
  jg> processes on GNU/Linux?

On a POSIX system, every signal has a default behavior: either the
signal is ignored or the process is killed.  If you don't define your
own handler for the signal, then the default behavior is invoked.

The default behavior for SIGINT is kill, so (on a POSIX system) unless
your program specifically registers a signal handler for SIGINT, it will
automatically be killed when the operating system sends the SIGINT.

Most of the time a program would register a handler for SIGINT in order
to clean up (that's what make itself does for example), then it would
die gracefully.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Make-w32 mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/make-w32

Reply via email to