2 * UCW Library -- Careful Read/Write
4 * (c) 2004--2012 Martin Mares <mj@ucw.cz>
6 * This software may be freely distributed and used according to the terms
7 * of the GNU Lesser General Public License.
16 * Reads and writes on sockets and pipes can return partial results,
17 * so we implement an iterated read/write call.
21 careful_read(int fd, void *buf, int len)
26 int l = read(fd, pos, len);
38 careful_write(int fd, const void *buf, int len)
40 const byte *pos = buf;
43 int l = write(fd, pos, len);