diff options
Diffstat (limited to 'kernel/io/include/io/io.h')
-rw-r--r-- | kernel/io/include/io/io.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/kernel/io/include/io/io.h b/kernel/io/include/io/io.h new file mode 100644 index 0000000..a715f1b --- /dev/null +++ b/kernel/io/include/io/io.h @@ -0,0 +1,30 @@ +#ifndef IO_H +#define IO_H + +#include <stddef.h> + +typedef long ssize_t; + +struct file; +struct file_operations; + +struct file { + struct file_operations* 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 |