84 |
|
struct timeval SystemTime; |
85 |
|
struct Client me; /* That's me */ |
86 |
|
struct LocalUser meLocalUser; /* That's also part of me */ |
87 |
– |
unsigned long connect_id = 0; /* unique connect ID */ |
87 |
|
|
88 |
|
static unsigned long initialVMTop = 0; /* top of virtual memory at init */ |
89 |
|
const char *logFileName = LPATH; |
122 |
|
|
123 |
|
int rehashed_klines = 0; |
124 |
|
|
126 |
– |
/* |
127 |
– |
* get_vm_top - get the operating systems notion of the resident set size |
128 |
– |
*/ |
129 |
– |
#ifndef _WIN32 |
130 |
– |
static unsigned long |
131 |
– |
get_vm_top(void) |
132 |
– |
{ |
133 |
– |
/* |
134 |
– |
* NOTE: sbrk is not part of the ANSI C library or the POSIX.1 standard |
135 |
– |
* however it seems that everyone defines it. Calling sbrk with a 0 |
136 |
– |
* argument will return a pointer to the top of the process virtual |
137 |
– |
* memory without changing the process size, so this call should be |
138 |
– |
* reasonably safe (sbrk returns the new value for the top of memory). |
139 |
– |
* This code relies on the notion that the address returned will be an |
140 |
– |
* offset from 0 (NULL), so the result of sbrk is cast to a size_t and |
141 |
– |
* returned. We really shouldn't be using it here but... |
142 |
– |
*/ |
143 |
– |
|
144 |
– |
void *vptr = sbrk(0); |
145 |
– |
return((unsigned long)vptr); |
146 |
– |
} |
125 |
|
|
126 |
|
/* |
127 |
|
* print_startup - print startup information |
155 |
|
} |
156 |
|
#endif |
157 |
|
|
180 |
– |
/* |
181 |
– |
* get_maxrss - get the operating systems notion of the resident set size |
182 |
– |
*/ |
183 |
– |
unsigned long |
184 |
– |
get_maxrss(void) |
185 |
– |
{ |
186 |
– |
#ifdef _WIN32 |
187 |
– |
return (0); /* FIXME */ |
188 |
– |
#else |
189 |
– |
return (get_vm_top() - initialVMTop); |
190 |
– |
#endif |
191 |
– |
} |
192 |
– |
|
158 |
|
static int printVersion = 0; |
159 |
|
|
160 |
|
struct lgetopt myopts[] = { |
517 |
|
|
518 |
|
/* Setup corefile size immediately after boot -kre */ |
519 |
|
setup_corefile(); |
555 |
– |
|
556 |
– |
/* set initialVMTop before we allocate any memory */ |
557 |
– |
initialVMTop = get_vm_top(); |
520 |
|
#endif |
521 |
|
|
522 |
|
/* save server boot time right away, so getrusage works correctly */ |