Kernel: Properly define IOV_MAX

This commit is contained in:
Tim Schumacher 2022-05-02 20:08:17 +02:00 committed by Andreas Kling
parent 6d59d4d3d9
commit 098af0f846
Notes: sideshowbarker 2024-07-17 11:18:45 +09:00
3 changed files with 5 additions and 4 deletions

View file

@ -12,6 +12,9 @@
extern "C" {
#endif
// Arbitrary pain threshold.
#define IOV_MAX 1024
struct iovec {
void* iov_base;
size_t iov_len;

View file

@ -45,8 +45,7 @@ ErrorOr<FlatPtr> Process::sys$readv(int fd, Userspace<const struct iovec*> iov,
if (iov_count < 0)
return EINVAL;
// Arbitrary pain threshold.
if (iov_count > (int)MiB)
if (iov_count > IOV_MAX)
return EFAULT;
u64 total_length = 0;

View file

@ -18,8 +18,7 @@ ErrorOr<FlatPtr> Process::sys$writev(int fd, Userspace<const struct iovec*> iov,
if (iov_count < 0)
return EINVAL;
// Arbitrary pain threshold.
if (iov_count > (int)MiB)
if (iov_count > IOV_MAX)
return EFAULT;
u64 total_length = 0;