diff options
author | Ian Moffett <ian@osmora.org> | 2024-03-26 17:55:41 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-03-26 17:55:41 -0400 |
commit | 45f7325efedcd4e8916c2a486831bf174ed21021 (patch) | |
tree | 93865dc483f68d9bce563b1251f3664fbe6ec96b /sys | |
parent | b1515aa2c706c2808b85ff4dcb9fab5575bfe478 (diff) |
kernel: filedesc: Create MAX_RW_SIZE define
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_filedesc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_filedesc.c b/sys/kern/kern_filedesc.c index 0037f55..72d294d 100644 --- a/sys/kern/kern_filedesc.c +++ b/sys/kern/kern_filedesc.c @@ -39,6 +39,8 @@ #include <assert.h> #include <string.h> +#define MAX_RW_SIZE 0x7FFFF000 + /* * This function is a helper for write(). It creates * a buffer and copies write data to it. @@ -51,10 +53,9 @@ static int make_write_buf(struct proc *td, const void *data, char **buf_out, size_t count) { - const size_t MAX_COUNT = 0x7FFFF000; char *buf = NULL; - if (count > MAX_COUNT || count == 0) { + if (count > MAX_RW_SIZE || count == 0) { return -EINVAL; } |