kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: bernd@petrovitsch.priv.at (Bernd Petrovitsch)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Common signal handler system call
Date: Sat, 19 Mar 2011 12:31:07 +0100	[thread overview]
Message-ID: <1300534267.23326.10.camel@thorin> (raw)
In-Reply-To: <AANLkTi=Mr1OmWSVwHZpugAWHphzTeFOF-sSMh0bR9L9S@mail.gmail.com>

On Sam, 2011-03-19 at 02:42 +0530, mohit verma wrote: 
> On Sat, Mar 19, 2011 at 2:00 AM, Manish Katiyar <mkatiyar@gmail.com>
> wrote:
>         On Fri, Mar 18, 2011 at 1:11 PM, mohit verma
>         <mohit89mlnc@gmail.com> wrote:
>         > Hi  folks,
>         > AFAIK there is not particular system call in Linux  systems
>         that can
>         > register a number of signals (signal numbers) at once and
>         provide a common
>         > signal handler for all of the assembled signals.
>         
>         
>         Did you try giving a common signal handler for two different
>         signals ? 
> Yes i did. 
>         
>         > I know doing this may be
>         > hardly required in practice.
>         
>         
>         Why not....for example... I want to print "quitting...." error
>         msg if
>         I get SIGINT or SIGQUIT. 

Call sigaction() two times ....

> Ok. i think these messages are for debugging purpose. But anyway let
>  it be common. :) 

That's the problem: It is not common. And if the set of signals is
probably different for all these cases.

What's the drawback of the current situation?
It you you have the (IMHO) uncommon situation where you want to use the
same signal handler for different signals, you can easily call
sigaction() for all of them separately and be done. This is usually done
one per application so there is no point in speeding it up.

And just adding one system-call to cope with a rarely used operation
which can easily be simulated with other existing ones is a waste of
time for development and RAM on each host.

>         > But i think this type of system call should be
>         > in Linux systems which can serve handler functionality on
>         some of signals.
>         > Please tell me the flaws proposing something like this. i
>         want to work on
>         > this tiny problem. :)

What is the semantic of an error?
At least one signal registration fails or all failed or some failed?

And what is the application expected to do if it actually failed (for
whatever reason).

But feel free to implement it and play around!

Bernd
-- 
Bernd Petrovitsch                  Email : bernd at petrovitsch.priv.at
                     LUGA : http://www.luga.at

  reply	other threads:[~2011-03-19 11:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18 19:54 Common signal handler system call mohit verma
2011-03-18 20:02 ` Fwd: " mohit verma
2011-03-18 20:11 ` mohit verma
2011-03-18 20:30   ` Manish Katiyar
2011-03-18 21:12     ` mohit verma
2011-03-19 11:31       ` Bernd Petrovitsch [this message]
2011-03-19 14:18         ` mohit verma
2011-03-19 21:43           ` Bernd Petrovitsch
2011-03-20  7:38             ` mohit verma
2011-03-20 14:57               ` Javier Martinez Canillas
2011-03-21 10:38               ` Bernd Petrovitsch
2011-03-21 12:16                 ` mohit verma

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=1300534267.23326.10.camel@thorin \
    --to=bernd@petrovitsch.priv.at \
    --cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).