On Thu, Jul 11, 2019 at 03:41:43PM -0400, Stefan Berger wrote:
To avoid blocking on a write on a pipe that the receiving process
does not read from, write only MAX_PIPE_WRITE_BYTES into the pipe
so that we can serve other pipes as well.
This doesn't work. The pipe can have 1025 bytes free space, so you'll
write 1024 bytes first fine, and next iteration there'll be one byte
free space and you'll block. If you need to avoid blocking you must
use O_NONBLOCK on the fd. Don't try to guess how much you can write,
just write until you get EAGAIN.
Regards,
Daniel
--
|:
https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|:
https://libvirt.org -o-
https://fstop138.berrange.com :|
|:
https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|