FYI, fix has been applied upstream.
Thanks,
-tom
-------- Original Message --------
Subject: [Basics-commits] r295 - trunk
Date: Mon, 30 Sep 2013 12:09:07 -0600 (MDT)
From: tfo...@sci.utah.edu
To: basics-comm...@sci.utah.edu
Author: tfogal
Date: 2013-09-30 12:09:06 -0600 (Mon, 30 Sep 2013)
New Revision: 295
Modified:
trunk/LargeFileFD.cpp
Log:
Proper test for POSIX_FADV_WILLNEED.
According 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."
fcntl.h's specification indeed says that these constants must be
valid in #if processing directives.
Thanks Petr Salinger for the diagnosis/fix.
Modified: trunk/LargeFileFD.cpp
===================================================================
--- trunk/LargeFileFD.cpp 2013-04-30 15:22:29 UTC (rev 294)
+++ trunk/LargeFileFD.cpp 2013-09-30 18:09:06 UTC (rev 295)
@@ -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
_______________________________________________
Basics-commits mailing list
basics-comm...@gforge.sci.utah.edu
https://gforge.sci.utah.edu/mailman/listinfo/basics-commits
--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org