1 |
< |
/* Copyright (c) 1992 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1993 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
141 |
|
struct tms tbuf; |
142 |
|
struct utsname nambuf; |
143 |
|
double period; |
144 |
< |
#define hostname nambuf.sysname |
144 |
> |
#define hostname nambuf.nodename |
145 |
|
#endif |
146 |
|
|
147 |
|
tlastrept = time((time_t *)NULL); |
155 |
|
gethostname(hostname, sizeof(hostname)); |
156 |
|
#else |
157 |
|
times(&tbuf); |
158 |
+ |
#ifdef _SC_CLK_TCK |
159 |
|
period = 1.0 / sysconf(_SC_CLK_TCK); |
160 |
+ |
#else |
161 |
+ |
period = 1.0 / 60.0; |
162 |
+ |
#endif |
163 |
|
u = ( tbuf.tms_utime + tbuf.tms_cutime ) * period; |
164 |
|
s = ( tbuf.tms_stime + tbuf.tms_cstime ) * period; |
165 |
|
uname(&nambuf); |
170 |
|
nrays, pctdone, u/3600., s/3600., |
171 |
|
(tlastrept-tstart)/3600., hostname); |
172 |
|
eputs(errmsg); |
173 |
+ |
#ifndef BSD |
174 |
+ |
signal(SIGCONT, report); |
175 |
|
#undef hostname |
176 |
+ |
#endif |
177 |
|
} |
178 |
|
#else |
179 |
|
report() /* report progress */ |
182 |
|
sprintf(errmsg, "%lu rays, %4.2f%% after %5.4f hours\n", |
183 |
|
nrays, pctdone, (tlastrept-tstart)/3600.0); |
184 |
|
eputs(errmsg); |
178 |
– |
signal(SIGCONT, report); |
185 |
|
} |
186 |
|
#endif |
187 |
|
|