Skip to content

Drop use of rtsTimerSignal on ghc >= 10 #365

@dcoutts

Description

@dcoutts

The unix package has:

--- | A set of signals reserved for use by the implementation.  In GHC, this will normally
--- include either `sigVTALRM` or `sigALRM`.
reservedSignals :: SignalSet
reservedSignals = addSignal rtsTimerSignal emptySignalSet
 
foreign import ccall rtsTimerSignal :: CInt

In MR !15757 we remove the signal-based timer/ticker implementations. This means that for GHC at least, there are no reserved signals. And the RTS will want to drop its exported function rtsTimerSignal, since it is now meaningless. The unix package is its only user (afaics).

Since presumably the unix package wants to support a range of ghc versions, then all we need is a bit of cpp:

--- | A set of signals reserved for use by the implementation.  In GHC, this will normally
--- include either `sigVTALRM` or `sigALRM`.
+-- | A set of signals reserved for use by the implementation.  In GHC prior to
+-- version 10, this will normally include either `sigVTALRM` or `sigALRM`.
+-- In GHC 10 it is empty.
 reservedSignals :: SignalSet
+#if __GLASGOW_HASKELL__ >= 1000
+reservedSignals = emptySignalSet
+#else
 reservedSignals = addSignal rtsTimerSignal emptySignalSet
 
 foreign import ccall rtsTimerSignal :: CInt
+#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions