This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]