[Openib-windows] cl_signal_osd.h file used by OpenSM

Fab Tillier ftillier at silverstorm.com
Wed Oct 19 09:35:48 PDT 2005


Hi Yael,

> In the OpenSM code there is use of signal handling functions.
> The interface to these functions is in cl_signal_osd.h file. This file is
> part of the complib under Linux, and doesn't exist in the Windows complib.
> Is it possible to add this file to the windows complib directory too?
> Attached is a the file for windows for your review.

This has come up a few times before, and my response is still the same.  Signal
handling in Windows doesn't work like it does in Linux.  Of note in the
documentation is:

"Note   SIGINT is not supported for any Win32 application, including Windows
98/Me and Windows NT/2000/XP. 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."

The right way to handle signals like ctrl-C is to register a handler via the
SetConsoleCtrlHandler.  SetConsoleCtrlHandler also lets you trap close, logoff,
and shutdown events.

Further, I had suggested getting rid of the signal handling, as the underlying
stack must handle an abortive exit of a process.  Can't we just do that?  If the
underlying layer doesn't do the right thing, it needs to be fixed rather than
have the problem masked.

- Fab 




More information about the ofw mailing list