mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:48:12 +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:
parent
1458849850
commit
1c0aa51684
14 changed files with 54 additions and 63 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue