-2007-08-18 Bruno Haible <bruno@clisp.org>
+2007-08-19 Bruno Haible <bruno@clisp.org>
+
+ * tests/test-lseek.c (main): Disable a test for BeOS.
+ * doc/functions/lseek.texi: Document the BeOS bug.
+
+2007-08-19 Bruno Haible <bruno@clisp.org>
Eric Blake <ebb9@byu.net>
* lib/lseek.c: Include <sys/stat.h>.
@code{errno} to @code{EINVAL} and return -1, but in this situation a
@code{SIGSYS} signal is raised on some platforms:
IRIX 6.5.
+@item
+When the @code{lseek} function fails, POSIX says that the file offset remains
+unchanged. But on some platforms, attempting to set a negative file offset
+fails and sets the file offset to 0:
+BeOS.
@end itemize
ASSERT (lseek (0, (off_t)-4, SEEK_CUR) == -1);
ASSERT (errno == EINVAL);
errno = 0;
+#if ! defined __BEOS__
+ /* POSIX says that the last lseek call, when failing, does not change
+ the current offset. But BeOS sets it to 0. */
ASSERT (lseek (0, (off_t)0, SEEK_CUR) == 2);
+#endif
#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);
ASSERT (lseek (1, (off_t)-4, SEEK_CUR) == -1);
ASSERT (errno == EINVAL);
errno = 0;
+#if ! defined __BEOS__
+ /* POSIX says that the last lseek call, when failing, does not change
+ the current offset. But BeOS sets it to 0. */
ASSERT (lseek (1, (off_t)0, SEEK_CUR) == 2);
+#endif
#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);