|
Lines 125-130
Link Here
|
| 125 |
|
125 |
|
| 126 |
static void boot __P((int)) __dead2; |
126 |
static void boot __P((int)) __dead2; |
| 127 |
static void dumpsys __P((void)); |
127 |
static void dumpsys __P((void)); |
|
|
128 |
static void print_uptime __P((void)); |
| 128 |
|
129 |
|
| 129 |
#ifndef _SYS_SYSPROTO_H_ |
130 |
#ifndef _SYS_SYSPROTO_H_ |
| 130 |
struct reboot_args { |
131 |
struct reboot_args { |
|
Lines 168-173
Link Here
|
| 168 |
static int waittime = -1; |
169 |
static int waittime = -1; |
| 169 |
static struct pcb dumppcb; |
170 |
static struct pcb dumppcb; |
| 170 |
|
171 |
|
|
|
172 |
static void |
| 173 |
print_uptime() |
| 174 |
{ |
| 175 |
int f; |
| 176 |
struct timespec ts; |
| 177 |
|
| 178 |
getnanouptime(&ts); |
| 179 |
printf("Uptime: "); |
| 180 |
f = 0; |
| 181 |
if (ts.tv_sec >= 86400) { |
| 182 |
printf("%ldd", ts.tv_sec / 86400); |
| 183 |
ts.tv_sec %= 86400; |
| 184 |
f = 1; |
| 185 |
} |
| 186 |
if (f || ts.tv_sec >= 3600) { |
| 187 |
printf("%ldh", ts.tv_sec / 3600); |
| 188 |
ts.tv_sec %= 3600; |
| 189 |
f = 1; |
| 190 |
} |
| 191 |
if (f || ts.tv_sec >= 60) { |
| 192 |
printf("%ldm", ts.tv_sec / 60); |
| 193 |
ts.tv_sec %= 60; |
| 194 |
f = 1; |
| 195 |
} |
| 196 |
printf("%lds\n", ts.tv_sec); |
| 197 |
} |
| 198 |
|
| 171 |
/* |
199 |
/* |
| 172 |
* Go through the rigmarole of shutting down.. |
200 |
* Go through the rigmarole of shutting down.. |
| 173 |
* this used to be in machdep.c but I'll be dammned if I could see |
201 |
* this used to be in machdep.c but I'll be dammned if I could see |
|
Lines 271-276
Link Here
|
| 271 |
} |
299 |
} |
| 272 |
DELAY(100000); /* wait for console output to finish */ |
300 |
DELAY(100000); /* wait for console output to finish */ |
| 273 |
} |
301 |
} |
|
|
302 |
|
| 303 |
print_uptime(); |
| 274 |
|
304 |
|
| 275 |
/* |
305 |
/* |
| 276 |
* Ok, now do things that assume all filesystem activity has |
306 |
* Ok, now do things that assume all filesystem activity has |