poll tests: Avoid test failure on BSD and Solaris systems.
[gnulib.git] / doc / posix-functions / lseek.texi
blob4a9d55dcf7c243e7337d20020221a9386cd29980
1 @node lseek
2 @section @code{lseek}
3 @findex lseek
5 POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html}
7 Gnulib module: lseek
9 Portability problems fixed by Gnulib:
10 @itemize
11 @item
12 This function is declared in a different header file (namely, @code{<io.h>})
13 on some platforms:
14 MSVC 14.
15 @item
16 On platforms where @code{off_t} is a 32-bit type, @code{lseek} does not work
17 correctly with files larger than 2 GB@.  (Cf. @code{AC_SYS_LARGEFILE}.)
18 @item
19 This function mistakenly succeeds on pipes on some platforms: mingw, MSVC 14.
20 @end itemize
22 Portability problems not fixed by Gnulib:
23 @itemize
24 @item
25 POSIX does not specify which file descriptors support seeking and which don't.
26 In practice, regular files and block devices support seeking, and ttys, pipes,
27 and most character devices don't support it.
28 @item
29 When the third argument is invalid, POSIX says that @code{lseek} should set
30 @code{errno} to @code{EINVAL} and return @minus{}1, but in this situation a
31 @code{SIGSYS} signal is raised on some platforms:
32 IRIX 6.5.
33 @item
34 Some systems do not support @code{SEEK_DATA} and @code{SEEK_HOLE}:
35 AIX, HP-UX, Microsoft Windows, NetBSD, OpenBSD.
36 @end itemize