summaryrefslogtreecommitdiff
path: root/os/include
diff options
context:
space:
mode:
Diffstat (limited to 'os/include')
-rw-r--r--os/include/fio.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/os/include/fio.h b/os/include/fio.h
new file mode 100644
index 0000000..a1a1c1f
--- /dev/null
+++ b/os/include/fio.h
@@ -0,0 +1,28 @@
+#ifndef __FIO_H__
+#define __FIO_H__
+
+#include <stdio.h>
+
+#define MAX_FDS 32
+
+typedef ssize_t (*fdread_t)(void * opaque, void * buf, size_t count);
+typedef ssize_t (*fdwrite_t)(void * opaque, const void * buf, size_t count);
+typedef off_t (*fdseek_t)(void * opaque, off_t offset, int whence);
+typedef int (*fdclose_t)(void * opaque);
+
+struct fddef_t {
+ fdread_t fdread;
+ fdwrite_t fdwrite;
+ fdseek_t fdseek;
+ fdclose_t fdclose;
+ void * opaque;
+};
+
+int fio_is_open(int fd);
+int fio_open(fdread_t, fdwrite_t, fdseek_t, fdclose_t, void * opaque);
+ssize_t fio_read(int fd, void * buf, size_t count);
+ssize_t fio_write(int fd, const void * buf, size_t count);
+off_t fio_seek(int fd, off_t offset, int whence);
+int fio_close(int fd);
+
+#endif