isEmptyChan, System.Posix.Signals

Simon Marlow simonmar at
Mon Aug 16 06:11:38 EDT 2004

On 14 August 2004 16:00, ariep at wrote:

> 2. System.Posix.Signals does not export anything on my windows
> installation: 
> Prelude System.Posix.Signals> :b System.Posix.Signals
> Prelude System.Posix.Signals>
> I wanted to include 'installHandler sigPIPE Ignore Nothing' (as
> mentioned in the documentation of the Network module) in my program
> to make it more portable. Perhaps 'installHandler' could be set to a
> constant 'return ()' on windows?

The System.Posix.Signals interface doesn't make any sense on Windows.
We could duplicate the whole interface with "do nothing" functionality,
but it's not clear that this is the right thing to do (the interface is
quite a bit more than just installHandler).

You want something like this:

  #if __GLASGOW_HASKELL__ < 603
  #include "config.h"
  #include "ghcconfig.h"
  #ifdef mingw32_TARGET_OS
  ignorePipeSignal = return ()
  import System.Posix
  ignorePipeSignal = installHandler sigPIPE Ignore Nothing

Maybe it would make sense to include this in a library somewhere.


More information about the Glasgow-haskell-users mailing list