summaryrefslogtreecommitdiff
path: root/src/aio/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/aio/include')
-rw-r--r--src/aio/include/aio.h39
1 files changed, 31 insertions, 8 deletions
diff --git a/src/aio/include/aio.h b/src/aio/include/aio.h
index f9f76cb..cea6ee1 100644
--- a/src/aio/include/aio.h
+++ b/src/aio/include/aio.h
@@ -1,5 +1,5 @@
/*
- * wanix, a Unix-like operating system for WebAssembly
+ * wanix, a Unix-like operating system for WebAssembly applications.
* Copyright (C) 2025 Xavier Del Campo Romero
*
* This program is free software: you can redistribute it and/or modify
@@ -19,17 +19,40 @@
#ifndef AIO_H
#define AIO_H
+#include <fs/fs.h>
+#include <sys/types.h>
+#include <state.h>
+#include <stdbool.h>
#include <stddef.h>
-enum
+struct aio_poll
{
- AIO_POLLIN = 1,
- AIO_POLLOUT = 1 << 1
+ const struct aio *aio;
+ bool done;
+ int error;
+ struct aio_poll *prev, *next;
};
-struct aio *aio_open(const char *path, const char *mode);
-int aio_poll(struct aio **io, size_t n);
-int aio_event(const struct aio *io, int ev);
-int aio_close(struct aio *io);
+struct aio_done
+{
+ int (*f)(enum state state, void *args);
+ void *args;
+};
+
+struct aio_mount
+{
+ struct fs_mount mount;
+ const char *type;
+};
+
+struct aio *aio_mount(const struct aio_mount *m, const struct aio_done *d);
+struct aio *aio_mkdir(const struct fs_mkdir *m, const struct aio_done *d);
+struct aio *aio_open(const struct fs_open *o, const struct aio_done *d);
+struct aio *aio_read(const struct fs_read *r, const struct aio_done *d);
+struct aio *aio_write(const struct fs_write *w, const struct aio_done *d);
+struct aio *aio_close(const struct fs_close *c, const struct aio_done *d);
+struct aio *aio_stat(const struct fs_stat *s, const struct aio_done *d);
+int aio_poll(struct aio_poll *p, int ms);
+void aio_free(struct aio *io);
#endif