X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fsignames.h;h=e4922985e28dbee9b11de449f6ca4a0aed283e98;hb=1ca423dc7562584d7747416951855a47eef09e1f;hp=d7b9cac7bc9ac4e1c336aabd543ef775dce98e48;hpb=923365eb001011e77a79447fbc84b513f6bf4e95;p=libucw.git diff --git a/ucw/signames.h b/ucw/signames.h index d7b9cac7..e4922985 100644 --- a/ucw/signames.h +++ b/ucw/signames.h @@ -7,8 +7,33 @@ #ifndef _UCW_SIGNAMES_H #define _UCW_SIGNAMES_H +#ifdef CONFIG_UCW_CLEAN_ABI +#define sig_name_to_number ucw_sig_name_to_number +#define sig_number_to_name ucw_sig_number_to_name +#endif + +/*** + * POSIX lacks facilities for conversion between signal names + * and signal numbers. They are available in LibUCW, but please + * be aware that some signals might be missing on your system. + * If they do, please notify LibUCW maintainers. + * + * The GNU C Library provides `strsignal()` with similar function, + * but it returns human-readable strings like "Segmentation fault". + ***/ + +/** + * Converts signal name to the corresponding number. + * Returns -1 if not found. + **/ int sig_name_to_number(const char *name); +/** + * Converts signal number to the corresponding name. + * If more names are known for the given signal, one of them + * is considered canonical and preferred. + * Returns NULL if not found. + **/ const char *sig_number_to_name(int number); #endif