Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aio updates to avoid stdio #266

Merged
merged 11 commits into from
Jul 3, 2023
Merged

aio updates to avoid stdio #266

merged 11 commits into from
Jul 3, 2023

Conversation

msteveb
Copy link
Owner

@msteveb msteveb commented Jul 1, 2023

Adds timeouts on blocking reads, separate read and write buffering, autoflush for writes on nonblocking channels.
Also adds -noclose to avoid close-on-exec

msteveb added 11 commits July 1, 2023 18:37
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>
Now 'constraint cmd|package' is like 'needs' but sets a constraint
The command to 'needs cmd' and 'constraint cmd' can now take
a subcommand to check.

Add 'constraint|needs eval|expr' to make some constraint checks
simpler.

Signed-off-by: Steve Bennett <steveb@workware.net.au>
AIO_KEEPOPEN won't close a channel (such as stdin, stdout)
when the command is deleted/replaced, but an explicit close
will still close the channel.

Signed-off-by: Steve Bennett <steveb@workware.net.au>
This is simpler now that we can write to a non-blocking socket
even if it is "full".

Signed-off-by: Steve Bennett <steveb@workware.net.au>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
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>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
socket ?-noclose? ...
open filename ?-noclose? ...

Normally Jim will set O_CLOEXEC on all files and sockets that are opened
however sometimes it is desirable to keep file descriptors open for
child processes. The -noclose flags does this (on supported platforms).

Signed-off-by: Steve Bennett <steveb@workware.net.au>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
And also fix a minor bug that if unable to format the socket address
the file descriptor would be left open.

Signed-off-by: Steve Bennett <steveb@workware.net.au>
To open, socket and accept
Also document aio getfd

Signed-off-by: Steve Bennett <steveb@workware.net.au>
@msteveb msteveb merged commit a6f1012 into master Jul 3, 2023
@msteveb msteveb deleted the aio-nostdio branch August 14, 2023 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant