[Patch] Fix libstdc++/8610 (draft2)

Paolo Carlini pcarlini@unitus.it
Tue Oct 21 21:46:00 GMT 2003


Hi again,

I have just noticed a problem here:

>   streamoff
>   __basic_file<char>::seekoff(streamoff __off, ios_base::seekdir __way)
>-  { return lseek(this->fd(), __off, __way); }
>+  {
>+#ifdef _GLIBCXX_USE_LFS
>+    return lseek64(this->fd(), __off, __way);
>+#else
>+    if (__off > std::numeric_limits<off_t>::max())
>+      return -1L;
>+    return lseek(this->fd(), __off, __way);
>+#endif
>+  }
>
off_t is a *signed* quantity, therefore, in the non-LFS case, we must fail
both when __off > std::numeric_limits<off_t>::max() and when
__off < std::numeric_limits<off_t>::min().

Will do the change locally and proceed with the x86_64 tests too...

Paolo.



More information about the Libstdc++ mailing list