Squid Web Cache master
Loading...
Searching...
No Matches
stub_Instance.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2026 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 "Instance.h"
11#include "sbuf/Stream.h"
12
13#define STUB_API "Instance.cc"
14#include "tests/STUB.h"
15
17void Instance::WriteOurPid() STUB
18pid_t Instance::Other() STUB_RETVAL({})
19
20// Return what Instance.cc NamePrefix() would return using default service_name
21// and no pid_filename hash value. XXX: Mimicking pid_filename hashing triggers
22// ENAMETOOLONG errors on MacOS due to 31-character PSHMNAMLEN limit. We want to
23// use "squid-0000" here, but even `/squid-0-tr_rebuild_versions.shm` is one
24// character too long! The same limit also affects some Instance.cc NamePrefix()
25// callers -- Squid SMP caching support on MacOS is incomplete.
26SBuf Instance::NamePrefix(const char * const head, const char * const tail) STUB_RETVAL_NOP(ToSBuf(head, "squid", (tail ? tail : "")))
#define STUB
macro to stub a void function.
Definition STUB.h:34
#define STUB_RETVAL(x)
Definition STUB.h:42
#define STUB_RETVAL_NOP(x)
Definition STUB.h:46
squidaio_request_t * head
Definition aiops.cc:129
Definition SBuf.h:94
code related to Squid Instance and PID file management
Definition Instance.h:19
void ThrowIfAlreadyRunning()
Definition Instance.cc:140
SBuf NamePrefix(const char *head, const char *tail=nullptr)
Definition Instance.cc:253
SBuf ToSBuf(Args &&... args)
slowly stream-prints all arguments into a freshly allocated SBuf
Definition Stream.h:63