This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: CGF: please review my logic Re: bash/cmd CTRL-C problem...


On Tue, Jan 08, 2002 at 12:15:27AM +1100, Robert Collins wrote:
>Ok.
>I didn't realise that signal() is implemented in the standard VC++
>libraries.
>Can you tell me any details of the signal implementation you are using
>on win32?
>If you wished to follow clean room r/e for this, I can implement the
>signal sending side to match up with what your library expects.
>
>Also, according to
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore9
>8/HTML/_crt_signal.asp
>
>
>SIGINT is not supported for win32 programs. I quote:
>"Note SIGINT is not supported for any Win32 application including
>Windows NT and Windows 95. When a CTRL+C interrupt occurs, Win32
>operating systems generate a new thread to specifically handle that
>interrupt. This can cause a single-thread application such as UNIX, to
>become multithreaded, resulting in unexpected behavior. "
>
>As for why you see the current behaviour, I'm a little mystified.
>
>Here's why:
>
>Firstly, here's a snippet of the output of a strace of kill -2
><signals.exe pid>
>
> 2149 2816627 [main] kill 920 _kill: kill (3656, 2)
> 1542 2818169 [main] kill 920 sig_send: pid 3656, signal 2, its_me 0
> 1387 2819556 [main] kill 920 getsem: pid 3656, ppid 3648, wait 1000,
>initializing 0
> 1776 2821332 [main] kill 920 sig_send: Not waiting for sigcomplete.
>its_me 0 signal 2
> 3817 2825149 [main] kill 920 sig_send: returning 0 from sending signal
>2
> 2529 2827678 [main] kill 920 kill_worker: 0 = kill_worker (3656, 2)
>
>The getsem line is whats interesting: This is retrieving the semaphore
>used to syncronise the signalling across process's.
>
>It succeeds! (I'm running a slightly modified cygwin here, which as the
>patch at the end of this email shows (in combination with the source :})
>should always indicate if there is an error).

It should always succeed.  A non-cygwin app should have a cygwin stub
associated with it.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]