From 5550a53554f5e20cafcde2304ddaeb1f59c43b4f Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 5 Apr 2009 18:48:17 +0200 Subject: [PATCH] Box: Implemented the `-x' (extra timeout) option --- box/box.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/box/box.c b/box/box.c index b77ec8d..c93ed0d 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; @@ -771,7 +772,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 +1075,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