Repository: mesos
Updated Branches:
  refs/heads/master 419900da2 -> 5f77cbcb2


Define missing CLONE_ flags for old glibc.

Review: https://reviews.apache.org/r/34619/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/02a8e400
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/02a8e400
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/02a8e400

Branch: refs/heads/master
Commit: 02a8e400e3ee3762954c2d0a29c9dc35a68573e4
Parents: 419900d
Author: Ian Downes <[email protected]>
Authored: Fri May 22 16:27:31 2015 -0700
Committer: Ian Downes <[email protected]>
Committed: Fri May 22 16:43:35 2015 -0700

----------------------------------------------------------------------
 src/linux/ns.hpp | 35 ++++++++++++++++++++++++++++++-----
 1 file changed, 30 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/02a8e400/src/linux/ns.hpp
----------------------------------------------------------------------
diff --git a/src/linux/ns.hpp b/src/linux/ns.hpp
index b695f3a..27cf735 100644
--- a/src/linux/ns.hpp
+++ b/src/linux/ns.hpp
@@ -46,6 +46,30 @@
 #include <process/future.hpp>
 #include <process/reap.hpp>
 
+#ifndef CLONE_NEWNS
+#define CLONE_NEWNS 0x00020000
+#endif
+
+#ifndef CLONE_NEWUTS
+#define CLONE_NEWUTS 0x04000000
+#endif
+
+#ifndef CLONE_NEWIPC
+#define CLONE_NEWIPC 0x08000000
+#endif
+
+#ifndef CLONE_NEWPID
+#define CLONE_NEWPID 0x20000000
+#endif
+
+#ifndef CLONE_NEWNET
+#define CLONE_NEWNET 0x40000000
+#endif
+
+#ifndef CLONE_NEWUSER
+#define CLONE_NEWUSER 0x10000000
+#endif
+
 namespace ns {
 
 // Returns all the supported namespaces by the kernel.
@@ -308,11 +332,12 @@ inline process::Future<Nothing> destroy(ino_t inode)
 inline std::string stringify(int flags)
 {
   hashmap<unsigned int, std::string> names = {
-    {CLONE_NEWIPC, "CLONE_NEWIPC"},
-    {CLONE_NEWNET, "CLONE_NEWNET"},
-    {CLONE_NEWNS,  "CLONE_NEWNS"},
-    {CLONE_NEWPID, "CLONE_NEWPID"},
-    {CLONE_NEWUTS, "CLONE_NEWUTS"}
+    {CLONE_NEWNS,   "CLONE_NEWNS"},
+    {CLONE_NEWUTS,  "CLONE_NEWUTS"},
+    {CLONE_NEWIPC,  "CLONE_NEWIPC"},
+    {CLONE_NEWPID,  "CLONE_NEWPID"},
+    {CLONE_NEWNET,  "CLONE_NEWNET"},
+    {CLONE_NEWUSER, "CLONE_NEWUSER"}
   };
 
   std::vector<std::string> namespaces;

Reply via email to