stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r388805 - /incubator/stdcxx/trunk/src/memattr.cpp
Date Sat, 25 Mar 2006 19:58:50 GMT
Author: sebor
Date: Sat Mar 25 11:58:49 2006
New Revision: 388805

URL: http://svn.apache.org/viewcvs?rev=388805&view=rev
Log:
2006-03-25  Martin Sebor  <sebor@roguewave.com>

	* memattr.cpp (__rw_memattr): Used mvalid() instead of madvise()
	on Tru64 UNIX.
	Removed checks for errno values EFAULT and EINVAL for portability
	and simply tested for any non-zero errno value.

Modified:
    incubator/stdcxx/trunk/src/memattr.cpp

Modified: incubator/stdcxx/trunk/src/memattr.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/src/memattr.cpp?rev=388805&r1=388804&r2=388805&view=diff
==============================================================================
--- incubator/stdcxx/trunk/src/memattr.cpp (original)
+++ incubator/stdcxx/trunk/src/memattr.cpp Sat Mar 25 11:58:49 2006
@@ -28,7 +28,7 @@
 
 #define _RWSTD_LIB_SRC
 
-#include <errno.h>    // for errno
+#include <errno.h>    // for ENOMEM, errno
 #include <string.h>   // for memchr
 
 #ifdef __CYGWIN__
@@ -131,6 +131,18 @@
                 return next == page ? -1 : DIST (next, addr);
         }
 
+#  elif defined (_RWSTD_OS_OSF1)
+
+        // use Tru64 mvalid()
+        if (-1 == mvalid (next, 1, PROT_READ)) {
+
+            const int err = errno;
+            errno = errno_save;
+
+            if (err)
+                return next == page ? -1 : DIST (next, addr);
+        }
+
 #  elif !defined (_RWSTD_NO_MADVISE)
 
         // on HP-UX, Linux, use madvise() as opposed to mincore()
@@ -141,7 +153,7 @@
             const int err = errno;
             errno = errno_save;
 
-            if (EFAULT == err || ENOMEM == err)
+            if (err)
                 return next == page ? -1 : DIST (next, addr);
         }
 



Mime
View raw message