dmi_file_write
Synopsis
#include <opendmi/utils/file.h>
ssize_t dmi_file_write(int fd, const dmi_data_t *data, size_t size);
Description
The dmi_file_write function performs a full write by looping until all
requested bytes are written or a zero-length write is returned. It retries
automatically if interrupted by a signal (EINTR). Fewer than size bytes
are returned only if the underlying write(2) call returns zero before all
bytes are written.
Return value
Returns the total number of bytes written (may be less than size if a
zero-length write occurs), 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_read,
dmi_file_seek,
dmi_file_close,
write(2)