From e167f47570d200bafda1db6200fe4e51bdc70922 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 30 Nov 2022 16:24:59 +0100 Subject: [PATCH] ev::read,write: improve docs --- ev/+linux/io.ha | 12 ++++++++---- diff --git a/ev/+linux/io.ha b/ev/+linux/io.ha index 75c46d61ca0f9aab987c345aa7959d7f99aa4b6d..0a8b773678a85dcaacb4aff322119301209cd101 100644 --- a/ev/+linux/io.ha +++ b/ev/+linux/io.ha @@ -4,7 +4,8 @@ // A callback for a [[read]] or [[readv]] operation. export type readcb = fn(file: *file, result: (size | io::EOF | io::error)) void; -// Schedules a read operation on a file object. +// Schedules a read operation on a file object. The provided buffer must be +// valid for the duration of the read operation. export fn read( file: *file, cb: *readcb, @@ -16,7 +17,8 @@ const vec = (&file.rvbuf: *[*]io::vector)[..1]; return readv(file, cb, vec...); }; -// Schedules a vectored read operation on a file object. +// Schedules a vectored read operation on a file object. The provided vectors +// must be valid for the duration of the read operation. export fn readv( file: *file, cb: *readcb, @@ -54,7 +56,8 @@ // A callback for a [[write]] or [[writev]] operation. export type writecb = fn(file: *file, result: (size | io::error)) void; -// Schedules a write operation on a file object. +// Schedules a write operation on a file object. The provided buffer must be +// valid for the duration of the write operation. export fn write( file: *file, cb: *writecb, @@ -66,7 +69,8 @@ const vec = (&file.wvbuf: *[*]io::vector)[..1]; return writev(file, cb, vec...); }; -// Schedules a vectored read operation on a file object. +// Schedules a vectored read operation on a file object. The provided buffer +// must be valid for the duration of the write operation. export fn writev( file: *file, cb: *writecb, -- 2.48.1