From: Matt Armstrong Date: 2003-02-06T12:20:11+09:00 Subject: Re: win32 + ctrl-c of child processes "U.Nakamura" writes: > Hello, > > In message "Re: win32 + ctrl-c of child processes" > on Feb.06,2003 09:46:00, wrote: > | Also command.com/cmd.exe tell you nothing about it, I guess > | it's a limitation of Windows. GetExitCodeProcess() API returns > | exit code only. Anyone has more info? > > Borland C++Builder's help says that wait() returns information > about how child process died by using bit 0-7 of status word, > just like same function of UNIX. > But I don't know how C++Builder gets the information, and also > don't know whether it works really. Actually I just need a way to spawn a child process without blocking SIGINT. trap('SIGINT') { puts "got SIGINT" } ret = system('ruby -e "loop {}"') puts "after system #{ret}" if $?.exited? puts "exited with %d" % [ $?.exitstatus ] end if $?.signaled? puts "signaled with %d" % [ $?.termsig ] end if $?.coredump? puts "coredump!" end E.g. both Unix and Windows never print "got SIGINT" but under Unix I can write my own "system" with fork/exec. I have a separate Win32 C program that installs a SIGINT handler with signal() before using spawnvp() to spawn a child process. In this way it receives notice of Ctrl-C. But it does not look like I can currently do this with Ruby, true?