BIND 10 #1673: Decode exit status in boss

BIND 10 Development do-not-reply at isc.org
Wed Mar 7 04:17:48 UTC 2012


#1673: Decode exit status in boss
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  muks
  vorner                             |                Status:  reviewing
                       Type:         |             Milestone:
  enhancement                        |  Sprint-20120320
                   Priority:         |            Resolution:
  medium                             |             Sensitive:  0
                  Component:  Boss   |           Sub-Project:  Core
  of BIND                            |  Estimated Difficulty:  3
                   Keywords:         |           Total Hours:  0
            Defect Severity:  N/A    |
Feature Depending on Ticket:         |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------

Comment (by muks):

 Looks like WTERMSIG returns the signal upon core dump:

 {{{

 #include <stdio.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/wait.h>

 int
 main (int argc, char *argv[])
 {
   pid_t p;

   p = fork ();

   if (p == 0) {
     while (1)
       sleep (1 << 10);
   } else {
     int status;

     printf ("Child pid %d\n", p);

     waitpid (p, &status, 0);

     if (WCOREDUMP (status))
       printf ("Child dumped core with signal %d\n", WTERMSIG (status));
     else
       printf ("Child exited with status %d\n", status);
   }

   return 0;
 }

 }}}

 Running it produces:

 {{{
 [muks at jurassic ~]$ ./fork
 Child pid 5908
 Child dumped core with signal 11
 }}}

 I'll update the branch for it.

-- 
Ticket URL: <http://bind10.isc.org/ticket/1673#comment:11>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list