From eaff9ccf1dfe8f9524a1f72d8c3ec9c57a6b8228 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sun, 24 Oct 2021 02:49:21 +0200 Subject: Provide implementation for perror(3) --- libpsx/src/libc/error.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libpsx/src/libc/error.c') 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)); +} -- cgit v1.2.3