File: stub_tools.cc

package info (click to toggle)
squid3 3.4.8-6
  • links: PTS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 31,084 kB
  • sloc: cpp: 165,325; ansic: 21,998; sh: 12,166; makefile: 5,964; perl: 2,153; sql: 322; awk: 118
file content (68 lines) | stat: -rw-r--r-- 2,239 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "squid.h"
#include "tools.h"

#define STUB_API "tools.cc"
#include "tests/STUB.h"

int DebugSignal = -1;
void releaseServerSockets(void) STUB
char * dead_msg(void) STUB_RETVAL(NULL)
void mail_warranty(void) STUB
void dumpMallocStats(void) STUB
void squid_getrusage(struct rusage *r) STUB
double rusage_cputime(struct rusage *r) STUB_RETVAL(0)
int rusage_maxrss(struct rusage *r) STUB_RETVAL(0)
int rusage_pagefaults(struct rusage *r) STUB_RETVAL(0)
void PrintRusage(void) STUB
void death(int sig) STUB
void BroadcastSignalIfAny(int& sig) STUB
void sigusr2_handle(int sig) STUB
void debug_trap(const char *message) STUB
void sig_child(int sig) STUB
void sig_shutdown(int sig) STUB
const char * getMyHostname(void) STUB_RETVAL(NULL)
const char * uniqueHostname(void) STUB_RETVAL(NULL)
void leave_suid(void) STUB
void enter_suid(void) STUB
void no_suid(void) STUB

bool
IamMasterProcess()
{
    //std::cerr << STUB_API << " IamMasterProcess() Not implemented\n";
    // Since most tests run as a single process, this is the best default.
    // TODO: If some test case uses multiple processes and cares about
    // its role, we may need to parameterize or remove this stub.
    return true;
}

bool
IamWorkerProcess()
{
    //std::cerr << STUB_API << " IamWorkerProcess() Not implemented\n";
    return true;
}

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)

//not yet needed in the Stub, causes dependency on String
//String ProcessRoles() STUB_RETVAL(String())
void writePidFile(void) STUB
pid_t readPidFile(void) STUB_RETVAL(0)
void setMaxFD(void) STUB
void setSystemLimits(void) STUB
void squid_signal(int sig, SIGHDLR * func, int flags) STUB
void logsFlush(void) STUB
void kb_incr(kb_t * k, size_t v) STUB
void debugObj(int section, int level, const char *label, void *obj, ObjPackMethod pm) STUB
void parseEtcHosts(void) STUB
int getMyPort(void) STUB_RETVAL(0)
void setUmask(mode_t mask) STUB
void strwordquote(MemBuf * mb, const char *str) STUB
void keepCapabilities(void) STUB
void restoreCapabilities(int keep) STUB