Kernel: Return ENAMETOOLONG when trying to set a too-long thread name

This commit is contained in:
Sam Atkins 2023-02-04 14:14:21 +00:00 committed by Andreas Kling
commit e249d751c8
Notes: sideshowbarker 2024-07-17 00:43:54 +09:00

View file

@ -187,7 +187,7 @@ ErrorOr<FlatPtr> Process::sys$set_thread_name(pid_t tid, Userspace<char const*>
const size_t max_thread_name_size = 64;
if (name->length() > max_thread_name_size)
return EINVAL;
return ENAMETOOLONG;
auto thread = Thread::from_tid(tid);
if (!thread || thread->pid() != pid())