From 9652b0ae2b477b2125946a1da974470aec55ef41 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Sun, 9 Aug 2020 15:27:23 -0700 Subject: Kernel: Use Userspace for the set_thread_name syscall --- Kernel/Process.h | 2 +- Kernel/Syscalls/thread.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Kernel/Process.h b/Kernel/Process.h index 079a2a1717..fb978f51aa 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -308,7 +308,7 @@ public: void sys$exit_thread(void*); int sys$join_thread(pid_t tid, void** exit_value); int sys$detach_thread(pid_t tid); - int sys$set_thread_name(pid_t tid, const char* buffer, size_t buffer_size); + int sys$set_thread_name(pid_t tid, Userspace buffer, size_t buffer_size); int sys$get_thread_name(pid_t tid, char* buffer, size_t buffer_size); int sys$rename(Userspace); int sys$mknod(Userspace); diff --git a/Kernel/Syscalls/thread.cpp b/Kernel/Syscalls/thread.cpp index 35367bdd71..968d7bc453 100644 --- a/Kernel/Syscalls/thread.cpp +++ b/Kernel/Syscalls/thread.cpp @@ -169,7 +169,7 @@ int Process::sys$join_thread(pid_t tid, void** exit_value) return 0; } -int Process::sys$set_thread_name(pid_t tid, const char* user_name, size_t user_name_length) +int Process::sys$set_thread_name(pid_t tid, Userspace user_name, size_t user_name_length) { REQUIRE_PROMISE(thread); auto name = validate_and_copy_string_from_user(user_name, user_name_length); @@ -188,6 +188,7 @@ int Process::sys$set_thread_name(pid_t tid, const char* user_name, size_t user_n thread->set_name(name); return 0; } + int Process::sys$get_thread_name(pid_t tid, char* buffer, size_t buffer_size) { REQUIRE_PROMISE(thread); -- cgit v1.2.3