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

Kernel: Add KBuffer::bytes() and use it

(Instead of hand-wrapping { data(), size() } in a bunch of places.)
This commit is contained in:
Andreas Kling 2021-09-08 18:29:52 +02:00
parent bee2de4b31
commit 524ef5e475
7 changed files with 9 additions and 7 deletions

View file

@ -372,7 +372,7 @@ KResultOr<size_t> IPv4Socket::receive_packet_buffered(OpenFileDescription& descr
return bytes_written;
}
return protocol_receive(ReadonlyBytes { packet->data->data(), packet->data->size() }, buffer, buffer_length, flags);
return protocol_receive(packet->data->bytes(), buffer, buffer_length, flags);
}
KResultOr<size_t> IPv4Socket::recvfrom(OpenFileDescription& description, UserOrKernelBuffer& buffer, size_t buffer_length, int flags, Userspace<sockaddr*> user_addr, Userspace<socklen_t*> user_addr_length, Time& packet_timestamp)