[project @ 2004-09-07 15:35:41 by stolz]
authorstolz <unknown>
Tue, 7 Sep 2004 15:35:43 +0000 (15:35 +0000)
committerstolz <unknown>
Tue, 7 Sep 2004 15:35:43 +0000 (15:35 +0000)
Add cpp-protected signals sigINFO & sigWINCH if available.
(An autoconf-wizard might want to look at the bottom of configure.ac, the
similarities between HAVE_SIGPOLL, HAVE_SIGINFO & HAVE_SIGWINCH can surely
be factored out)

System/Posix/Signals.hsc
include/HsBase.h

index 7369f69..e5a5532 100644 (file)
@@ -51,6 +51,12 @@ module System.Posix.Signals (
   virtualTimerExpired, sigVTALRM,
   cpuTimeLimitExceeded, sigXCPU,
   fileSizeLimitExceeded, sigXFSZ,
+#if HAVE_SIGINFO
+  infoEvent, sigINFO,
+#endif
+#if HAVE_SIGWINCH
+  windowChange, sigWINCH,
+#endif
 
   -- * Sending signals
   raiseSignal,
@@ -148,6 +154,12 @@ sigURG    = (#const SIGURG)    :: CInt
 sigVTALRM = (#const SIGVTALRM) :: CInt
 sigXCPU   = (#const SIGXCPU)   :: CInt
 sigXFSZ   = (#const SIGXFSZ)   :: CInt
+#if HAVE_SIGINFO
+sigINFO   = (#const SIGINFO)   :: CInt
+#endif
+#if HAVE_SIGWINCH
+sigWINCH  = (#const SIGWINCH)  :: CInt
+#endif
 #else
 foreign import ccall unsafe "__hsposix_SIGABRT"   sigABRT   :: CInt
 foreign import ccall unsafe "__hsposix_SIGALRM"   sigALRM   :: CInt
@@ -179,6 +191,12 @@ foreign import ccall unsafe "__hsposix_SIGURG"    sigURG    :: CInt
 foreign import ccall unsafe "__hsposix_SIGVTALRM" sigVTALRM :: CInt
 foreign import ccall unsafe "__hsposix_SIGXCPU"   sigXCPU   :: CInt
 foreign import ccall unsafe "__hsposix_SIGXFSZ"   sigXFSZ   :: CInt
+#if HAVE_SIGINFO
+foreign import ccall unsafe "__hsposix_SIGINFO"   sigINFO   :: CInt
+#endif
+#if HAVE_SIGWINCH
+foreign import ccall unsafe "__hsposix_SIGWINCH"   sigWINCH   :: CInt
+#endif
 #endif /* __HUGS__ */
 
 internalAbort ::Signal
@@ -267,6 +285,16 @@ cpuTimeLimitExceeded = sigXCPU
 fileSizeLimitExceeded :: Signal
 fileSizeLimitExceeded = sigXFSZ
 
+#if HAVE_SIGINFO
+infoEvent :: Signal
+infoEvent = sigINFO
+#endif
+
+#if HAVE_SIGWINCH
+windowChange :: Signal
+windowChange = sigWINCH
+#endif
+
 -- -----------------------------------------------------------------------------
 -- Signal-related functions
 
index ba7827e..4ed8b4b 100644 (file)
@@ -683,6 +683,13 @@ INLINE int __hsposix_SIGXFSZ()   { return SIGXFSZ; }
 INLINE int __hsposix_SIG_BLOCK()   { return SIG_BLOCK; }
 INLINE int __hsposix_SIG_UNBLOCK() { return SIG_UNBLOCK; }
 INLINE int __hsposix_SIG_SETMASK() { return SIG_SETMASK; }
+
+#if HAVE_SIGINFO
+INLINE int __hsposix_SIGINFO() { return SIGINFO; }
+#endif
+#if HAVE_SIGWINCH
+INLINE int __hsposix_SIGWINCH()        { return SIGWINCH; }
+#endif
 #endif /* mingw32_TARGET_OS */
 
 // These are wrapped because on some OSs (eg. Linux) they are