Use poll(2) for stdin #2
Merged
clement.freville2
merged 2 commits from sys/poll-stdin
into master
2 years ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'sys/poll-stdin'
Deleting a branch is permanent. It CANNOT be undone. Continue?
The runner tightly controls program input and output with three pipes. It's nearly impossible to know in advance in what order and when pipes can be read or written.
Instead, each file descriptor is waited for with
poll
, allowing theread
andwrite
functions to be called only if they are non-blocking calls.Standard input is now also written in this way, allowing programs longer than the capacity of a tube buffer to be written. This input is treated carefully, since the program can close its standard input before we've had a chance to write the standard input completly. This avoids most kills for sigpipe, although there may be a race situation during the short time frame between the call to
poll
and the write.A runner can now be invoked directly from the command line, to do quick testing.
🖖
60b4fce341
into master 2 years agoReviewers
60b4fce341
.