Tripped this TODO while trying new IO
The implementation is the same as Io.Dispatch and Io.Evented
breakmit/zig:master into master Tripped this TODO while trying new IO
The implementation is the same as Io.Dispatch and Io.Evented
@ -15661,2 +15661,3 @@
.ignore=>trydup2(dev_null_fd,std_fileno),
.file=>@panic("TODO implement setUpChildIo when file is used"),
.file=>|file|{
if(file.flags.nonblocking)@panic("TODO: Implement setUpChildIo when nonblocking file is used");
why doesn't it work when nonblocking file is used?
Honestly I don't know, both other implementations had this guard too but I could not find any info about whether standard streams are "expected" to be open in blocking mode (at least on posix).
Thinking about it more, since you cant just remove O_NONBLOCK because its set on the file object and not the descriptor, and as far as II know, fork only duplicates the file descriptors. I guess the only thing that makes sense is to remove that guard from all 3 implementation and hope that the child is ready to deal with O_NONBLOCK.
I will remove the panic from all 3 impls.
I see, it's kind of like a standard of sorts, that stdin, stdout, and stderr are opened in a blocking manner.
I think the correct approach here is to document this information and allow the user of the API to choose what to do, because they may know something about the child process being executed, that the lower level API cannot.
8f2259ca6e
fa134d97c4
fa134d97c4
5109c55ae5
Thank you! Nicely worded docs 👍
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?