Don't work around an lseek POSIX compliance bug on IRIX.
authorBruno Haible <bruno@clisp.org>
Sat, 2 Jun 2007 00:42:13 +0000 (00:42 +0000)
committerBruno Haible <bruno@clisp.org>
Sat, 2 Jun 2007 00:42:13 +0000 (00:42 +0000)
ChangeLog
doc/functions/lseek.texi
tests/test-lseek.c

index 409f5ed..cd4baa1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-06-01  Bruno Haible  <bruno@clisp.org>
+
+       * tests/test-lseek.c (main): Disable test of errno for invalid third
+       argument.
+       * doc/functions/lseek.texi: Update.
+
 2007-05-28  Bruno Haible  <bruno@clisp.org>
 
        * m4/intl.m4 (AM_INTL_SUBDIR): Substitute variables WOE32, WINDRES.
index cbfdc2c..e39ad01 100644 (file)
@@ -22,4 +22,9 @@ and most character devices don't support it.
 On platforms where @code{off_t} is a 32-bit type, @code{lseek} does not work
 correctly with files larger than 2 GB.  The fix is to use the
 @code{AC_SYS_LARGEFILE} macro.
+@item
+When the third argument is invalid, POSIX says that @code{lseek} should set
+@code{errno} to @code{EINVAL} and return -1, but in this situation a
+@code{SIGSYS} signal is raised on some platforms:
+IRIX 6.5.
 @end itemize
index f8fcfec..f1f956e 100644 (file)
@@ -50,16 +50,20 @@ main (int argc, char **argv)
       ASSERT (errno == EINVAL);
       errno = 0;
       ASSERT (lseek (0, (off_t)0, SEEK_CUR) == 2);
+#if 0 /* leads to SIGSYS on IRIX 6.5 */
       ASSERT (lseek (0, (off_t)0, (SEEK_SET | SEEK_CUR | SEEK_END) + 1) == -1);
       ASSERT (errno == EINVAL);
+#endif
       ASSERT (lseek (1, (off_t)2, SEEK_SET) == 2);
       errno = 0;
       ASSERT (lseek (1, (off_t)-4, SEEK_CUR) == -1);
       ASSERT (errno == EINVAL);
       errno = 0;
       ASSERT (lseek (1, (off_t)0, SEEK_CUR) == 2);
+#if 0 /* leads to SIGSYS on IRIX 6.5 */
       ASSERT (lseek (1, (off_t)0, (SEEK_SET | SEEK_CUR | SEEK_END) + 1) == -1);
       ASSERT (errno == EINVAL);
+#endif
       break;
 
     case '1': /* pipes */