]> git.ipfire.org Git - thirdparty/squid.git/blob - compat/shm.cc
Renamed squid.h to squid-old.h and config.h to squid.h
[thirdparty/squid.git] / compat / shm.cc
1 #include "squid.h"
2 #include "compat/shm.h"
3
4 #if _SQUID_FREEBSD_ && (__FreeBSD__ >= 7)
5 #include <sys/sysctl.h>
6 #endif
7
8
9 /*
10 * Some systems have filesystem-based resources and interpret segment names
11 * as file paths. The so-called 'portable' "/name" format does not work well
12 * for them. And, according to Boost::interprocess, recent FreeBSD versions
13 * make this decision depending on whether the shm_open() caller is jailed!
14 */
15 bool
16 shm_portable_segment_name_is_path()
17 {
18 #if _SQUID_HPUX_ || _SQUID_OSF_ || defined(__vms) || (_SQUID_FREEBSD_ && (__FreeBSD__ < 7))
19 return true;
20 #elif _SQUID_FREEBSD_
21 int jailed = 0;
22 size_t len = sizeof(jailed);
23 ::sysctlbyname("security.jail.jailed", &jailed, &len, NULL, 0);
24 return !jailed;
25 #else
26 return false;
27 #endif
28 }