aboutsummaryrefslogtreecommitdiff
path: root/kernel/include/mux/io.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/include/mux/io.h')
-rw-r--r--kernel/include/mux/io.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/kernel/include/mux/io.h b/kernel/include/mux/io.h
new file mode 100644
index 0000000..4ec45f5
--- /dev/null
+++ b/kernel/include/mux/io.h
@@ -0,0 +1,30 @@
+#ifndef MUX_IO_H
+#define MUX_IO_H
+
+#include <stddef.h>
+
+typedef long ssize_t;
+
+struct file;
+struct file_operations;
+
+struct file {
+ struct file_operations* const fops;
+ void* private_data;
+};
+
+struct file_operations {
+ int (*open)(struct file* file);
+ int (*ioctl)(struct file* file, int cmd, long args);
+ ssize_t (*read)(struct file* file, char* const buffer, size_t size);
+ ssize_t (*write)(struct file* file, const char* const buffer, size_t size);
+ int (*close)(struct file* file);
+};
+
+int open(struct file* file);
+int ioctl(struct file* file, int cmd, long args);
+ssize_t read(struct file* file, char* const buffer, size_t size);
+ssize_t write(struct file* file, const char* const buffer, size_t size);
+int close(struct file* file);
+
+#endif \ No newline at end of file