stub_tools.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2022 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// XXX: need src/ to avoid clashes with ip/tools.h in testIpAddress
11#include "src/tools.h"
12
13#define STUB_API "tools.cc"
14#include "tests/STUB.h"
15
16int DebugSignal = -1;
19void dumpMallocStats(void) STUB
20void squid_getrusage(struct rusage *) STUB
21double rusage_cputime(struct rusage *) STUB_RETVAL(0)
24void PrintRusage(void) STUB
25void death(int) STUB
26void BroadcastSignalIfAny(int &) STUB
27void sigusr2_handle(int) STUB
28void debug_trap(const char *) STUB
29void sig_child(int) STUB
30const char * getMyHostname(void) STUB_RETVAL(nullptr)
31const char * uniqueHostname(void) STUB_RETVAL(nullptr)
32void leave_suid(void) STUB_NOP
33void enter_suid(void) STUB
34void no_suid(void) STUB
35
36bool
38{
39 //std::cerr << STUB_API << " IamMasterProcess() Not implemented\n";
40 // Since most tests run as a single process, this is the best default.
41 // TODO: If some test case uses multiple processes and cares about
42 // its role, we may need to parameterize or remove this stub.
43 return true;
44}
45
46bool
48{
49 //std::cerr << STUB_API << " IamWorkerProcess() Not implemented\n";
50 return true;
51}
52
59
60//not actually needed in the Stub, causes dependency on SBuf
61//SBuf ProcessRoles() STUB_RETVAL(SBuf())
62void setMaxFD(void) STUB
63void setSystemLimits(void) STUB
64void squid_signal(int, SIGHDLR *, int) STUB
65void logsFlush(void) STUB
66void debugObj(int, int, const char *, void *, ObjPackMethod) STUB
68int getMyPort(void) STUB_RETVAL(0)
70void strwordquote(MemBuf *, const char *) STUB
72pid_t WaitForOnePid(pid_t, PidStatus &, int) STUB_RETVAL(0)
73
74#if _SQUID_WINDOWS_
75SBuf WindowsErrorMessage(DWORD) STUB_RETVAL(SBuf())
76#endif // _SQUID_WINDOWS_
77
#define false
Definition: GnuRegex.c:240
#define STUB
macro to stub a void function.
Definition: STUB.h:33
#define STUB_NOP
Definition: STUB.h:37
#define STUB_RETVAL(x)
Definition: STUB.h:41
#define STUB_RETVAL_NOP(x)
Definition: STUB.h:45
Definition: MemBuf.h:24
Definition: SBuf.h:94
void sig_child(int sig)
Definition: main.cc:795
bool SIGHDLR int STUB void logsFlush(void) STUB void debugObj(int
bool IamWorkerProcess()
whether the current process handles HTTP transactions and such
Definition: stub_tools.cc:47
bool SIGHDLR int STUB void const char void ObjPackMethod STUB void const char *STUB void keepCapabilities(void) STUB pid_t WaitForOnePid(pid_t
SBuf service_name(APP_SHORTNAME)
void releaseServerSockets(void) STUB_NOP void dumpMallocStats(void) STUB void squid_getrusage(struct rusage *) STUB double rusage_cputime(struct rusage *) STUB_RETVAL(0) int rusage_maxrss(struct rusage *) STUB_RETVAL(0) int rusage_pagefaults(struct rusage *) STUB_RETVAL(0) void PrintRusage(void) STUB void death(int) STUB void BroadcastSignalIfAny(int &) STUB void sigusr2_handle(int) STUB void debug_trap(const char *) STUB void sig_child(int) STUB const char *getMyHostname(void) STUB_RETVAL(nullptr) const char *uniqueHostname(void) STUB_RETVAL(nullptr) void leave_suid(void) STUB_NOP void enter_suid(void) STUB void no_suid(void) STUB bool IamMasterProcess()
Definition: stub_tools.cc:18
bool IamDiskProcess() STUB_RETVAL_NOP(false) bool InDaemonMode() STUB_RETVAL_NOP(false) bool UsingSmp() STUB_RETVAL_NOP(false) bool IamCoordinatorProcess() STUB_RETVAL(false) bool IamPrimaryProcess() STUB_RETVAL(false) int NumberOfKids() STUB_RETVAL(0) void setMaxFD(void) STUB void setSystemLimits(void) STUB void squid_signal(int
whether the current process is dedicated to managing a cache_dir
int DebugSignal
Definition: stub_tools.cc:16
bool SIGHDLR int STUB void int
Definition: stub_tools.cc:66
bool SIGHDLR int STUB void const char void ObjPackMethod STUB void parseEtcHosts(void) STUB int getMyPort(void) STUB_RETVAL(0) void setUmask(mode_t) STUB void strwordquote(MemBuf *
void leave_suid(void)
Definition: tools.cc:556
bool IamMasterProcess()
whether the current process is the parent of all other Squid processes
Definition: tools.cc:665
bool InDaemonMode()
Whether we are running in daemon mode.
Definition: tools.cc:687
void strwordquote(MemBuf *mb, const char *str)
Definition: tools.cc:1077
void squid_signal(int sig, SIGHDLR *func, int flags)
Definition: tools.cc:870
pid_t WaitForOnePid(pid_t pid, PidStatus &status, int flags)
Definition: tools.cc:1177
const char * getMyHostname(void)
Definition: tools.cc:464
void setUmask(mode_t mask)
Definition: tools.cc:1066
void death(int sig)
Definition: tools.cc:342
void sigusr2_handle(int sig)
Definition: tools.cc:430
void setMaxFD(void)
Definition: tools.cc:759
void squid_getrusage(struct rusage *r)
Definition: tools.cc:177
double rusage_cputime(struct rusage *r)
Definition: tools.cc:235
bool IamPrimaryProcess()
Definition: tools.cc:705
void no_suid(void)
Definition: tools.cc:643
int rusage_maxrss(struct rusage *r)
Definition: tools.cc:250
void PrintRusage(void)
Definition: tools.cc:326
int NumberOfKids()
number of Kid processes as defined in src/ipc/Kid.h
Definition: tools.cc:721
void enter_suid(void)
Definition: tools.cc:620
int getMyPort(void)
Definition: tools.cc:1038
void debugObj(int section, int level, const char *label, void *obj, ObjPackMethod pm)
Definition: tools.cc:935
void debug_trap(const char *message)
Definition: tools.cc:455
int rusage_pagefaults(struct rusage *r)
Definition: tools.cc:271
void BroadcastSignalIfAny(int &sig)
Definition: tools.cc:415
bool IamCoordinatorProcess()
whether the current process coordinates worker processes
Definition: tools.cc:699
const char * uniqueHostname(void)
Definition: tools.cc:544
void dumpMallocStats(void)
Definition: tools.cc:163
bool UsingSmp()
Whether there should be more than one worker process running.
Definition: tools.cc:693
void setSystemLimits(void)
Definition: tools.cc:808
void SIGHDLR(int sig)
callback type for signal handlers
Definition: tools.h:39
int PidStatus
Definition: tools.h:91
void(* ObjPackMethod)(void *obj, Packable *p)
Definition: tools.h:33
unsigned short mode_t
Definition: types.h:150
#define APP_SHORTNAME
Definition: version.h:22

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors