1/* See LICENSE file for copyright and license details. */
2#ifndef SIG_H_
3#define SIG_H_
4
5#include <signal.h>
6#include <sys/types.h>
7
8#ifndef SIG2STR_MAX
9#define SIG2STR_MAX 32
10#endif
11
12#ifndef NSIG
13#ifdef _NSIG
14#define NSIG _NSIG
15#else
16#define NSIG 64
17#endif
18#endif
19
20extern const char *const aruu_sys_signame[NSIG];
21extern const int aruu_sys_nsig;
22
23#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
24/* system already provides sys_signame and sys_nsig */
25#else
26#define sys_signame aruu_sys_signame
27#define sys_nsig aruu_sys_nsig
28#endif
29
30#define sig2str aruu_sig2str
31#define str2sig aruu_str2sig
32
33int aruu_sig2str(int signo, char *str);
34int aruu_str2sig(const char *str, int *signop);
35
36#endif /* !SIG_H_ */