4 * $DragonFly: src/test/sysperf/exec1.c,v 1.2 2004/04/14 17:59:45 dillon Exp $
8 #include <sys/resource.h>
21 if ((elm = strrchr(Av0, '/')) == NULL)
26 if ((pid = vfork()) == 0) {
27 setpriority(PRIO_PROCESS, getpid(), -20);
28 execl(Av0, elm, "dummy", NULL);
36 while(waitpid(pid, &status, 0) != pid)
38 if (WEXITSTATUS(status)) {
39 fprintf(stderr, "execl in child failed\n");
46 main(int ac, char **av)
57 while (stop_timing(0, NULL) == 0) {
58 for (i = 0; i < 100; ++i)
62 count *= 5; /* 5 second run */
64 for (i = 0; i < count; ++i)
67 stop_timing(count, "execl static program:", count);
69 stop_timing(count, "execl dynamic program:", count);