Another lseek bug on BeOS.
[pspp] / tests / test-lseek.c
index f1f956e995083afd5e8589de1c3c9f09612546a2..1948920a4a6a3cb9e700b9a3f97407e09d90daae 100644 (file)
@@ -49,7 +49,11 @@ main (int argc, char **argv)
       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);
@@ -59,7 +63,11 @@ main (int argc, char **argv)
       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);