dmi_file_seek

Synopsis

#include <opendmi/utils/file.h>

off_t dmi_file_seek(int fd, off_t offset, int whence);

Description

The dmi_file_seek function is a wrapper around lseek(2) that retries automatically if interrupted by a signal (EINTR).

Parameters

fd

Open file descriptor.

offset

Byte offset to apply, relative to whence.

whence

Offset directive: SEEK_SET (beginning of file), SEEK_CUR (current position), or SEEK_END (end of file).

Return value

Returns the resulting byte offset from the beginning of the file, or -1 on error with errno set accordingly.

Errors

None.

See also