]>
Commit | Line | Data |
---|---|---|
4e0938ef | 1 | /* |
4ac4a490 | 2 | * Copyright (C) 1996-2017 The Squid Software Foundation and contributors |
4e0938ef AJ |
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 | ||
f7f3304a | 9 | #include "squid.h" |
8b505ba9 AJ |
10 | // XXX: need src/ to avoid clashes with ip/tools.h in testIpAddress |
11 | #include "src/tools.h" | |
c8f4eac4 | 12 | |
081edc2d AJ |
13 | #define STUB_API "tools.cc" |
14 | #include "tests/STUB.h" | |
c8f4eac4 | 15 | |
081edc2d | 16 | int DebugSignal = -1; |
8b505ba9 | 17 | SBuf service_name(APP_SHORTNAME); |
e852298f | 18 | void releaseServerSockets(void) STUB_NOP |
081edc2d AJ |
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 *r) STUB | |
23 | double rusage_cputime(struct rusage *r) STUB_RETVAL(0) | |
24 | int rusage_maxrss(struct rusage *r) STUB_RETVAL(0) | |
25 | int rusage_pagefaults(struct rusage *r) STUB_RETVAL(0) | |
26 | void PrintRusage(void) STUB | |
27 | void death(int sig) STUB | |
28 | void BroadcastSignalIfAny(int& sig) STUB | |
29 | void sigusr2_handle(int sig) STUB | |
081edc2d AJ |
30 | void debug_trap(const char *message) STUB |
31 | void sig_child(int sig) STUB | |
081edc2d AJ |
32 | const char * getMyHostname(void) STUB_RETVAL(NULL) |
33 | const char * uniqueHostname(void) STUB_RETVAL(NULL) | |
e852298f | 34 | void leave_suid(void) STUB_NOP |
081edc2d AJ |
35 | void enter_suid(void) STUB |
36 | void no_suid(void) STUB | |
8822ebee | 37 | |
081edc2d AJ |
38 | bool |
39 | IamMasterProcess() | |
8822ebee | 40 | { |
081edc2d AJ |
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; | |
8822ebee | 46 | } |
d5d5493b DK |
47 | |
48 | bool | |
49 | IamWorkerProcess() | |
50 | { | |
081edc2d | 51 | //std::cerr << STUB_API << " IamWorkerProcess() Not implemented\n"; |
d5d5493b DK |
52 | return true; |
53 | } | |
54 | ||
bd765fdc FC |
55 | bool IamDiskProcess() STUB_RETVAL_NOP(false) |
56 | bool InDaemonMode() STUB_RETVAL_NOP(false) | |
57 | bool UsingSmp() STUB_RETVAL_NOP(false) | |
081edc2d AJ |
58 | bool IamCoordinatorProcess() STUB_RETVAL(false) |
59 | bool IamPrimaryProcess() STUB_RETVAL(false) | |
60 | int NumberOfKids() STUB_RETVAL(0) | |
bd765fdc | 61 | |
1fdc4f42 AJ |
62 | //not actually needed in the Stub, causes dependency on SBuf |
63 | //SBuf ProcessRoles() STUB_RETVAL(SBuf()) | |
081edc2d | 64 | void writePidFile(void) STUB |
dbf55289 | 65 | void removePidFile(void) STUB |
081edc2d AJ |
66 | pid_t readPidFile(void) STUB_RETVAL(0) |
67 | void setMaxFD(void) STUB | |
68 | void setSystemLimits(void) STUB | |
69 | void squid_signal(int sig, SIGHDLR * func, int flags) STUB | |
70 | void logsFlush(void) STUB | |
081edc2d AJ |
71 | void debugObj(int section, int level, const char *label, void *obj, ObjPackMethod pm) STUB |
72 | void parseEtcHosts(void) STUB | |
73 | int getMyPort(void) STUB_RETVAL(0) | |
74 | void setUmask(mode_t mask) STUB | |
75 | void strwordquote(MemBuf * mb, const char *str) STUB | |
76 | void keepCapabilities(void) STUB | |
ff2afd7f | 77 | void restoreCapabilities(bool keep) STUB |
dbf55289 | 78 | pid_t WaitForOnePid(pid_t pid, PidStatus &status, int flags) STUB_RETVAL(0) |
f53969cc | 79 |