allread(3)
limb manual
allread(3)
NAME
allread, allreadv - read requested amount of data from a file
SYNOPSIS
#include <limb/allreadwrite.h>
size_t allread(int fd, char *dst, size_t dlen) size_t allreadv(int fd, const struct iovec *v, unsigned n)
DESCRIPTION
The allread() function will attempt to read dlen bytes from the file
associated with file descriptor fd and copy them into the memory pointed by
dst.
The allreadv() function is similar only placing the data into the memory
described by the array v of n vectors.
RETURN VALUE
These functions return the number of bytes read, which may be less than dlen
(even 0) in case of error, or if end-of-file was reached prior.
Hint
To know whether an error occurred or not, you might want to set errno to 0
prior to the call, and check it afterwards.