1 /*******************************************************************************
2 * The BYTE UNIX Benchmarks - Release 3
3 * Module: execl.c SID: 3.3 5/15/91 19:30:19
5 *******************************************************************************
6 * Bug reports, patches, comments, suggestions should be sent to:
8 * Ben Smith, Rick Grehan or Tom Yager
9 * ben@bytepb.byte.com rick_g@bytepb.byte.com tyager@bytepb.byte.com
11 *******************************************************************************
13 * $Header: execl.c,v 3.5 87/06/22 15:37:08 kjmcdonell Beta $
14 * August 28, 1990 - Modified timing routines
15 * October 22, 1997 - code cleanup to remove ANSI C compiler warnings
16 * Andy Kahn <kahn@zk3.dec.com>
18 ******************************************************************************/
23 char SCCSid
[] = "@(#) @(#)execl.c:3.3 -- 5/15/91 19:30:19";
28 #include <sys/types.h>
30 char bss
[8*1024]; /* something worthwhile */
34 #include "big.c" /* some real code */
38 int main(int argc
, char *argv
[]) /* the real program */
40 unsigned long iter
= 0;
44 char count_str
[12], start_str
[24], path_str
[256], *dur_str
;
45 time_t start_time
, this_time
;
49 for(count
= 0; count
< argc
; ++ count
)
50 printf("%s ",argv
[count
]);
55 fprintf(stderr
, "Usage: %s duration\n", argv
[0]);
60 duration
= atoi(argv
[1]);
62 /* the first invocation */
65 if((ptr
= getenv("UB_BINDIR")) != NULL
)
66 sprintf(path_str
,"%s/execl",ptr
);
70 else /* one of those execl'd invocations */
72 /* real duration follow the phoney null duration */
73 duration
= atoi(argv
[2]);
75 iter
= (unsigned long)atoi(argv
[3]); /* where are we now ? */
76 sscanf(argv
[4], "%lu", (unsigned long *) &start_time
);
80 sprintf(count_str
, "%lu", ++iter
); /* increment the execl counter */
81 sprintf(start_str
, "%lu", (unsigned long) start_time
);
83 if (this_time
- start_time
>= duration
) { /* time has run out */
84 fprintf(stderr
, "COUNT|%lu|1|lps\n", iter
);
87 execl(fullpath
, fullpath
, "0", dur_str
, count_str
, start_str
, (void *) 0);
88 fprintf(stderr
, "Exec failed at iteration %lu\n", iter
);