mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:17:42 +00:00
Kernel: Use shared locking mode in some places
The notable piece of code that remains to be converted is Ext2FS.
This commit is contained in:
parent
05ba4295e9
commit
54550365eb
11 changed files with 26 additions and 26 deletions
|
@ -704,7 +704,7 @@ int Process::sys$gethostname(char* buffer, ssize_t size)
|
|||
return -EINVAL;
|
||||
if (!validate_write(buffer, size))
|
||||
return -EFAULT;
|
||||
LOCKER(*s_hostname_lock);
|
||||
LOCKER(*s_hostname_lock, Lock::Mode::Shared);
|
||||
if ((size_t)size < (s_hostname->length() + 1))
|
||||
return -ENAMETOOLONG;
|
||||
copy_to_user(buffer, s_hostname->characters(), s_hostname->length() + 1);
|
||||
|
@ -2157,7 +2157,7 @@ int Process::sys$uname(utsname* buf)
|
|||
REQUIRE_PROMISE(stdio);
|
||||
if (!validate_write_typed(buf))
|
||||
return -EFAULT;
|
||||
LOCKER(*s_hostname_lock);
|
||||
LOCKER(*s_hostname_lock, Lock::Mode::Shared);
|
||||
if (s_hostname->length() + 1 > sizeof(utsname::nodename))
|
||||
return -ENAMETOOLONG;
|
||||
copy_to_user(buf->sysname, "SerenityOS", 11);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue