Lines Matching +full:- +full:- +full:exit +full:- +full:status
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
35 /* By default, just print warning for non-critical errors. */
38 /* By default, retry on non-critical errors every 50ms. */
53 /* Implemention of runtime-selectable severity message printing. */
69 if (++i == argc || ((arg = argv[i])[0] == '-' && \
73 exit (1); \
77 int usage(int status);
78 int version(int status);
111 if ((starttime = time(NULL)) == -1) { in main()
113 exit(1); in main()
123 if (strcmp(arg, "--help") == 0 || strcmp(arg, "-?") == 0) { in main()
125 } else if (strcmp(arg, "--version") == 0) { in main()
127 } else if (strcmp(arg, "--verbose") == 0 in main()
128 || strcmp(arg, "-v") == 0) { in main()
130 } else if (strcmp(arg, "--quiet") == 0 in main()
131 || strcmp(arg, "-q") == 0) { in main()
133 } else if (strcmp(arg, "--dry-run") == 0 in main()
134 || strcmp(arg, "-n") == 0) { in main()
136 } else if (strcmp(arg, "--no-retry") == 0) { in main()
139 "turning off ignore of non-critical errors"); in main()
140 } else if (strcmp(arg, "--retry-delay") == 0) { in main()
141 assert_arg("--retry-delay"); in main()
145 } else if (strcmp(arg, "--backoff") == 0) { in main()
146 assert_arg("--backoff"); in main()
151 exit(1); in main()
155 } else if (strcmp(arg, "--timeout") == 0 in main()
156 || strcmp(arg, "-t") == 0) { in main()
158 assert_arg("--timeout"); in main()
161 } else if (strcmp(arg, "--cpu") == 0 || strcmp(arg, "-c") == 0) { in main()
163 assert_arg("--cpu"); in main()
165 } else if (strcmp(arg, "--io") == 0 || strcmp(arg, "-i") == 0) { in main()
167 assert_arg("--io"); in main()
169 } else if (strcmp(arg, "--vm") == 0 || strcmp(arg, "-m") == 0) { in main()
171 assert_arg("--vm"); in main()
173 } else if (strcmp(arg, "--vm-chunks") == 0) { in main()
174 assert_arg("--vm-chunks"); in main()
176 } else if (strcmp(arg, "--vm-bytes") == 0) { in main()
177 assert_arg("--vm-bytes"); in main()
179 } else if (strcmp(arg, "--vm-hang") == 0) { in main()
181 } else if (strcmp(arg, "--hdd") == 0 || strcmp(arg, "-d") == 0) { in main()
183 assert_arg("--hdd"); in main()
185 } else if (strcmp(arg, "--hdd-noclean") == 0) { in main()
187 } else if (strcmp(arg, "--hdd-files") == 0) { in main()
188 assert_arg("--hdd-files"); in main()
190 } else if (strcmp(arg, "--hdd-bytes") == 0) { in main()
191 assert_arg("--hdd-bytes"); in main()
195 exit(1); in main()
206 exit(0); in main()
207 exit(hogcpu(do_cpu_forks)); in main()
208 case -1: /* error */ in main()
210 exit(1); in main()
213 dbg(stdout, "--> hogcpu dispatcher forked (%i)\n", pid); in main()
224 exit(0); in main()
225 exit(hogio(do_io_forks)); in main()
226 case -1: /* error */ in main()
228 exit(1); in main()
231 dbg(stdout, "--> hogio dispatcher forked (%i)\n", pid); in main()
244 exit(0); in main()
245 exit(hogvm(do_vm_forks, do_vm_chunks, do_vm_bytes)); in main()
246 case -1: /* error */ in main()
248 exit(1); in main()
251 dbg(stdout, "--> hogvm dispatcher forked (%i)\n", pid); in main()
263 exit(0); in main()
264 exit(hoghdd in main()
267 case -1: /* error */ in main()
269 exit(1); in main()
272 dbg(stdout, "--> hoghdd dispatcher forked (%i)\n", pid); in main()
280 /* Wait for our children to exit. */ in main()
282 int status, ret; in main() local
284 if ((pid = wait(&status)) > 0) { in main()
285 if ((WIFEXITED(status)) != 0) { in main()
286 if ((ret = WEXITSTATUS(status)) != 0) { in main()
293 "<-- dispatcher return (%i)\n", in main()
298 "dispatcher did not exit normally\n"); in main()
302 --children; in main()
313 if ((stoptime = time(NULL)) == -1) { in main()
315 exit(1); in main()
319 runtime = stoptime - starttime; in main()
321 /* Print final status message. */ in main()
328 exit(retval); in main()
331 int usage(int status) in usage() argument
336 " -?, --help show this help statement\n" in usage()
337 " --version show version statement\n" in usage()
338 " -v, --verbose be verbose\n" in usage()
339 " -q, --quiet be quiet\n" in usage()
340 " -n, --dry-run show what would have been done\n" in usage()
341 " --no-retry exit rather than retry non-critical errors\n" in usage()
342 " --retry-delay n wait n us before continuing past error\n" in usage()
343 " -t, --timeout n timeout after n seconds\n" in usage()
344 " --backoff n wait for factor of n us before starting work\n" in usage()
345 " -c, --cpu n spawn n procs spinning on sqrt()\n" in usage()
346 " -i, --io n spawn n procs spinning on sync()\n" in usage()
347 " -m, --vm n spawn n procs spinning on malloc()\n" in usage()
348 " --vm-chunks c malloc c chunks (default is 1)\n" in usage()
349 " --vm-bytes b malloc chunks of b bytes (default is 256MB)\n" in usage()
350 " --vm-hang hang in a sleep loop after memory allocated\n" in usage()
351 " -d, --hdd n spawn n procs spinning on write()\n" in usage()
352 " --hdd-noclean do not unlink file to which random data written\n" in usage()
353 " --hdd-files f write to f files (default is 1)\n" in usage()
354 " --hdd-bytes b write b bytes (default is 1GB)\n\n" in usage()
355 "Infinity is denoted with 0. For -m, -d: n=0 means infinite redo,\n" in usage()
361 if (status <= 0) in usage()
362 exit(-1 * status); in usage()
367 int version(int status) in version() argument
373 if (status <= 0) in version()
374 exit(-1 * status); in version()
388 if ((pos = strlen(nptr) - 1) < 0) { in atoll_b()
390 exit(1); in atoll_b()
409 exit(1); in atoll_b()
427 if ((pos = strlen(nptr) - 1) < 0) { in atoll_s()
429 exit(1); in atoll_s()
456 exit(1); in atoll_s()
490 /* This case never falls through; alarm signal can cause exit. */ in hogcpu()
491 case -1: /* error */ in hogcpu()
503 dbg(stdout, "--> hogcpu worker forked (%i)\n", pid); in hogcpu()
507 /* Wait for our children to exit. */ in hogcpu()
509 int status, ret; in hogcpu() local
511 if ((pid = wait(&status)) > 0) { in hogcpu()
512 if ((WIFEXITED(status)) != 0) { in hogcpu()
513 if ((ret = WEXITSTATUS(status)) != 0) { in hogcpu()
520 "<-- hogcpu worker exited (%i)\n", in hogcpu()
525 "<-- hogcpu worker signalled (%i)\n", pid); in hogcpu()
528 --i; in hogcpu()
566 /* This case never falls through; alarm signal can cause exit. */ in hogio()
567 case -1: /* error */ in hogio()
579 dbg(stdout, "--> hogio worker forked (%i)\n", pid); in hogio()
583 /* Wait for our children to exit. */ in hogio()
585 int status, ret; in hogio() local
587 if ((pid = wait(&status)) > 0) { in hogio()
588 if ((WIFEXITED(status)) != 0) { in hogio()
589 if ((ret = WEXITSTATUS(status)) != 0) { in hogio()
596 "<-- hogio worker exited (%i)\n", in hogio()
600 dbg(stdout, "<-- hogio worker signalled (%i)\n", in hogio()
604 --i; in hogio()
685 exit(retval); in hogvm()
688 /* This case never falls through; alarm signal can cause exit. */ in hogvm()
689 case -1: /* error */ in hogvm()
701 dbg(stdout, "--> hogvm worker forked (%i)\n", pid); in hogvm()
705 /* Wait for our children to exit. */ in hogvm()
707 int status, ret; in hogvm() local
709 if ((pid = wait(&status)) > 0) { in hogvm()
710 if ((WIFEXITED(status)) != 0) { in hogvm()
711 if ((ret = WEXITSTATUS(status)) != 0) { in hogvm()
718 "<-- hogvm worker exited (%i)\n", in hogvm()
722 dbg(stdout, "<-- hogvm worker signalled (%i)\n", in hogvm()
726 --i; in hogvm()
743 int chunk = (1024 * 1024) - 1; /* Minimize slow writing. */ in hoghdd()
754 for (i = 0; i < chunk - 1; i++) { in hoghdd()
756 j = (j < 0) ? -j : j; in hoghdd()
780 exit(1); in hoghdd()
789 exit(1); in hoghdd()
802 exit(1); in hoghdd()
808 for (; bytes == 0 || j < bytes - 1; j++) { in hoghdd()
812 exit(1); in hoghdd()
817 exit(1); in hoghdd()
830 exit(1); in hoghdd()
840 exit(retval); in hoghdd()
843 /* This case never falls through; alarm signal can cause exit. */ in hoghdd()
844 case -1: /* error */ in hoghdd()
856 dbg(stdout, "--> hoghdd worker forked (%i)\n", pid); in hoghdd()
860 /* Wait for our children to exit. */ in hoghdd()
862 int status, ret; in hoghdd() local
864 if ((pid = wait(&status)) > 0) { in hoghdd()
865 if ((WIFEXITED(status)) != 0) { in hoghdd()
866 if ((ret = WEXITSTATUS(status)) != 0) { in hoghdd()
873 "<-- hoghdd worker exited (%i)\n", in hoghdd()
878 "<-- hoghdd worker signalled (%i)\n", pid); in hoghdd()
881 --i; in hoghdd()