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
commit 30b2c0dc85
Notes: sideshowbarker 2024-07-19 04:09:46 +09:00
9 changed files with 69 additions and 43 deletions

View file

@ -61,7 +61,7 @@ public:
virtual KResultOr<size_t> sendto(FileDescription&, const void*, size_t, int, const sockaddr*, socklen_t) override;
virtual KResultOr<size_t> recvfrom(FileDescription&, void*, size_t, int flags, sockaddr*, socklen_t*) override;
virtual KResult setsockopt(int level, int option, Userspace<const void*>, socklen_t) override;
virtual KResult getsockopt(FileDescription&, int level, int option, void*, socklen_t*) override;
virtual KResult getsockopt(FileDescription&, int level, int option, Userspace<void*>, Userspace<socklen_t*>) override;
virtual int ioctl(FileDescription&, unsigned request, FlatPtr arg) override;