Merging in 2.0.2.

This commit is contained in:
Geoffrey Challen
2017-01-09 22:37:50 -05:00
parent a0406ec181
commit 50cf3276e7
118 changed files with 1350 additions and 3158 deletions

View File

@@ -49,11 +49,6 @@
#include <unistd.h>
#include <err.h>
#include <time.h>
#include <test161/test161.h>
#define TEST_DURATION 10
#define LOCAL_SUCCESS "SUCCESS"
static volatile int pid;
@@ -62,40 +57,8 @@ main(void)
{
int i;
time_t start_time_s, time_now_s;
unsigned long start_time_ns, time_now_ns;
__time(&start_time_s, &start_time_ns);
int parent_pid = getpid();
int did_print = 0;
int iters = 0;
// Do not remove!
// We need to cause page faults on the static secprintf buffers so the
// pages are available when we print success. With on-demand page allocation,
// we will probably be out of pages by the time we try to print success.
secprintf(SECRET, "!!< Starting Forkbbbboooommmmbbbb >!!", "/testbin/forkbomb");
// And now for the success string
printf("This should print %s after 10s\n", LOCAL_SUCCESS);
while (1) {
fork();
// Only parent gets to print
if(getpid() == parent_pid) {
TEST161_LPROGRESS(0);
if (iters > 0 && iters % 20 == 0) {
putchar('\n');
}
iters++;
__time(&time_now_s, &time_now_ns);
if (time_now_s - start_time_s > TEST_DURATION && !did_print) {
did_print = 1;
// We need to print this using secprintf so that it uses
// the same page we warmed up earlier.
secprintf(SECRET, LOCAL_SUCCESS, "/testbin/forkbomb");
}
}
pid = getpid();