Do an explicit test for XSI strerror_r
[folly.git] / folly / MemoryMapping.h
index fa8d51a58cee95a5c1e90618fca607e1fde3d21a..280a261fd6407c14d596dd419f57310e5951f694 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2015 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,9 +17,9 @@
 #ifndef FOLLY_MEMORYMAPPING_H_
 #define FOLLY_MEMORYMAPPING_H_
 
-#include "folly/FBString.h"
-#include "folly/File.h"
-#include "folly/Range.h"
+#include <folly/FBString.h>
+#include <folly/File.h>
+#include <folly/Range.h>
 #include <glog/logging.h>
 #include <boost/noncopyable.hpp>
 
@@ -53,7 +53,7 @@ class MemoryMapping : boost::noncopyable {
    * likely become inaccessible) when the MemoryMapping object is destroyed.
    */
   struct Options {
-    Options() { }
+    Options() {}
 
     // Convenience methods; return *this for chaining.
     Options& setPageSize(off_t v) { pageSize = v; return *this; }
@@ -127,13 +127,13 @@ class MemoryMapping : boost::noncopyable {
                          off_t length=-1,
                          Options options=Options());
 
-  MemoryMapping(MemoryMapping&&);
+  MemoryMapping(MemoryMapping&&) noexcept;
 
   ~MemoryMapping();
 
   MemoryMapping& operator=(MemoryMapping);
 
-  void swap(MemoryMapping& other);
+  void swap(MemoryMapping& other) noexcept;
 
   /**
    * Lock the pages in memory
@@ -157,6 +157,7 @@ class MemoryMapping : boost::noncopyable {
    * Advise the kernel about memory access.
    */
   void advise(int advice) const;
+  void advise(int advice, size_t offset, size_t length) const;
 
   /**
    * A bitwise cast of the mapped bytes as range of values. Only intended for
@@ -229,7 +230,7 @@ class MemoryMapping : boost::noncopyable {
   MutableByteRange data_;
 };
 
-void swap(MemoryMapping&, MemoryMapping&);
+void swap(MemoryMapping&, MemoryMapping&) noexcept;
 
 /**
  * A special case of memcpy() that always copies memory forwards.