diff options
author | dzwdz | 2021-08-25 11:29:44 +0200 |
---|---|---|
committer | dzwdz | 2021-08-25 11:29:44 +0200 |
commit | 75fc5c8f30b0a5dd5837df35948fc92861f30552 (patch) | |
tree | 548c596bb82bc78c552192f0cebd9d8c0772af3b /src/kernel/fd.h | |
parent | df3c01060a5dbeeb3b2ca75e371fa3c480a09f86 (diff) |
use a tagged union for the fdop args
Diffstat (limited to 'src/kernel/fd.h')
-rw-r--r-- | src/kernel/fd.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/kernel/fd.h b/src/kernel/fd.h index 90ce717..b35c979 100644 --- a/src/kernel/fd.h +++ b/src/kernel/fd.h @@ -22,4 +22,15 @@ enum fdop { // describes the operations which can be done on file descriptors FDOP_CLOSE, }; -int fdop_dispatch(enum fdop fdop, struct fd *fd, user_ptr ptr, size_t len); +struct fdop_args { + enum fdop type; + struct fd *fd; + union { + struct { // FDOP_READ, FDOP_WRITE + user_ptr ptr; + size_t len; + } rw; + }; +}; + +int fdop_dispatch(struct fdop_args args); |