Last change
on this file since 444 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
1.1 KB
|
Line | |
---|
1 | /* Copyright 2002, 2011 Red Hat Inc. */ |
---|
2 | /* |
---|
3 | FUNCTION |
---|
4 | <<psignal>>---print a signal message on standard error |
---|
5 | |
---|
6 | INDEX |
---|
7 | psignal |
---|
8 | |
---|
9 | SYNOPSIS |
---|
10 | #include <stdio.h> |
---|
11 | void psignal(int <[signal]>, const char *<[prefix]>); |
---|
12 | |
---|
13 | DESCRIPTION |
---|
14 | Use <<psignal>> to print (on standard error) a signal message |
---|
15 | corresponding to the value of the signal number <[signal]>. |
---|
16 | Unless you use <<NULL>> as the value of the argument <[prefix]>, the |
---|
17 | signal message will begin with the string at <[prefix]>, followed by a |
---|
18 | colon and a space (<<: >>). The remainder of the signal message is one |
---|
19 | of the strings described for <<strsignal>>. |
---|
20 | |
---|
21 | RETURNS |
---|
22 | <<psignal>> returns no result. |
---|
23 | |
---|
24 | PORTABILITY |
---|
25 | POSIX.1-2008 requires <<psignal>>, but the strings issued vary from one |
---|
26 | implementation to another. |
---|
27 | |
---|
28 | Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>, |
---|
29 | <<lseek>>, <<read>>, <<sbrk>>, <<write>>. |
---|
30 | */ |
---|
31 | |
---|
32 | #include <_ansi.h> |
---|
33 | #include <stdio.h> |
---|
34 | #include <string.h> |
---|
35 | |
---|
36 | void |
---|
37 | psignal (int sig, |
---|
38 | const char *s) |
---|
39 | { |
---|
40 | if (s != NULL && *s != '\0') |
---|
41 | fprintf (stderr, "%s: %s\n", s, strsignal (sig)); |
---|
42 | else |
---|
43 | fprintf (stderr, "%s\n", strsignal (sig)); |
---|
44 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.