mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +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
|
@ -214,8 +214,6 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3)
|
|||
return virt$sendmsg(arg1, arg2, arg3);
|
||||
case SC_set_mmap_name:
|
||||
return virt$set_mmap_name(arg1);
|
||||
case SC_set_thread_name:
|
||||
return virt$set_thread_name(arg1, arg2, arg3);
|
||||
case SC_setgid:
|
||||
return virt$setgid(arg2);
|
||||
case SC_setgroups:
|
||||
|
@ -1516,13 +1514,6 @@ int Emulator::virt$scheduler_set_parameters(FlatPtr user_addr)
|
|||
return syscall(SC_scheduler_set_parameters, &user_param);
|
||||
}
|
||||
|
||||
int Emulator::virt$set_thread_name(pid_t pid, FlatPtr name_addr, size_t name_length)
|
||||
{
|
||||
auto user_name = mmu().copy_buffer_from_vm(name_addr, name_length);
|
||||
auto name = DeprecatedString::formatted("(UE) {}", StringView { user_name.data(), user_name.size() });
|
||||
return syscall(SC_set_thread_name, pid, name.characters(), name.length());
|
||||
}
|
||||
|
||||
pid_t Emulator::virt$setsid()
|
||||
{
|
||||
return syscall(SC_setsid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue