1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:28:12 +00:00

Kernel: Use Userspace<T> for the getsockopt syscall and Socket interface

The way getsockopt is implemented for socket types requires us to push
down Userspace<T> using into those interfaces. This change does so, and
utilizes proper copy implementations instead of the kind of haphazard
pointer dereferencing that was occurring there before.
This commit is contained in:
Brian Gianforcaro 2020-08-07 02:29:05 -07:00 committed by Andreas Kling
parent 6920d5f423
commit 30b2c0dc85
9 changed files with 69 additions and 43 deletions

View file

@ -111,7 +111,7 @@ public:
virtual KResultOr<size_t> recvfrom(FileDescription&, void*, size_t, int flags, sockaddr*, socklen_t*) = 0;
virtual KResult setsockopt(int level, int option, Userspace<const void*>, socklen_t);
virtual KResult getsockopt(FileDescription&, int level, int option, void*, socklen_t*);
virtual KResult getsockopt(FileDescription&, int level, int option, Userspace<void*>, Userspace<socklen_t*>);
pid_t origin_pid() const { return m_origin.pid; }
uid_t origin_uid() const { return m_origin.uid; }