Ticket #2451 (new proposal)

Opened 19 months ago

Last modified 9 days ago

New signal-handling API

Reported by: simonmar Owned by: simonmar
Component: libraries/unix Version: 6.8.3
Keywords: Cc: pho@…, bos@…, tibbe
Operating System: Unknown/Multiple
Test Case: Architecture: Unknown/Multiple
Type of failure: None/Unknown

Description (last modified by simonmar) (diff)

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://www.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 Download (121.9 KB) - added by simonmar 19 months ago.
Haddock docs for the unix package with new signal API

Change History

Changed 19 months ago by simonmar

Haddock docs for the unix package with new signal API

Changed 19 months ago by igloo

  • milestone set to Not GHC

Changed 17 months ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 17 months ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 12 months ago 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.

Changed 12 months ago 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.

Changed 11 months ago 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?

Changed 10 months ago by igloo

  • milestone changed from 6.12 branch to 6.12.1

Changed 8 months ago by simonmar

  • owner set to simonmar

Changed 6 months ago by simonmar

  • milestone changed from 6.12.1 to 6.14 branch

No time before 6.12.1.

Changed 6 months ago by simonmar

See also #592 (expose siginfo_t to signal handlers)

Changed 3 months ago by PHO

  • cc pho@… added

Changed 10 days ago by simonmar

  • failure set to None/Unknown
  • description modified (diff)

Fixed URL to haddock docs in description.

Changed 10 days ago by bos

  • cc bos@… added

Changed 9 days ago by tibbe

  • cc tibbe added
Note: See TracTickets for help on using tickets.