diff options
Diffstat (limited to 'src/kernel/fd.h')
-rw-r--r-- | src/kernel/fd.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/kernel/fd.h b/src/kernel/fd.h new file mode 100644 index 0000000..4976c7d --- /dev/null +++ b/src/kernel/fd.h @@ -0,0 +1,23 @@ +#pragma once +#include <stddef.h> + +#define FD_MAX 16 + +typedef int fd_t; // TODO duplicated in syscalls.h + +enum fd_type { + FD_EMPTY, +}; + +struct fd { + enum fd_type type; +}; + + +enum fdop { // describes the operations which can be done on file descriptors + FDOP_READ, + FDOP_WRITE, + FDOP_CLOSE, +}; + +int fdop_dispatch(enum fdop fdop, fd_t fd, void *ptr, size_t len); |