mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Kernel: Properly define IOV_MAX
This commit is contained in:
parent
6d59d4d3d9
commit
098af0f846
Notes:
sideshowbarker
2024-07-17 11:18:45 +09:00
Author: https://github.com/timschumi Commit: https://github.com/SerenityOS/serenity/commit/098af0f846 Pull-request: https://github.com/SerenityOS/serenity/pull/13886 Reviewed-by: https://github.com/petelliott ✅
3 changed files with 5 additions and 4 deletions
|
@ -12,6 +12,9 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Arbitrary pain threshold.
|
||||
#define IOV_MAX 1024
|
||||
|
||||
struct iovec {
|
||||
void* iov_base;
|
||||
size_t iov_len;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue