Ticket #2451 (new proposal)

Opened 1 year ago

Last modified 1 month ago

New signal-handling API

Reported by: simonmar Assigned to: simonmar
Priority: high Milestone: 6.12.1
Component: libraries/unix Version: 6.8.3
Severity: normal Keywords:
Cc: Difficulty: Unknown
Test Case: Operating System: Unknown/Multiple
Architecture: Unknown/Multiple

Description

The current API for handling signals in System.Posix is lacking in a couple of ways:

  • it isn't modular: there's no way for a library to install a private signal handler, there is only a singla global handler per signal.
  • it isn't possible to get hold of the information from siginfo_t (#592).

I want to propose a new API. This has already undergone a round of changes after discussion with Duncan Coutts, and we ended up with something quite simple. Haddock docs are here:

http://darcs.haskell.org/~simonmar/unix/System-Posix-Signals.html#4

(also attached as unix-html.tar.gz).

I have working patches to implement this. The old API is still available, and is reimplemented using the new API. Signal handlers installed using the old API will coexist with those installed using the new API.

The main motivation for this change was so that I could hook the SIGCHLD signal in the System.Process library without disturbing users of the System.Posix library who might also want to install a SIGCHLD handler.

Deadline: 1 Aug (2 weeks)

Attachments

unix-html.tar.gz (121.9 kB) - added by simonmar on 07/18/08 05:53:10.
Haddock docs for the unix package with new signal API

Change History

07/18/08 05:53:10 changed by simonmar

  • attachment unix-html.tar.gz added.

Haddock docs for the unix package with new signal API

07/20/08 14:49:39 changed by igloo

  • milestone set to Not GHC.

09/30/08 08:37:36 changed by simonmar

  • architecture changed from Unknown to Unknown/Multiple.

09/30/08 08:51:54 changed by simonmar

  • os changed from Unknown to Unknown/Multiple.

02/19/09 03:20:00 changed by simonmar

Update: the internals of the rewrite have now been committed, so far with no API changes.

Thu Feb 19 02:05:32 PST 2009  Simon Marlow <marlowsd@gmail.com>
  * Rewrite of signal-handling.

02/21/09 06:08:34 changed by golubovsky

The change of Feb 19 (namely in System.Posix.Process.Internals) does not work with Hugs as GHC.Conc is not known to Hugs. As a result, the whole Unix package is skipped while building. Please consider this in future updates.

03/04/09 08:23:28 changed by igloo

  • priority changed from normal to high.
  • milestone changed from Not GHC to 6.12 branch.

We should fix this, although it's not immediately clear to me how at first glance. Perhaps move Signal to a portable module? Perhaps even System.Posix.Process.Internals?

04/10/09 10:52:49 changed by igloo

  • milestone changed from 6.12 branch to 6.12.1.

06/01/09 02:37:15 changed by simonmar

  • owner set to simonmar.