mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
Kernel: Store process names as KString
This commit is contained in:
parent
db2e67fd53
commit
55b0b06897
15 changed files with 46 additions and 32 deletions
|
@ -27,10 +27,10 @@ KResultOr<FlatPtr> Process::sys$get_process_name(Userspace<char*> buffer, size_t
|
|||
{
|
||||
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
|
||||
REQUIRE_PROMISE(stdio);
|
||||
if (m_name.length() + 1 > buffer_size)
|
||||
if (m_name->length() + 1 > buffer_size)
|
||||
return ENAMETOOLONG;
|
||||
|
||||
return copy_to_user(buffer, m_name.characters(), m_name.length() + 1);
|
||||
return copy_to_user(buffer, m_name->characters(), m_name->length() + 1);
|
||||
}
|
||||
|
||||
KResultOr<FlatPtr> Process::sys$set_process_name(Userspace<const char*> user_name, size_t user_name_length)
|
||||
|
@ -43,8 +43,7 @@ KResultOr<FlatPtr> Process::sys$set_process_name(Userspace<const char*> user_nam
|
|||
// Empty and whitespace-only names only exist to confuse users.
|
||||
if (name->view().is_whitespace())
|
||||
return EINVAL;
|
||||
// FIXME: There's a String copy here. Process::m_name should be a KString.
|
||||
m_name = name->view();
|
||||
m_name = move(name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue