X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=box%2Fbox.c;h=323e07e77e9d270dc85d43f0092a346deba41ed1;hb=0964fde49f014747a8252c6e02a1373d3763b44a;hp=b77ec8d66387d97c48a2f8da72940a16997c2fc9;hpb=da21fed34b0cec9654e62188553f754a4bca9b1d;p=eval.git diff --git a/box/box.c b/box/box.c index b77ec8d..323e07e 100644 --- a/box/box.c +++ b/box/box.c @@ -32,6 +32,7 @@ static int filter_syscalls; /* 0=off, 1=liberal, 2=totalitarian */ static int timeout; /* milliseconds */ static int wall_timeout; +static int extra_timeout; static int pass_environ; static int file_access; static int verbose; @@ -116,6 +117,7 @@ box_exit(int rc) ptrace(PTRACE_KILL, box_pid); kill(-box_pid, SIGKILL); kill(box_pid, SIGKILL); + meta_printf("killed:1\n"); struct rusage rus; int stat; @@ -771,7 +773,7 @@ check_timeout(void) ms = (utime + stime) * 1000 / ticks_per_sec; if (verbose > 1) fprintf(stderr, "[time check: %d msec]\n", ms); - if (ms > timeout) + if (ms > timeout && ms > extra_timeout) err("TO: Time limit exceeded"); } } @@ -1074,6 +1076,8 @@ Options:\n\ -T\t\tAllow syscalls for measuring run time\n\ -v\t\tBe verbose (use multiple times for even more verbosity)\n\ -w