X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdocs%2Fusers_guide%2Fposix.vsgml;h=44eb171d27e5b442d3bec47abc602173ff9ff5d0;hb=98c314dbee5a666667f2f8d3d28e45e758e6869d;hp=57ed3c695f0c0636359c0659f75a136ed03efd44;hpb=94edb0508c5a2d1dada86f5a8f04572ca495cf48;p=ghc-hetmet.git diff --git a/ghc/docs/users_guide/posix.vsgml b/ghc/docs/users_guide/posix.vsgml index 57ed3c6..44eb171 100644 --- a/ghc/docs/users_guide/posix.vsgml +++ b/ghc/docs/users_guide/posix.vsgml @@ -504,15 +504,18 @@ installHandler :: Signal -> IO Handler -- old handler -@installHandler int handler iset@ calls @sigaction@ to install -an interrupt handler for signal @int@. If @handler@ is -@Default@, @SIG_DFL@ is installed; if @handler@ is -@Ignore@, @SIG_IGN@ is installed; if @handler@ is -@Catch action@, a handler is installed which will invoke @action@ as a -replacement for @main@. If @iset@ is @Just s@, then the -@sa_mask@ of the @sigaction@ structure is set to @s@; -otherwise it is cleared. The previously installed signal handler for -@int@ is returned. +@installHandler int handler iset@ calls @sigaction@ to install an +interrupt handler for signal @int@. If @handler@ is @Default@, +@SIG_DFL@ is installed; if @handler@ is @Ignore@, @SIG_IGN@ is +installed; if @handler@ is @Catch action@, a handler is installed +which will invoke @action@ in a new thread when (or shortly after) the +signal is received. See Section for details on how to communicate between +threads. + +If @iset@ is @Just s@, then the @sa_mask@ of the @sigaction@ structure +is set to @s@; otherwise it is cleared. The previously installed +signal handler for @int@ is returned. getSignalMask :: IO SignalSet @@ -557,10 +560,12 @@ awaitSignal :: Maybe SignalSet -> IO () @awaitSignal iset@ suspends execution until an interrupt is received. -If @iset@ is @Just s@, @awaitSignal@ calls -@sigsuspend@, installing @s@ as the new signal mask before -suspending execution; otherwise, it calls @pause@. If successful, -@awaitSignal@ does not return. +If @iset@ is @Just s@, @awaitSignal@ calls @sigsuspend@, installing +@s@ as the new signal mask before suspending execution; otherwise, it +calls @pause@. @awaitSignal@ returns on receipt of a signal. If you +have installed any signal handlers with @installHandler@, it may be +wise to call @yield@ directly after @awaitSignal@ to ensure that the +signal handler runs as promptly. scheduleAlarm :: Int -> IO Int