2 * UCW Library -- Careful Read/Write
4 * (c) 2004 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.
15 * Reads and writes on sockets and pipes can return partial results,
16 * so we implement an iterated read/write call.
20 careful_read(int fd, void *buf, int len)
25 int l = read(fd, pos, len);
37 careful_write(int fd, const void *buf, int len)
39 const byte *pos = buf;
42 int l = write(fd, pos, len);