lq-text: LQU_Elseek

API off_t LQU_Elseek (Severity, Name, What, fd, Position, Whence) int Severity; CONST char *Name; CONST char *What; int fd; off_t Position; int Whence;

Purpose

This is a wrapper for the lseek(2) system call. On an error, the given Name (which should reflect the corresponding file name, but need not be suitable to access that file) and What, which should be a terse description of the way in which the program is using the file, are used to construct a message passed to Error with the given Severity.

The fd, Position and Whence arguments are as for the lseek(2) system call.

Returns

The new file offset on success, or -1 on failure.

Errors

Generates an Error at the given Severity if lseek fails, adding (with bitwise or) E_SYS if appropriate.

Example

Where = LQU_lseek(E_FATAL, "passwd", "user database", 0, 0L, SEEK_SET);