diff options
Diffstat (limited to 'fail.c')
-rw-r--r-- | fail.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fail.c b/fail.c index f586ba8..6e986ee 100644 --- a/fail.c +++ b/fail.c @@ -10,6 +10,7 @@ #include <fcntl.h> #include <signal.h> +#include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -34,6 +35,15 @@ dlcrash() *nullp = 1337; } +void +uninterruptible() +{ + printf("pid %d is now in state D\n", getpid()); + vfork(); + pause(); + exit(1); +} + // can lockup your machine void oom() @@ -122,11 +132,12 @@ main(int argc, char *argv[]) { int c; - while ((c = getopt(argc, argv, "123Oacdikrst")) != -1) { + while ((c = getopt(argc, argv, "123DOacdikrst")) != -1) { switch (c) { case '1': exit(-1); break; case '2': exit(2); break; case '3': exit(111); break; + case 'D': uninterruptible(); break; case 'O': oom(); break; case 'a': abortme(); break; case 'c': violate_seccomp(); break; |