Kernel: Move sys$uname to use TypedTransfer

This should equate to roughly the same code but improve typechecking.
This commit is contained in:
kleines Filmröllchen 2022-08-29 13:55:55 +02:00 committed by Linus Groh
parent 7c05eed487
commit 7e11b9a276
Notes: sideshowbarker 2024-07-17 09:41:18 +09:00

View file

@ -29,7 +29,7 @@ ErrorOr<FlatPtr> Process::sys$uname(Userspace<utsname*> user_buf)
hostname().with_shared([&](auto const& name) {
auto length = min(name->length(), UTSNAME_ENTRY_LEN - 1);
memcpy(buf.nodename, name->characters(), length);
AK::TypedTransfer<char>::copy(reinterpret_cast<char*>(buf.nodename), name->characters(), length);
buf.nodename[length] = '\0';
});