lseek
=====

POSIX specification:
 https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html

Gnulib module: lseek

Portability problems fixed by Gnulib:

  * On some platforms, lseek (fd, offset, SEEK_DATA) returns a value greater than offset even when offset addresses data: macOS 12

  * This function is declared in a different header file (namely, <io.h>) on some platforms: MSVC 14.

  * On platforms where off_t is a 32-bit type, lseek does not work correctly with files larger than 2 GB.  (Cf. AC_SYS_LARGEFILE.)

  * This function mistakenly succeeds on pipes on some platforms: mingw, MSVC 14.

Portability problems not fixed by Gnulib:

  * POSIX does not specify which file descriptors support seeking and which don't. In practice, regular files and block devices support seeking, and ttys, pipes, and most character devices don't support it.

  * When the third argument is invalid, POSIX says that lseek should set errno to EINVAL and return -1, but in this situation a SIGSYS signal is raised on some platforms: IRIX 6.5.

  * Some systems do not support SEEK_DATA and SEEK_HOLE: AIX, HP-UX, Microsoft Windows, NetBSD, OpenBSD.