diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-04-22 18:44:45 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-04-22 18:44:45 +0200 |
commit | 5c68929aa1724867eec6b65c0ae50dc8a8d4c589 (patch) | |
tree | ee997e95163743f7c92354f87f5fe722f31b1031 /LibC/unistd.cpp | |
parent | 6693cfb26acf9d5b53d090be309956456f546239 (diff) | |
download | serenity-5c68929aa1724867eec6b65c0ae50dc8a8d4c589.zip |
Kernel: Add a systrace() syscall and implement /bin/strace using it.
Calling systrace(pid) gives you a file descriptor with a stream of the
syscalls made by a peer process. The process must be owned by the same
UID who calls systrace(). :^)
Diffstat (limited to 'LibC/unistd.cpp')
-rw-r--r-- | LibC/unistd.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/LibC/unistd.cpp b/LibC/unistd.cpp index 19f02c034e..5cba9f33ae 100644 --- a/LibC/unistd.cpp +++ b/LibC/unistd.cpp @@ -16,6 +16,12 @@ extern "C" { +int systrace(pid_t pid) +{ + int rc = syscall(SC_systrace, pid); + __RETURN_WITH_ERRNO(rc, rc, -1); +} + int chown(const char* pathname, uid_t uid, gid_t gid) { int rc = syscall(SC_chown, pathname, uid, gid); |