diff --git a/Kernel/Process.h b/Kernel/Process.h index d663448dd39..9727fba06ee 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -242,7 +242,7 @@ public: KResultOr sys$close(int fd); KResultOr sys$read(int fd, Userspace, ssize_t); KResultOr sys$readv(int fd, Userspace iov, int iov_count); - KResultOr sys$write(int fd, const u8*, ssize_t); + KResultOr sys$write(int fd, Userspace, ssize_t); KResultOr sys$writev(int fd, Userspace iov, int iov_count); KResultOr sys$fstat(int fd, Userspace); KResultOr sys$stat(Userspace); diff --git a/Kernel/Syscalls/write.cpp b/Kernel/Syscalls/write.cpp index 82d952e1e04..b5e070522b2 100644 --- a/Kernel/Syscalls/write.cpp +++ b/Kernel/Syscalls/write.cpp @@ -114,7 +114,7 @@ KResultOr Process::do_write(FileDescription& description, const UserOrK return total_nwritten; } -KResultOr Process::sys$write(int fd, const u8* data, ssize_t size) +KResultOr Process::sys$write(int fd, Userspace data, ssize_t size) { REQUIRE_PROMISE(stdio); if (size < 0) @@ -129,7 +129,7 @@ KResultOr Process::sys$write(int fd, const u8* data, ssize_t size) if (!description->is_writable()) return EBADF; - auto buffer = UserOrKernelBuffer::for_user_buffer(const_cast(data), (size_t)size); + auto buffer = UserOrKernelBuffer::for_user_buffer(data, static_cast(size)); if (!buffer.has_value()) return EFAULT; return do_write(*description, buffer.value(), size);