version 1.2, 1996/06/26 05:40:39 |
version 1.3, 1996/10/12 20:36:06 |
|
|
/* parent */ |
/* parent */ |
(void)signal(SIGINT, SIG_IGN); |
(void)signal(SIGINT, SIG_IGN); |
(void)signal(SIGQUIT, SIG_IGN); |
(void)signal(SIGQUIT, SIG_IGN); |
while (wait3(&status, 0, &ru) != pid); |
while (wait3(&status, 0, &ru) != pid) |
|
; |
gettimeofday(&after, (struct timezone *)NULL); |
gettimeofday(&after, (struct timezone *)NULL); |
if (!WIFEXITED(status)) |
if (!WIFEXITED(status)) |
fprintf(stderr, "Command terminated abnormally.\n"); |
fprintf(stderr, "Command terminated abnormally.\n"); |
timersub(&after, &before, &after); |
timersub(&after, &before, &after); |
|
|
if (portableflag) { |
if (portableflag) { |
fprintf (stderr, "real %9ld.%02ld\n", |
fprintf(stderr, "real %9ld.%02ld\n", |
after.tv_sec, after.tv_usec/10000); |
after.tv_sec, after.tv_usec/10000); |
fprintf (stderr, "user %9ld.%02ld\n", |
fprintf(stderr, "user %9ld.%02ld\n", |
ru.ru_utime.tv_sec, ru.ru_utime.tv_usec/10000); |
ru.ru_utime.tv_sec, ru.ru_utime.tv_usec/10000); |
fprintf (stderr, "sys %9ld.%02ld\n", |
fprintf(stderr, "sys %9ld.%02ld\n", |
ru.ru_stime.tv_sec, ru.ru_stime.tv_usec/10000); |
ru.ru_stime.tv_sec, ru.ru_stime.tv_usec/10000); |
} else { |
} else { |
|
|
|
|
ru.ru_nivcsw, "involuntary context switches"); |
ru.ru_nivcsw, "involuntary context switches"); |
} |
} |
|
|
exit (WEXITSTATUS(status)); |
exit(WIFEXITED(status) ? WEXITSTATUS(status) : EXIT_FAILURE); |
} |
} |