From 57ce367309de9ac1b1938202156eac554420bb2a Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 4 Sep 2021 15:25:40 +0200 Subject: rename file descriptors to handles --- src/kernel/fd.h | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 src/kernel/fd.h (limited to 'src/kernel/fd.h') diff --git a/src/kernel/fd.h b/src/kernel/fd.h deleted file mode 100644 index c7c5182..0000000 --- a/src/kernel/fd.h +++ /dev/null @@ -1,47 +0,0 @@ -#pragma once -#include -#include - -#define FD_MAX 16 - -typedef int fd_t; // TODO duplicated in syscalls.h - -enum fd_type { - FD_EMPTY, - FD_SPECIAL_TTY, -}; - -struct fd { - enum fd_type type; -}; - - -enum fdop { // describes the operations which can be done on file descriptors - FDOP_MOUNT, // also closes the original fd - FDOP_OPEN, // when the file descriptor is mounted, open a file relative to it - - FDOP_READ, - FDOP_WRITE, - FDOP_CLOSE, -}; - -struct fdop_args { - enum fdop type; - struct fd *fd; - union { - struct { // FDOP_MOUNT - struct mount *target; - } mnt; - struct { // FDOP_OPEN - struct fd *target; - const char *path; // relative to the mount point - size_t len; - } open; - struct { // FDOP_READ, FDOP_WRITE - user_ptr ptr; - size_t len; - } rw; - }; -}; - -int fdop_dispatch(struct fdop_args args); -- cgit v1.2.3