Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Unix real time signals

by lidden (Curate)
on Oct 16, 2010 at 03:15 UTC ( #865617=note: print w/replies, xml ) Need Help??

in reply to Unix real time signals

Try without the SIG part. I.e: $SIG{'RTMIN+5'} = \&on_sig;

Replies are listed 'Best First'.
Re^2: Unix real time signals
by samtregar (Abbot) on Oct 16, 2010 at 03:26 UTC
    If you "use warnings" you'll see:

    No such signal: SIGSIGRTMIN+5 at line 5.

    I can't get anything to work with the +5 stuff, but this code works:

    #!/usr/bin/perl use strict; use warnings; $SIG{'RTMIN'} = \&on_sig; print $$, "\n"; while (1) { sleep 1; print ".\n"; } sub on_sig { my $sig = shift; print "somebody told me $sig"; }

    When I send it a signal like this:

    $ kill -s SIGRTMIN 763

    I get:

    somebody told me RTMIN.


    (Wow, I've been gone too long. This was supposed to be a reply to the original question!)

      I thought first 3 RT signals are conserved by something. I forgot where I seen that...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://865617]
[1nickt]: pryrt yes, I see. There is no way to differentiate without forcing to a string and all sort of weird stuff. It is enough. User 42 can get creative if s/he wishes.
[chacham]: i sent him a private message expressing my displeasure.
[1nickt]: chacham It was worse than 2-1 ! almost 4-1 !
[jdporter]: Dang. No good example of how to use IPC::Run's run() in its simplest mode?
[LanX]: him or her! ;)

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (15)
As of 2017-05-24 20:54 GMT
Find Nodes?
    Voting Booth?