lxc/{terminal, file_utils}: ensure complete data writes in ptx/peer io handlers
Previously, lxc_write_nointr could return without writing all data
when write() returned EAGAIN/EWOULDBLOCK due to buffer full conditions.
This change:
- Implements a loop to continue writing until all data is sent
- Handles EINTR, EAGAIN, and EWOULDBLOCK errors appropriately
- Uses poll() to wait for fd to become ready when blocked
- Maintains backward compatibility while fixing partial write issues
Signed-off-by: DreamConnected <1487442471@qq.com>
[ alex ]
- introduce a separate helper lxc_write_all and use it only in ptx/peer
io handlers
- cleanup the code a bit Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>