Re: Common signal handler system call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Sat, Mar 19, 2011 at 5:01 PM, Bernd Petrovitsch <bernd@xxxxxxxxxxxxxxxxxxx> wrote:
On Sam, 2011-03-19 at 02:42 +0530, mohit verma wrote:
> On Sat, Mar 19, 2011 at 2:00 AM, Manish Katiyar <mkatiyar@xxxxxxxxx>
> wrote:
>         On Fri, Mar 18, 2011 at 1:11 PM, mohit verma
>         <mohit89mlnc@xxxxxxxxx> 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.

   is there any need of raise() system call if we have kill() system call which  is capable of sending signals to the process itself? Actually there are lots of examples of this type .Some of them are for compatibility  reasons  and still some are "i dont know why." :)


>         > 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?
well if we think in this way then there are some examples where failure of some critical system calls is handled by trying for them again and again.
And what is the application expected to do if it actually failed (for
whatever reason).

But feel free to implement it and play around!
  But anyway thanks a lot  :) 

Bernd
--
Bernd Petrovitsch                  Email : bernd@xxxxxxxxxxxxxxxxxxx
                    LUGA : http://www.luga.at




--
........................
MOHIT VERMA

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux