1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 03:07:35 +00:00

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(). :^)
This commit is contained in:
Andreas Kling 2019-04-22 18:44:45 +02:00
parent 6693cfb26a
commit 5c68929aa1
12 changed files with 188 additions and 1 deletions

View file

@ -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);

View file

@ -14,6 +14,7 @@ __BEGIN_DECLS
extern char** environ;
int systrace(pid_t);
int gettid();
int donate(int tid);
int create_thread(int(*)(void*), void*);