Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

ctrl-c and SIGINT question

by gb2049 (Initiate)
on Jul 28, 2005 at 23:56 UTC ( [id://479180]=perlquestion: print w/replies, xml ) Need Help??

gb2049 has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I have an application (running in windowXP) that is writing debug data to a text file. When I send Ctrl-C to the window through GUITest, it interrupts the application and everything is good.
I then tried sending the interrupt signal through a perl script with the following code:

kill(3,$pid); # 3 is the INT value on my system

The results I get from the using kill is different than using ctrl-c (missing some debug output near the end).

Any help will be greatly appreciated.

Thanks,
Robert

Replies are listed 'Best First'.
Re: ctrl-c and SIGINT question
by mifflin (Curate) on Jul 29, 2005 at 00:12 UTC
    are you sure 3 is SIGINT? On my system 3 is SIGQUIT and 2 is SIGINT
    Name Number Default action Description 
    SIGHUP 1 Exit Hangup (ref termio(7I)). 
    SIGINT 2 Exit Interrupt (ref termio(7I)). 
    SIGQUIT 3 Core Quit (ref termio(7I)) 
    SIGILL 4 Core Illegal Instruction 
    SIGTRAP 5 Core Trace or breakpoint trap 
    SIGABRT 6 Core Abort 
    SIGEMT 7 Core Emulation trap 
    SIGFPE 8 Core Arithmetic exception 
    SIGKILL 9 Exit Kill 
    SIGBUS 10 Core Bus error -- actually a misaligned address error 
    SIGSEGV 11 Core Segmentation fault -- an address reference boundary error 
    SIGSYS 12 Core Bad system call 
    SIGPIPE 13 Exit Broken pipe 
    SIGALRM 14 Exit Alarm clock 
    SIGTERM 15 Exit Terminated 
    SIGUSR1 16 Exit User defined signal 1 
    SIGUSR2 17 Exit User defined signal 2 
    SIGCHLD 18 Ignore Child process status changed 
    SIGPWR 19 Ignore Power fail or restart 
    SIGWINCH 20 Ignore Window size change 
    SIGURG 21 Ignore Urgent socket condition 
    SIGPOLL 22 Exit Pollable event (ref streamio(7I)) 
    SIGSTOP 23 Stop Stop (cannot be caught or ignored) 
    SIGTSTP 24 Stop Stop (job control, e.g., ^z)) 
    SIGCONT 25 Ignore Continued 
    SIGTTIN 26 Stop Stopped -- tty input (ref termio(7I)) 
    SIGTTOU 27 Stop Stopped -- tty output (ref termio(7I)) 
    SIGVTALRM 28 Exit Virtual timer expired 
    SIGPROF 29 Exit Profiling timer expired 
    SIGXCPU 30 Core CPU time limit exceeded (ref getrlimit(2)) 
    SIGXFSZ 31 Core File size limit exceeded (ref getrlimit(2)) 
    SIGWAITING 32 Ignore Concurrency signal used by threads library 
    SIGLWP 33 Ignore Inter-LWP signal used by threads library 
    SIGFREEZE 34 Ignore Checkpoint suspend 
    SIGTHAW 35 Ignore Checkpoint resume 
    SIGCANCEL 36 Ignore Cancellation signal used by threads library 
    SIGLOST 37 Ignore Resource lost 
    SIGRTMIN 38 Exit Highest priority realtime signal 
    SIGRTMAX 45 Exit Lowest priority realtime signal 
    
      yea its 3 on mine
      I get it after running this:

      foreach $name (split(' ', $Config{sig_name})) {
      $i++;
      printf "%3d) %s \t", $i, $name;
      if (($i % 5) == 0) { print "\n"; }
      }
      print "\n";
      1) ZERO 2) HUP 3) INT 4) QUIT 5) ILL
      6) NUM05 7) NUM06 8) NUM07 9) FPE 10) KILL
      11) NUM10 12) SEGV 13) NUM12 14) PIPE 15) ALRM
      16) TERM 17) NUM16 18) NUM17 19) NUM18 20) NUM19
      21) CHLD 22) BREAK 23) ABRT 24) STOP 25) NUM24
      26) CONT 27) CLD I tried some of the other ones, same results
        Shouldn't you start counting from 0 instead of 1 ?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://479180]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2024-04-23 08:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found