summaryrefslogtreecommitdiff
path: root/libpsx/src/libc/error.c
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2021-10-24 02:49:21 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2021-10-24 03:10:03 +0200
commiteaff9ccf1dfe8f9524a1f72d8c3ec9c57a6b8228 (patch)
tree0bed5969511299b1a2d6e1932ca188fa8b4f65d8 /libpsx/src/libc/error.c
parent80beba98c7bb968e830d0fe2f737b4e7cf3640d3 (diff)
downloadpsxsdk-eaff9ccf1dfe8f9524a1f72d8c3ec9c57a6b8228.tar.gz
Provide implementation for perror(3)
Diffstat (limited to 'libpsx/src/libc/error.c')
-rw-r--r--libpsx/src/libc/error.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libpsx/src/libc/error.c b/libpsx/src/libc/error.c
index ab5fe5b..2cfd7e8 100644
--- a/libpsx/src/libc/error.c
+++ b/libpsx/src/libc/error.c
@@ -114,3 +114,8 @@ int strerror_r(int errnum, char *strerrbuf, size_t buflen)
snprintf(strerrbuf, buflen, "Unknown error %d", errnum);
return -1;
}
+
+void perror(const char *s)
+{
+ fprintf(stderr, "%s: %s\n", s, strerror(errno));
+}