diff options
author | Jean-Baptiste Boric <jblbeurope@gmail.com> | 2021-08-15 18:15:39 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-18 10:33:48 +0200 |
commit | 61658110816eec0a1374b46c1c5ae25d942ecef0 (patch) | |
tree | 1e57bbc51f55d741acb168a763950ca13d388051 /Userland | |
parent | 77bec6b01de399542f64ee16f3ca0ca276ba97ca (diff) | |
download | serenity-61658110816eec0a1374b46c1c5ae25d942ecef0.zip |
LibC: Expose sig_sysname array
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibC/signal.cpp | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibC/signal.h | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Userland/Libraries/LibC/signal.cpp b/Userland/Libraries/LibC/signal.cpp index 33718a7e58..610f6d8a58 100644 --- a/Userland/Libraries/LibC/signal.cpp +++ b/Userland/Libraries/LibC/signal.cpp @@ -168,7 +168,7 @@ int sigsuspend(const sigset_t* set) return pselect(0, nullptr, nullptr, nullptr, nullptr, set); } -static const char* signal_names[] = { +const char* sys_signame[] = { "INVAL", "HUP", "INT", @@ -203,13 +203,13 @@ static const char* signal_names[] = { "SYS", }; -static_assert(sizeof(signal_names) == sizeof(const char*) * NSIG); +static_assert(sizeof(sys_signame) == sizeof(const char*) * NSIG); int getsignalbyname(const char* name) { VERIFY(name); for (size_t i = 0; i < NSIG; ++i) { - auto* signal_name = signal_names[i]; + auto* signal_name = sys_signame[i]; if (!strcmp(signal_name, name)) return i; } @@ -223,6 +223,6 @@ const char* getsignalname(int signal) errno = EINVAL; return nullptr; } - return signal_names[signal]; + return sys_signame[signal]; } } diff --git a/Userland/Libraries/LibC/signal.h b/Userland/Libraries/LibC/signal.h index 8af4d4132a..5284d8bc68 100644 --- a/Userland/Libraries/LibC/signal.h +++ b/Userland/Libraries/LibC/signal.h @@ -31,5 +31,6 @@ int getsignalbyname(const char*); const char* getsignalname(int); extern const char* sys_siglist[NSIG]; +extern const char* sys_signame[NSIG]; __END_DECLS |