1 /* vi: set sw=4 ts=4: */
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
15 * Read all of the supplied buffer from a file.
16 * This does multiple reads as necessary.
17 * Returns the amount read, or -1 on an error.
18 * A short read is returned on an end of file.
20 ssize_t bb_full_read(int fd, void *buf, size_t len)
28 cc = safe_read(fd, buf, len);
31 return cc; /* read() returns -1 on failure. */
36 buf = ((char *)buf) + cc;