summaryrefslogtreecommitdiff
path: root/src/kernel/fd.h
diff options
context:
space:
mode:
authordzwdz2021-08-24 19:05:46 +0200
committerdzwdz2021-08-24 19:05:46 +0200
commitb988b821372466ed58eb1d2116bcbb158f70346c (patch)
tree669bb9331082848277031632e818e8293fb6e44c /src/kernel/fd.h
parent04878a07e587f26fe6d5a1044b69651406e3aa1c (diff)
switch to using user_ptr for pointers coming from userland
this avoid accidental dereferences, and now it's easy to tell apart which pointers are safe to directly read and which aren't. cons: - const is completely discarded
Diffstat (limited to 'src/kernel/fd.h')
-rw-r--r--src/kernel/fd.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/kernel/fd.h b/src/kernel/fd.h
index 6950b9b..90ce717 100644
--- a/src/kernel/fd.h
+++ b/src/kernel/fd.h
@@ -1,4 +1,5 @@
#pragma once
+#include <kernel/types.h>
#include <stddef.h>
#define FD_MAX 16
@@ -21,4 +22,4 @@ enum fdop { // describes the operations which can be done on file descriptors
FDOP_CLOSE,
};
-int fdop_dispatch(enum fdop fdop, struct fd *fd, void *ptr, size_t len);
+int fdop_dispatch(enum fdop fdop, struct fd *fd, user_ptr ptr, size_t len);