diff -ru Ice-3.5.0.orig/cpp/test/include/TestCommon.h Ice-3.5.0/cpp/test/include/TestCommon.h
--- Ice-3.5.0.orig/cpp/test/include/TestCommon.h	2013-03-11 08:19:47.000000000 -0700
+++ Ice-3.5.0/cpp/test/include/TestCommon.h	2013-03-11 22:35:25.353825217 -0700
@@ -25,6 +25,22 @@
     std::cout << msg << std::flush;
 }
 
+#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 println(const std::string& msg)
 {
