OLD | NEW |
1 /* Extended support for using signal values. | 1 /* Extended support for using signal values. |
2 Written by Fred Fish. fnf@cygnus.com | 2 Written by Fred Fish. fnf@cygnus.com |
3 This file is in the public domain. */ | 3 This file is in the public domain. */ |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "ansidecl.h" | 6 #include "ansidecl.h" |
7 #include "libiberty.h" | 7 #include "libiberty.h" |
8 | 8 |
9 /* We need to declare sys_siglist, because even if the system provides | 9 /* We need to declare sys_siglist, because even if the system provides |
10 it we can't assume that it is declared in <signal.h> (for example, | 10 it we can't assume that it is declared in <signal.h> (for example, |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 { | 531 { |
532 signo = 0; | 532 signo = 0; |
533 } | 533 } |
534 } | 534 } |
535 return (signo); | 535 return (signo); |
536 } | 536 } |
537 | 537 |
538 | 538 |
539 /* | 539 /* |
540 | 540 |
541 @deftypefn Supplemental void psignal (int @var{signo}, char *@var{message}) | 541 @deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message}
) |
542 | 542 |
543 Print @var{message} to the standard error, followed by a colon, | 543 Print @var{message} to the standard error, followed by a colon, |
544 followed by the description of the signal specified by @var{signo}, | 544 followed by the description of the signal specified by @var{signo}, |
545 followed by a newline. | 545 followed by a newline. |
546 | 546 |
547 @end deftypefn | 547 @end deftypefn |
548 | 548 |
549 */ | 549 */ |
550 | 550 |
551 #ifndef HAVE_PSIGNAL | 551 #ifndef HAVE_PSIGNAL |
552 | 552 |
553 void | 553 void |
554 psignal (int signo, char *message) | 554 psignal (int signo, const char *message) |
555 { | 555 { |
556 if (signal_names == NULL) | 556 if (signal_names == NULL) |
557 { | 557 { |
558 init_signal_tables (); | 558 init_signal_tables (); |
559 } | 559 } |
560 if ((signo <= 0) || (signo >= sys_nsig)) | 560 if ((signo <= 0) || (signo >= sys_nsig)) |
561 { | 561 { |
562 fprintf (stderr, "%s: unknown signal\n", message); | 562 fprintf (stderr, "%s: unknown signal\n", message); |
563 } | 563 } |
564 else | 564 else |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 name = (name == NULL) ? "<NULL>" : name; | 601 name = (name == NULL) ? "<NULL>" : name; |
602 msg = strsignal (signo); | 602 msg = strsignal (signo); |
603 msg = (msg == NULL) ? "<NULL>" : msg; | 603 msg = (msg == NULL) ? "<NULL>" : msg; |
604 printf ("%-4d%-18s%s\n", signo, name, msg); | 604 printf ("%-4d%-18s%s\n", signo, name, msg); |
605 } | 605 } |
606 | 606 |
607 return 0; | 607 return 0; |
608 } | 608 } |
609 | 609 |
610 #endif | 610 #endif |
OLD | NEW |