stub_tools.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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 char * dead_msg(void) STUB_RETVAL(NULL)
20 void mail_warranty(void) STUB
21 void dumpMallocStats(void) STUB
22 void squid_getrusage(struct rusage *) STUB
23 double rusage_cputime(struct rusage *) STUB_RETVAL(0)
24 int rusage_maxrss(struct rusage *) STUB_RETVAL(0)
25 int rusage_pagefaults(struct rusage *) STUB_RETVAL(0)
26 void PrintRusage(void) STUB
27 void death(int) STUB
28 void BroadcastSignalIfAny(int &) STUB
29 void sigusr2_handle(int) STUB
30 void debug_trap(const char *) STUB
31 void sig_child(int) STUB
32 const char * getMyHostname(void) STUB_RETVAL(NULL)
33 const char * uniqueHostname(void) STUB_RETVAL(NULL)
34 void leave_suid(void) STUB_NOP
35 void enter_suid(void) STUB
36 void no_suid(void) STUB
37 
38 bool
40 {
41  //std::cerr << STUB_API << " IamMasterProcess() Not implemented\n";
42  // Since most tests run as a single process, this is the best default.
43  // TODO: If some test case uses multiple processes and cares about
44  // its role, we may need to parameterize or remove this stub.
45  return true;
46 }
47 
48 bool
50 {
51  //std::cerr << STUB_API << " IamWorkerProcess() Not implemented\n";
52  return true;
53 }
54 
61 
62 //not actually needed in the Stub, causes dependency on SBuf
63 //SBuf ProcessRoles() STUB_RETVAL(SBuf())
64 void setMaxFD(void) STUB
65 void setSystemLimits(void) STUB
66 void squid_signal(int, SIGHDLR *, int) STUB
67 void logsFlush(void) STUB
68 void debugObj(int, int, const char *, void *, ObjPackMethod) STUB
69 void parseEtcHosts(void) STUB
70 int getMyPort(void) STUB_RETVAL(0)
71 void setUmask(mode_t) STUB
72 void strwordquote(MemBuf *, const char *) STUB
73 void keepCapabilities(void) STUB
74 void restoreCapabilities(bool) STUB
75 pid_t WaitForOnePid(pid_t, PidStatus &, int) STUB_RETVAL(0)
76 
77 #if _SQUID_WINDOWS_
78 SBuf WindowsErrorMessage(DWORD) STUB_RETVAL(SBuf())
79 #endif // _SQUID_WINDOWS_
80 
double rusage_cputime(struct rusage *r)
Definition: tools.cc:228
pid_t WaitForOnePid(pid_t pid, PidStatus &status, int flags)
Definition: tools.cc:1135
void BroadcastSignalIfAny(int &sig)
Definition: tools.cc:363
void squid_signal(int sig, SIGHDLR *func, int flags)
Definition: tools.cc:835
Definition: SBuf.h:87
static void mail_warranty(void)
Definition: tools.cc:105
static void restoreCapabilities(bool keep)
Definition: tools.cc:1095
void sig_child(int sig)
Definition: main.cc:786
int rusage_maxrss(struct rusage *r)
Definition: tools.cc:243
bool SIGHDLR int STUB void const char void ObjPackMethod STUB void const char *STUB void keepCapabilities(void) STUB void restoreCapabilities(bool) STUB pid_t WaitForOnePid(pid_t
const char * getMyHostname(void)
Definition: tools.cc:412
bool IamMasterProcess()
whether the current process is the parent of all other Squid processes
Definition: tools.cc:630
bool IamCoordinatorProcess()
whether the current process coordinates worker processes
Definition: tools.cc:664
bool IamWorkerProcess()
whether the current process handles HTTP transactions and such
Definition: stub_tools.cc:49
void releaseServerSockets(void) STUB_NOP char *dead_msg(void) STUB_RETVAL(NULL) void mail_warranty(void) STUB 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
bool IamPrimaryProcess()
Definition: tools.cc:670
static char * dead_msg(void)
Definition: tools.cc:97
void dumpMallocStats(void)
Definition: tools.cc:156
#define STUB_RETVAL(x)
Definition: STUB.h:41
int getMyPort(void)
Definition: tools.cc:1003
#define STUB_RETVAL_NOP(x)
Definition: STUB.h:45
void setUmask(mode_t mask)
Definition: tools.cc:1031
#define STUB
macro to stub a void function.
Definition: STUB.h:33
void leave_suid(void)
Definition: tools.cc:504
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 PrintRusage(void)
Definition: tools.cc:275
void death(int sig)
Definition: tools.cc:291
void setSystemLimits(void)
Definition: tools.cc:773
int NumberOfKids()
number of Kid processes as defined in src/ipc/Kid.h
Definition: tools.cc:686
bool UsingSmp()
Whether there should be more than one worker process running.
Definition: tools.cc:658
unsigned short mode_t
Definition: types.h:150
typedef DWORD
Definition: WinSvc.cc:73
bool InDaemonMode()
Whether we are running in daemon mode.
Definition: tools.cc:652
bool SIGHDLR int STUB void logsFlush(void) STUB void debugObj(int
void squid_getrusage(struct rusage *r)
Definition: tools.cc:170
void enter_suid(void)
Definition: tools.cc:575
void(* ObjPackMethod)(void *obj, Packable *p)
Definition: tools.h:33
int DebugSignal
Definition: stub_tools.cc:16
#define STUB_NOP
Definition: STUB.h:37
SBuf service_name(APP_SHORTNAME)
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
void debug_trap(const char *message)
Definition: tools.cc:403
void setMaxFD(void)
Definition: tools.cc:724
int rusage_pagefaults(struct rusage *r)
Definition: tools.cc:264
#define NULL
Definition: types.h:166
#define APP_SHORTNAME
Definition: version.h:19
void no_suid(void)
Definition: tools.cc:601
void sigusr2_handle(int sig)
Definition: tools.cc:378
void debugObj(int section, int level, const char *label, void *obj, ObjPackMethod pm)
Definition: tools.cc:900
#define false
Definition: GnuRegex.c:233
const char * uniqueHostname(void)
Definition: tools.cc:492
void strwordquote(MemBuf *mb, const char *str)
Definition: tools.cc:1042

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors