dmi_file_read
Synopsis
#include <opendmi/utils/file.h>
ssize_t dmi_file_read(int fd, dmi_data_t *data, off_t offset, size_t size);
Description
The dmi_file_read function performs a full read by looping until all
requested bytes are read or end-of-file is reached. It retries automatically
if interrupted by a signal (EINTR). Fewer than size bytes are returned
only if EOF is encountered before the read is complete.
Return value
Returns the total number of bytes read (may be less than size at EOF), or
-1 on error with errno set accordingly.
A missing argument is not an error of the system: -1 is returned, and
errno is left as it was.
Errors
DMI_ERROR_ARGUMENT_NULL-
dataisnullptr. The error reaches no error queue, since the function takes no context to hold it.
See also
dmi_file_load,
dmi_file_seek,
dmi_file_stat,
dmi_file_close,
read(2)