]> git.ipfire.org Git - thirdparty/squid.git/blame - src/Instance.h
Maintenance: automate header guards 2/3 (#1655)
[thirdparty/squid.git] / src / Instance.h
CommitLineData
e99fa721 1/*
b8ae064d 2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
e99fa721
EB
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
ff9d9458
FC
9#ifndef SQUID_SRC_INSTANCE_H
10#define SQUID_SRC_INSTANCE_H
e99fa721
EB
11
12#if HAVE_SYS_TYPES_H
13#include <sys/types.h>
14#endif
15
16/// code related to Squid Instance and PID file management
17namespace Instance {
18
19/// Usually throws if another Squid instance is running. False positives are
20/// highly unlikely, but the caller must tolerate false negatives well:
21/// We may not detect another running instance and, hence, may not throw.
22/// Does nothing if PID file maintenance is disabled.
23void ThrowIfAlreadyRunning();
24
25/// Creates or updates the PID file for the current process.
26/// Does nothing if PID file maintenance is disabled.
27void WriteOurPid();
28
29/// \returns another Squid instance PID
30/// Throws if PID file maintenance is disabled.
31pid_t Other();
32
33} // namespace Instance
34
ff9d9458 35#endif /* SQUID_SRC_INSTANCE_H */
e99fa721 36