[PATCH 0/3] signalfd: a kernel interface for dumping/restoring pending signals (v3)

From
Andrey Vagin <hidden>
Date
2013-01-14 16:53:52
Also in
linux-fsdevel, lkml
The idea is simple. We need to get the siginfo for each signal on dump,
and then return it back on restore.

The first problem is that the kernel doesn’t report complete siginfo-s
in user-space. In a signal handler the kernel strips SI_CODE from
siginfo. When a siginfo is received from signalfd, it has a different
format with fixed sizes of fields. The interface of signalfd was
extended. If a signalfd is created with the flag SFD_RAW, it returns
siginfo in a raw format.

rt_sigqueueinfo looks suitable for restoring signals, but it can’t send
siginfo with a positive si_code, because these codes are reserved for
the kernel. In the real world each person has right to do anything with
himself, so I think a process should able to send any siginfo to itself.

v2: add ability to dump signals without dequeuing them.
    pread with non-zero offset is used for this. offset encodes
    a queue (private of shared) and a sequence number of a signal
    in the queue. Thanks to Oleg for this idea.
v3: minor cleanups

Cc: Serge Hallyn <redacted>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: "Eric W. Biederman" <redacted>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Pavel Emelyanov <redacted>
CC: Cyrill Gorcunov <redacted>
Cc: Michael Kerrisk <redacted>

Andrey Vagin (3):
  signal: allow to send any siginfo to itself
  signalfd: add ability to return siginfo in a raw format (v2)
  signalfd: add ability to read siginfo-s without dequeuing signals (v4)

 fs/signalfd.c                 | 109 +++++++++++++++++++++++++++++++++++++++---
 include/uapi/linux/signalfd.h |   6 +++
 kernel/signal.c               |   6 ++-
 3 files changed, 113 insertions(+), 8 deletions(-)

-- 
1.7.11.7
Thread (7 messages) 7 messages, 4 authors, last reply 2013-01-17
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help