mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
Kernel: Add copy_typed_from_user for non-const Userspace<T*>
This commit is contained in:
parent
46c6176fad
commit
d69a0380e1
1 changed files with 8 additions and 0 deletions
|
@ -171,3 +171,11 @@ inline ErrorOr<T> copy_typed_from_user(Userspace<T const*> user_data)
|
|||
TRY(copy_from_user(&data, user_data));
|
||||
return data;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline ErrorOr<T> copy_typed_from_user(Userspace<T*> user_data)
|
||||
{
|
||||
T data {};
|
||||
TRY(copy_from_user(&data, user_data));
|
||||
return data;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue