From: Dan Kegel <dank@kegel.com>
To: Christopher Smith <x@xman.org>
Cc: "Daniel R. Kegel" <dank@alumni.caltech.edu>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: A signal fairy tale
Date: Fri, 29 Jun 2001 02:29:11 -0700 [thread overview]
Message-ID: <3B3C4A67.1D03A916@kegel.com> (raw)
In-Reply-To: <5.1.0.14.0.20010629011855.00a98098@imap.xman.org>
Christopher Smith wrote:
>
> At 07:57 PM 6/27/2001 -0700, Daniel R. Kegel wrote:
> >From: Christopher Smith <x@xman.org>
> > >I guess the main thing I'm thinking is this could require some significant
> > >changes to the way the kernel behaves. Still, it's worth taking a "try it
> > >and see approach". If anyone else thinks this is a good idea I may hack
> > >together a sample patch and give it a whirl.
> >
> >What's the biggest change you see? From my (two-martini-lunch-tainted)
> >viewpoint, it's just another kind of signal masking, sorta...
>
> Yeah, the more I think about it, the more I think this is just another
> branch in the signal delivery code. Not necessarily too huge a change. I'll
> hack on this over the weekend I think.
Cool, have fun!
Feature checklist for future reference:
If sigopen() has been called, and the file descriptor is still open,
sigaction(x, 0, &foo) should show foo != SIG_DFL for compatibility
with the traditional signal allocation scheme.
If sigopen() has been called, and the file descriptor is still open,
sending a signal to the thread (or if posix, the process) that called
sigopen() should cause the signal to stick until picked up by
read(), or until close() is called on the fd(), in which case it will
be delivered or picked up as normal.
sigaction(x, &foo, 0) should return EBUSY if fd=sigopen(x) has been
called but close(fd) has not yet been called.
Pseudocode:
sigemptyset(&s);
sigaddset(SIGUSR1, &s);
fd=sigopen(&s);
m=read(fd, buf, n*sizeof(siginfo_t))
close(fd);
should probably be equivalent to
sigemptyset(&s);
sigaddset(SIGUSR1, &s);
struct sigaction newaction, oldaction;
newaction.sa_handler = dummy_handler;
newaction.sa_flags = SA_SIGINFO;
newaction.sa_mask = 0;
sigaction(SIGUSR1, &newaction, &oldaction);
for (i=0; i<n; i++)
if (sigwaitinfo(&s, buf+i))
break;
m = n * sizeof(siginfo_t);
sigaction(SIGUSR1, &oldaction, 0);
(apologies if any of the above is wrong)
But, um, Chris, could you check your library code to make sure you did
the sigaction stuff? Could it be that you forgot that, and if you did
that properly, the main application would notice that you'd allocated
a signal, and not suck up your signals?
- Dan
next prev parent reply other threads:[~2001-06-29 9:26 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-28 2:57 A signal fairy tale Daniel R. Kegel
2001-06-29 8:19 ` Christopher Smith
2001-06-29 9:29 ` Dan Kegel [this message]
2001-06-29 18:46 ` Dan Kegel
2001-07-02 22:33 ` Christopher Smith
[not found] <fa.d69j5vv.ej8irj@ifi.uio.no>
[not found] ` <fa.h2rpibv.87m5bp@ifi.uio.no>
2001-06-28 14:59 ` Dan Maas
2001-06-28 15:21 ` Alan Cox
2001-06-29 8:26 ` Christopher Smith
2001-06-29 11:56 ` Chris Wedgwood
2001-06-30 10:02 ` Jan Hudec
-- strict thread matches above, loose matches on Subject: below --
2001-06-28 20:11 Daniel R. Kegel
2001-06-29 8:31 ` Christopher Smith
2001-06-28 3:04 Daniel R. Kegel
2001-06-28 14:46 ` Jamie Lokier
2001-06-28 2:49 Daniel R. Kegel
2001-06-29 8:18 ` Christopher Smith
2001-06-29 9:05 ` Dan Kegel
2001-06-26 12:54 Dan Kegel
2001-06-27 3:56 ` Christopher Smith
2001-06-27 6:21 ` Balbir Singh
2001-06-27 18:11 ` Christopher Smith
2001-06-28 3:28 ` Balbir Singh
2001-06-27 9:18 ` Jamie Lokier
2001-06-27 18:16 ` Christopher Smith
2001-06-28 12:58 ` John Fremlin
2001-06-28 16:21 ` Jamie Lokier
2001-06-29 8:22 ` Christopher Smith
2001-06-29 11:47 ` John Fremlin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3B3C4A67.1D03A916@kegel.com \
--to=dank@kegel.com \
--cc=dank@alumni.caltech.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=x@xman.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox