aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2023-05-28 11:22:12 +1000
committerSteve Bennett <steveb@workware.net.au>2023-07-04 09:23:43 +1000
commit0947361fe1b37219678f744e8d9245124245cbe9 (patch)
tree4f85941109af6634bc2d2f96ff1f3415c550a8c4
parent526541f90e865bc8598e59daa2b70c2181d5d5db (diff)
downloadjimtcl-0947361fe1b37219678f744e8d9245124245cbe9.zip
jimtcl-0947361fe1b37219678f744e8d9245124245cbe9.tar.gz
jimtcl-0947361fe1b37219678f744e8d9245124245cbe9.tar.bz2
aio: change to use unix io, not stdio
This changes especially makes buffered I/O work with non-blocking channels. - separate read and write buffering - support for timeout on blocking read - read/write on same channel in event loop with buffering - read buffer is the same across read, gets, copyto - autoflush non-blocking writes via event loop - copyto can now copy to any filehandle-like command - add some copyto tests Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r--jim-aio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/jim-aio.c b/jim-aio.c
index abc7482..6baab10 100644
--- a/jim-aio.c
+++ b/jim-aio.c
@@ -1585,6 +1585,9 @@ static int aio_cmd_sync(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
AioFile *af = Jim_CmdPrivData(interp);
+ if (aio_flush(interp, af) != JIM_OK) {
+ return JIM_ERR;
+ }
fsync(af->fd);
return JIM_OK;
}