summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-11-06 15:45:16 +0100
committerAndreas Kling <awesomekling@gmail.com>2018-11-06 15:45:16 +0100
commit7c3746592bf2547dbd5de5d07589c7e19ea6fe2a (patch)
treec50b4985b550de8e13f16b2351ad05204233b22c /Userland
parent8d1f8b2518d17e90ec8e28fff64c22361b0b0c1b (diff)
downloadserenity-7c3746592bf2547dbd5de5d07589c7e19ea6fe2a.zip
Add strsignal() and improve sharing signal numbers between LibC and kernel.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/.gitignore1
-rw-r--r--Userland/Makefile5
-rw-r--r--Userland/strsignal.cpp11
3 files changed, 17 insertions, 0 deletions
diff --git a/Userland/.gitignore b/Userland/.gitignore
index 51ce12a3ca..33447cf7c0 100644
--- a/Userland/.gitignore
+++ b/Userland/.gitignore
@@ -18,3 +18,4 @@ kill
tty
ft
ft2
+strsignal
diff --git a/Userland/Makefile b/Userland/Makefile
index 91c8f308c7..fc4b9af423 100644
--- a/Userland/Makefile
+++ b/Userland/Makefile
@@ -15,6 +15,7 @@ OBJS = \
mm.o \
kill.o \
ft.o \
+ strsignal.o \
tty.o
APPS = \
@@ -34,6 +35,7 @@ APPS = \
mm \
kill \
ft \
+ strsignal \
tty
ARCH_FLAGS =
@@ -105,6 +107,9 @@ kill: kill.o
tty: tty.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
+strsignal: strsignal.o
+ $(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
+
.cpp.o:
@echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
diff --git a/Userland/strsignal.cpp b/Userland/strsignal.cpp
new file mode 100644
index 0000000000..1adbafe4b2
--- /dev/null
+++ b/Userland/strsignal.cpp
@@ -0,0 +1,11 @@
+#include <signal.h>
+#include <stdio.h>
+#include <string.h>
+
+int main(int, char**)
+{
+ for (int i = 1; i < 32; ++i) {
+ printf("%d: '%s'\n", i, strsignal(i));
+ }
+ return 0;
+}