diff --git a/Userland/Utilities/syscall.cpp b/Userland/Utilities/syscall.cpp index 6fce710ea6..de119af74a 100644 --- a/Userland/Utilities/syscall.cpp +++ b/Userland/Utilities/syscall.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -93,12 +94,14 @@ int main(int argc, char** argv) dbgln_if(SYSCALL_1_DEBUG, "Calling {} {:p} {:p} {:p}\n", arg[0], arg[1], arg[2], arg[3]); int rc = syscall(arg[0], arg[1], arg[2], arg[3]); - if (rc == -1) - perror("syscall"); if (output_buffer) fwrite(outbuf, 1, sizeof(outbuf), stdout); - warnln("Syscall return: {}", rc); + if (-rc >= 0 && -rc < EMAXERRNO) { + warnln("Syscall return: {} ({})", rc, strerror(-rc)); + } else { + warnln("Syscall return: {} (?)", rc); + } return 0; }