summaryrefslogtreecommitdiff
path: root/devel/ice/files/patch-cpp-test-include-TestCommon.h
blob: 02f40971feafed52995290b8b4177d234e60a92c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- cpp/test/include/TestCommon.h.orig	2019-08-12 19:54:18 UTC
+++ cpp/test/include/TestCommon.h
@@ -18,6 +18,22 @@
 #   include <Ice/LocalException.h>
 #endif
 
+#if defined(__FreeBSD__)
+#  include <sys/types.h>
+#  include <sys/sysctl.h>
+inline bool inFreeBSDJail()
+{
+    int jailed;
+    size_t size = sizeof(jailed);
+    return (sysctlbyname("security.jail.jailed", &jailed, &size, NULL, 0) != -1 || jailed);
+}
+#else
+inline bool inFreeBSDJail()
+{
+    return false;
+}
+#endif
+
 void
 inline print(const std::string& msg)
 {