commit 87dbd8f0783ff9fa723668540f552e0d25090bff
parent 42a9ba90c264964b9f723fb2c4dd0c53bb88f897
Author: Alexey Yerin <yyp@disroot.org>
Date: Sat, 23 Oct 2021 17:05:37 +0300
iobus: update documentation and assertion messages for open/create
Signed-off-by: Alexey Yerin <yyp@disroot.org>
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/iobus/io_uring/ops.ha b/iobus/io_uring/ops.ha
@@ -185,6 +185,8 @@ export fn endpoll(bus: *bus, res: result) (poll::event | error) = {
// TODO: poll_remove
+// Prepares an asynchronous open operation.
+//
// If no flags are provided, [[fs::flags::RDONLY]], [[fs::flags::NOCTTY]],
// [[fs::flags::CLOEXEC]] are used when opening the file. If you pass your own
// flags, it is recommended that you add the latter two unless you know that you
@@ -217,11 +219,13 @@ export fn open(
export fn endopen(bus: *bus, res: result) (io::file | error) = {
let handle = handleof(res);
assert(handle.sqe.opcode == io_uring::op::OPENAT,
- "endopen called for non-poll iobus::result");
+ "endopen called for non-open iobus::result");
free(handle.cstring);
return cqe_result(res)?: io::file;
};
+// Prepares an asynchronous file creation operation.
+//
// If no flags are provided, [[fs::flags::WRONLY]], [[fs::flags::NOCTTY]],
// [[fs::flags::CLOEXEC]] are used when opening the file. If you pass your own
// flags, it is recommended that you add the latter two unless you know that you
@@ -256,7 +260,7 @@ export fn create(
export fn endcreate(bus: *bus, res: result) (io::file | error) = {
let handle = handleof(res);
assert(handle.sqe.opcode == io_uring::op::OPENAT,
- "endcreate called for non-poll iobus::result");
+ "endcreate called for non-create iobus::result");
free(handle.cstring);
return cqe_result(res)?: io::file;
};