From 40a871a5db0fb808c5224cf4d37af6c23c55290d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 2 Jun 2007 00:42:13 +0000 Subject: [PATCH] Don't work around an lseek POSIX compliance bug on IRIX. --- ChangeLog | 6 ++++++ doc/functions/lseek.texi | 5 +++++ tests/test-lseek.c | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index 409f5edc5..cd4baa120 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-06-01 Bruno Haible + + * tests/test-lseek.c (main): Disable test of errno for invalid third + argument. + * doc/functions/lseek.texi: Update. + 2007-05-28 Bruno Haible * m4/intl.m4 (AM_INTL_SUBDIR): Substitute variables WOE32, WINDRES. diff --git a/doc/functions/lseek.texi b/doc/functions/lseek.texi index cbfdc2c4b..e39ad01a7 100644 --- a/doc/functions/lseek.texi +++ b/doc/functions/lseek.texi @@ -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 diff --git a/tests/test-lseek.c b/tests/test-lseek.c index f8fcfec36..f1f956e99 100644 --- a/tests/test-lseek.c +++ b/tests/test-lseek.c @@ -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 */ -- 2.11.0