summaryrefslogtreecommitdiff
path: root/src/sys/include/os/filedesc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/include/os/filedesc.h')
-rw-r--r--src/sys/include/os/filedesc.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/sys/include/os/filedesc.h b/src/sys/include/os/filedesc.h
index 9d6f229..87bf242 100644
--- a/src/sys/include/os/filedesc.h
+++ b/src/sys/include/os/filedesc.h
@@ -31,6 +31,33 @@
#define _OS_FILEDESC_H_ 1
#include <sys/types.h>
+#include <os/vnode.h>
+
+struct proc;
+
+/*
+ * Represents a file descriptor
+ *
+ * @fdno: File descriptor index
+ * @vp: Vnode this fd is linked with
+ * @mode: File attributes
+ */
+struct filedesc {
+ int fdno;
+ struct vnode *vp;
+ mode_t mode;
+};
+
+/*
+ * Initialize a process file descriptor table
+ * and set up standard streams
+ *
+ * @procp: Process of fd table to init
+ *
+ * Returns zero on success, less than zero values
+ * indicate failure.
+ */
+int fdtab_init(struct proc *procp);
/*
* Write to a file descriptor