shm.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#include "squid.h"
10#include "compat/shm.h"
11
12#if _SQUID_FREEBSD_ && (__FreeBSD__ >= 7)
13#include <sys/sysctl.h>
14#endif
15
16/*
17 * Some systems have filesystem-based resources and interpret segment names
18 * as file paths. The so-called 'portable' "/name" format does not work well
19 * for them. And, according to Boost::interprocess, recent FreeBSD versions
20 * make this decision depending on whether the shm_open() caller is jailed!
21 */
22bool
24{
25#if _SQUID_HPUX_ || _SQUID_OSF_ || defined(__vms) || (_SQUID_FREEBSD_ && (__FreeBSD__ < 7)) || _SQUID_DRAGONFLY_
26 return true;
27#elif _SQUID_FREEBSD_
28 int jailed = 0;
29 size_t len = sizeof(jailed);
30 ::sysctlbyname("security.jail.jailed", &jailed, &len, nullptr, 0);
31 return !jailed;
32#else
33 return false;
34#endif
35}
36
bool shm_portable_segment_name_is_path()
Determines whether segment names are iterpreted as full file paths.
Definition: shm.cc:23

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors