diff --git a/Kernel/StdLib.h b/Kernel/StdLib.h index c54bd20b205..786dddc2b6f 100644 --- a/Kernel/StdLib.h +++ b/Kernel/StdLib.h @@ -171,3 +171,11 @@ inline ErrorOr copy_typed_from_user(Userspace user_data) TRY(copy_from_user(&data, user_data)); return data; } + +template +inline ErrorOr copy_typed_from_user(Userspace user_data) +{ + T data {}; + TRY(copy_from_user(&data, user_data)); + return data; +}