mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-30 13:19:47 +00:00
Kernel+Userland: Remove the {get,set}_thread_name syscalls
These syscalls are not necessary on their own, and they give the false impression that a caller could set or get the thread name of any process in the system, which is not true. Therefore, move the functionality of these syscalls to be options in the prctl syscall, which makes it abundantly clear that these operations could only occur from a running thread in a process that sees other threads in that process only.
This commit is contained in:
@@ -639,6 +639,19 @@ size_t Process::OpenFileDescriptions::open_count() const
|
||||
return count;
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<Thread>> Process::get_thread_from_thread_list(pid_t tid)
|
||||
{
|
||||
if (tid < 0)
|
||||
return ESRCH;
|
||||
return m_thread_list.with([tid](auto& list) -> ErrorOr<NonnullRefPtr<Thread>> {
|
||||
for (auto& thread : list) {
|
||||
if (thread.tid() == tid)
|
||||
return thread;
|
||||
}
|
||||
return ESRCH;
|
||||
});
|
||||
}
|
||||
|
||||
ErrorOr<Process::ScopedDescriptionAllocation> Process::OpenFileDescriptions::allocate(int first_candidate_fd)
|
||||
{
|
||||
for (size_t i = first_candidate_fd; i < max_open(); ++i) {
|
||||
|
||||
Reference in New Issue
Block a user