diff options
Diffstat (limited to 'src/kernel/handle.h')
-rw-r--r-- | src/kernel/handle.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/kernel/handle.h b/src/kernel/handle.h index d502d5d..af9d45a 100644 --- a/src/kernel/handle.h +++ b/src/kernel/handle.h @@ -13,16 +13,19 @@ enum handle_type { HANDLE_NULL, }; +// TODO use unions +// when making changes, keep in mind that dup creates copies of HANDLE_FILEs struct Handle { enum handle_type type; - VfsBackend *backend; // HANDLE_FILE | HANDLE_FS_FRONT - void __user *file_id; // only applicable to HANDLE_FILE + VfsBackend *backend; /* HANDLE_FILE | HANDLE_FS_FRONT */ + void __user *file_id; /* only applicable to HANDLE_FILE */ bool readable, writeable; /* HANDLE_FILE | HANDLE_PIPE */ VfsReq *req; /* HANDLE_FS_REQ */ struct { Proc *queued; Handle *sister; // the other end, not included in refcount } pipe; + Handle *base; /* used by dup'd HANDLE_FILEs. */ size_t refcount; }; |