Author: sebor
Date: Mon Sep 17 18:29:30 2007
New Revision: 576644
URL: http://svn.apache.org/viewvc?rev=576644&view=rev
Log:
2007-09-17 Martin Sebor <[EMAIL PROTECTED]>
STDCXX-20
* MADVISE.cpp: New config test to determine whether the system call
madvise() is supported.
Added:
incubator/stdcxx/trunk/etc/config/src/MADVISE.cpp (with props)
Added: incubator/stdcxx/trunk/etc/config/src/MADVISE.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/MADVISE.cpp?rev=576644&view=auto
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/MADVISE.cpp (added)
+++ incubator/stdcxx/trunk/etc/config/src/MADVISE.cpp Mon Sep 17 18:29:30 2007
@@ -0,0 +1,20 @@
+// checking for madvise() in <sys/mman.h>
+
+#include <sys/mman.h> // for madvise(), MADV_WILLNEED
+#include <sys/types.h> // for caddr_t
+
+
+int main (int argc, char *argv[])
+{
+ const caddr_t addr = (caddr_t)argv;
+
+ const int result = madvise (addr, argc, MADV_WILLNEED);
+
+ if (1 < argc) {
+ // invoke with any command line arguments to test
+ return result;
+ }
+
+ // always succeed when invoked without arguments
+ return 0;
+}
Propchange: incubator/stdcxx/trunk/etc/config/src/MADVISE.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/stdcxx/trunk/etc/config/src/MADVISE.cpp
------------------------------------------------------------------------------
svn:keywords = Id