>> How can I do nonblocking read from fd 0 without
>> affecting other processes which might share it?
> 
> Assuming no other process will be reading at the same time, you simply
> call poll first (or select, but select requires the fd # to be < 1024)
> to check that it won't block, then call read. select and poll are
> specified to only mark the fd readable if a read would not block.

 Okay.
 Same question with writes, then. If I poll() my fd 1 and poll returns
writability, do I have the guarantee that write() will not block ?
 Even if fd 1 points to the network ? (I've heard things about a
kernel buffer for outgoing data; if some other process fills up the
kernel buffer between poll() and write(), then write() will block.)

 Doing asynchronous loops without O_NONBLOCK does not feel right.

-- 
 Laurent
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to