stub_tools.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2021 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 
16 int DebugSignal = -1;
19 void dumpMallocStats(void) STUB
20 void squid_getrusage(struct rusage *) STUB
21 double rusage_cputime(struct rusage *) STUB_RETVAL(0)
23 int rusage_pagefaults(struct rusage *) STUB_RETVAL(0)
24 void PrintRusage(void) STUB
25 void death(int) STUB
26 void BroadcastSignalIfAny(int &) STUB
27 void sigusr2_handle(int) STUB
28 void debug_trap(const char *) STUB
29 void sig_child(int) STUB
30 const char * getMyHostname(void) STUB_RETVAL(NULL)
31 const char * uniqueHostname(void) STUB_RETVAL(NULL)
32 void leave_suid(void) STUB_NOP
33 void enter_suid(void) STUB
34 void no_suid(void) STUB
35 
36 bool
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 
46 bool
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())
62 void setMaxFD(void) STUB
63 void setSystemLimits(void) STUB
64 void squid_signal(int, SIGHDLR *, int) STUB
65 void logsFlush(void) STUB
66 void debugObj(int, int, const char *, void *, ObjPackMethod) STUB
67 void parseEtcHosts(void) STUB
68 int getMyPort(void) STUB_RETVAL(0)
69 void setUmask(mode_t) STUB
70 void strwordquote(MemBuf *, const char *) STUB
72 pid_t WaitForOnePid(pid_t, PidStatus &, int) STUB_RETVAL(0)
73 
74 #if _SQUID_WINDOWS_
75 SBuf WindowsErrorMessage(DWORD) STUB_RETVAL(SBuf())
76 #endif // _SQUID_WINDOWS_
77 
void SIGHDLR(int sig)
callback type for signal handlers
Definition: tools.h:39
int getMyPort(void)
Definition: tools.cc:1008
void dumpMallocStats(void)
Definition: tools.cc:158
const char * uniqueHostname(void)
Definition: tools.cc:494
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(NULL) const char *uniqueHostname(void) STUB_RETVAL(NULL) void leave_suid(void) STUB_NOP void enter_suid(void) STUB void no_suid(void) STUB bool IamMasterProcess()
Definition: stub_tools.cc:18
#define STUB_RETVAL(x)
Definition: STUB.h:41
Definition: SBuf.h:87
void death(int sig)
Definition: tools.cc:293
SBuf service_name(APP_SHORTNAME)
bool SIGHDLR int STUB void int
Definition: stub_tools.cc:66
bool IamWorkerProcess()
whether the current process handles HTTP transactions and such
Definition: stub_tools.cc:47
#define APP_SHORTNAME
Definition: version.h:22
int DebugSignal
Definition: stub_tools.cc:16
void leave_suid(void)
Definition: tools.cc:506
void(* ObjPackMethod)(void *obj, Packable *p)
Definition: tools.h:33
void sigusr2_handle(int sig)
Definition: tools.cc:380
#define NULL
Definition: types.h:166
void PrintRusage(void)
Definition: tools.cc:277
int rusage_pagefaults(struct rusage *r)
Definition: tools.cc:266
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
pid_t WaitForOnePid(pid_t pid, PidStatus &status, int flags)
Definition: tools.cc:1147
Definition: MemBuf.h:24
void squid_signal(int sig, SIGHDLR *func, int flags)
Definition: tools.cc:840
#define STUB_RETVAL_NOP(x)
Definition: STUB.h:45
bool SIGHDLR int STUB void const char void ObjPackMethod STUB void const char *STUB void keepCapabilities(void) STUB pid_t WaitForOnePid(pid_t
bool SIGHDLR int STUB void logsFlush(void) STUB void debugObj(int
void debug_trap(const char *message)
Definition: tools.cc:405
void squid_getrusage(struct rusage *r)
Definition: tools.cc:172
#define STUB
macro to stub a void function.
Definition: STUB.h:33
bool IamMasterProcess()
whether the current process is the parent of all other Squid processes
Definition: tools.cc:635
void strwordquote(MemBuf *mb, const char *str)
Definition: tools.cc:1047
void BroadcastSignalIfAny(int &sig)
Definition: tools.cc:365
int rusage_maxrss(struct rusage *r)
Definition: tools.cc:245
double rusage_cputime(struct rusage *r)
Definition: tools.cc:230
void setUmask(mode_t mask)
Definition: tools.cc:1036
int PidStatus
Definition: tools.h:94
#define STUB_NOP
Definition: STUB.h:37
bool IamCoordinatorProcess()
whether the current process coordinates worker processes
Definition: tools.cc:669
const char * getMyHostname(void)
Definition: tools.cc:414
unsigned short mode_t
Definition: types.h:150
void enter_suid(void)
Definition: tools.cc:577
void setSystemLimits(void)
Definition: tools.cc:778
void setMaxFD(void)
Definition: tools.cc:729
void no_suid(void)
Definition: tools.cc:606
void debugObj(int section, int level, const char *label, void *obj, ObjPackMethod pm)
Definition: tools.cc:905
bool UsingSmp()
Whether there should be more than one worker process running.
Definition: tools.cc:663
int NumberOfKids()
number of Kid processes as defined in src/ipc/Kid.h
Definition: tools.cc:691
#define false
Definition: GnuRegex.c:233
void sig_child(int sig)
Definition: main.cc:791
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 *
bool IamPrimaryProcess()
Definition: tools.cc:675
bool InDaemonMode()
Whether we are running in daemon mode.
Definition: tools.cc:657

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors