Kernel: Allow changing thread names with the "stdio" promise

It's useful for programs to change their thread names to say something
interesting about what they are working on. Let's not require "thread"
for this since single-threaded programs may want to do it without
pledging "thread".
This commit is contained in:
Andreas Kling 2021-01-30 23:38:57 +01:00
parent ded78fc074
commit 4d777a9bf4
Notes: sideshowbarker 2024-07-18 22:42:59 +09:00

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -150,7 +150,7 @@ int Process::sys$join_thread(pid_t tid, Userspace<void**> exit_value)
int Process::sys$set_thread_name(pid_t tid, Userspace<const char*> user_name, size_t user_name_length)
{
REQUIRE_PROMISE(thread);
REQUIRE_PROMISE(stdio);
auto name = copy_string_from_user(user_name, user_name_length);
if (name.is_null())
return -EFAULT;