[Debian-med-packaging] Bug#697015: imagevis3d: FTBFS[kfreebsd]: posix_fadvise() function is optional

Petr Salinger Petr.Salinger at seznam.cz
Sat Apr 20 16:50:57 UTC 2013


tags 697015 + patch
notfixed 697015 2.0.1-5
--
Hi.

Accroding to 
http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_fadvise.html

"The posix_fadvise() function is part of the Advisory Information option 
and need not be provided on all implementations."

Please guard usage by POSIX_FADV_WILLNEED, not by POSIX version.

Petr


--- Tuvok/Basics/LargeFileFD.cpp
+++ Tuvok/Basics/LargeFileFD.cpp
@@ -75,7 +75,7 @@
    if(lseek(this->fd, offset+this->header_size, SEEK_SET) < 0) {
      throw std::ios_base::failure("could not seek to correct file position.");
    }
-#if _POSIX_C_SOURCE >= 200112L
+#ifdef POSIX_FADV_WILLNEED
    posix_fadvise(this->fd, offset+this->header_size, len, POSIX_FADV_WILLNEED);
  #endif

@@ -126,7 +126,7 @@
  void LargeFileFD::enqueue(uint64_t offset, size_t len)
  {
    if(len == 0) { return; }
-#if _POSIX_C_SOURCE >= 200112L
+#ifdef POSIX_FADV_WILLNEED
    int adv = posix_fadvise(this->fd, offset, len, POSIX_FADV_WILLNEED);
    // this should basically always succeed.  the only way it can fail is if we
    // gave it a bogus FD or something.  if that's the case, that points to



More information about the Debian-med-packaging mailing list