]>
Commit | Line | Data |
---|---|---|
ef8de464 AR |
1 | #include "config.h" |
2 | #include "compat/shm.h" | |
3 | ||
8a09e810 AJ |
4 | #if _SQUID_FREEBSD_ && (__FreeBSD__ >= 7) |
5 | #include <sys/sysctl.h> | |
ef8de464 AR |
6 | #endif |
7 | ||
8 | ||
9 | /* | |
10 | * Some systems have filesystem-based resources and interpret segment names | |
126efcbb | 11 | * as file paths. The so-called 'portable' "/name" format does not work well |
ef8de464 AR |
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 | { | |
8a09e810 | 18 | #if _SQUID_HPUX_ || _SQUID_OSF_ || defined(__vms) || (_SQUID_FREEBSD_ && (__FreeBSD__ < 7)) |
126efcbb | 19 | return true; |
8a09e810 | 20 | #elif _SQUID_FREEBSD_ |
126efcbb A |
21 | int jailed = 0; |
22 | size_t len = sizeof(jailed); | |
23 | ::sysctlbyname("security.jail.jailed", &jailed, &len, NULL, 0); | |
24 | return !jailed; | |
ef8de464 AR |
25 | #else |
26 | return false; | |
27 | #endif | |
28 | } |