diff options
author | Brian Gianforcaro <b.gianfo@gmail.com> | 2020-08-07 00:00:17 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-07 16:18:36 +0200 |
commit | dc75ea9fc23413ce12d907e2c843b7b2c7b6324a (patch) | |
tree | 6980ecc0a7f49c4e22441e097771217b2faaadfd /Kernel/Process.h | |
parent | 0db669a9d2d59ee70214c622384730a9d4eb4bfa (diff) | |
download | serenity-dc75ea9fc23413ce12d907e2c843b7b2c7b6324a.zip |
Kernel: Use Userspace<T> for the getpeername syscall
Diffstat (limited to 'Kernel/Process.h')
-rw-r--r-- | Kernel/Process.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Kernel/Process.h b/Kernel/Process.h index d62d6cb21c..572b6169dc 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -298,7 +298,7 @@ public: int sys$getsockopt(const Syscall::SC_getsockopt_params*); int sys$setsockopt(const Syscall::SC_setsockopt_params*); int sys$getsockname(const Syscall::SC_getsockname_params*); - int sys$getpeername(const Syscall::SC_getpeername_params*); + int sys$getpeername(Userspace<const Syscall::SC_getpeername_params*>); int sys$sched_setparam(pid_t pid, Userspace<const struct sched_param*>); int sys$sched_getparam(pid_t pid, Userspace<struct sched_param*>); int sys$create_thread(void* (*)(void*), Userspace<const Syscall::SC_create_thread_params*>); @@ -423,6 +423,13 @@ public: } template<typename T> + [[nodiscard]] bool validate_read_and_copy_typed(T* dest, Userspace<T*> src) + { + Userspace<const T*> const_src { src.ptr() }; + return validate_read_and_copy_typed(dest, const_src); + } + + template<typename T> [[nodiscard]] bool validate_write_typed(T* value, size_t count = 1) { Checked size = sizeof(T); |