diff options
author | stolz <unknown> | 2004-09-15 15:55:46 +0000 |
---|---|---|
committer | stolz <unknown> | 2004-09-15 15:55:46 +0000 |
commit | 2805c7cec0cade9935fe4988e4b09b39638e8147 (patch) | |
tree | f0293ed2f8b7633a1c8304874caeb9c64f6c8201 /System/Posix/Signals | |
parent | ec13475947fb35c3ec6e7227aeb7794eed431cd9 (diff) |
[project @ 2004-09-15 15:55:45 by stolz]
Add System.Posix.Signals.Exts which re-exports S.P.Signals and adds the
two signals SIGINFO on (*BSD) and SIGWINCH (most Unices) which are not
in POSIX.
You should use cpp to test if those are defined before using them. This is
encouraged by not providing dummy-definitions on platforms which do not
offer that particular flavour.
Diffstat (limited to 'System/Posix/Signals')
-rw-r--r-- | System/Posix/Signals/Exts.hsc | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/System/Posix/Signals/Exts.hsc b/System/Posix/Signals/Exts.hsc new file mode 100644 index 0000000..55837df --- /dev/null +++ b/System/Posix/Signals/Exts.hsc @@ -0,0 +1,57 @@ +{-# OPTIONS -fffi #-} +----------------------------------------------------------------------------- +-- | +-- Module : System.Posix.Signals.Exts +-- Copyright : (c) The University of Glasgow 2002 +-- License : BSD-style (see the file libraries/base/LICENSE) +-- +-- Maintainer : libraries@haskell.org +-- Stability : provisional +-- Portability : non-portable (requires POSIX, includes Linuxisms/BSDisms) +-- +-- non-POSIX signal support commonly available +-- +----------------------------------------------------------------------------- + +#include "HsUnix.h" + +module System.Posix.Signals.Exts ( + module System.Posix.Signals + +#ifdef SIGINFO + , infoEvent, sigINFO +#endif +#ifdef SIGWINCH + , windowChange, sigWINCH +#endif + + ) where + +import Foreign.C ( CInt ) +import System.Posix.Signals + +#ifdef __HUGS__ +# ifdef SIGINFO +sigINFO = (#const SIGINFO) :: CInt +# endif +# ifdef SIGWINCH +sigWINCH = (#const SIGWINCH) :: CInt +# endif +#else /* !HUGS */ +# ifdef SIGINFO +foreign import ccall unsafe "__hsunix_SIGINFO" sigINFO :: CInt +# endif +# ifdef SIGWINCH +foreign import ccall unsafe "__hsunix_SIGWINCH" sigWINCH :: CInt +# endif +#endif /* !HUGS */ + +#ifdef SIGINFO +infoEvent :: Signal +infoEvent = sigINFO +#endif + +#ifdef SIGWINCH +windowChange :: Signal +windowChange = sigWINCH +#endif |