From 4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 27 Mar 2012 11:51:08 +0200 Subject: reorganize file structure to match the upstream requirements --- pintos-progos/tests/userprog/child-rox.c | 55 -------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 pintos-progos/tests/userprog/child-rox.c (limited to 'pintos-progos/tests/userprog/child-rox.c') diff --git a/pintos-progos/tests/userprog/child-rox.c b/pintos-progos/tests/userprog/child-rox.c deleted file mode 100644 index aba808b..0000000 --- a/pintos-progos/tests/userprog/child-rox.c +++ /dev/null @@ -1,55 +0,0 @@ -/* Child process run by rox-child and rox-multichild tests. - Opens and tries to write to its own executable, verifying that - that is disallowed. - Then recursively executes itself to the depth indicated by the - first command-line argument. */ - -#include -#include -#include -#include -#include "tests/lib.h" - -const char *test_name = "child-rox"; - -static void -try_write (void) -{ - int handle; - char buffer[19]; - - quiet = true; - CHECK ((handle = open ("child-rox")) > 1, "open \"child-rox\""); - quiet = false; - - CHECK (write (handle, buffer, sizeof buffer) == 0, - "try to write \"child-rox\""); - - close (handle); -} - -int -main (int argc UNUSED, char *argv[]) -{ - msg ("begin"); - try_write (); - - if (!isdigit (*argv[1])) - fail ("bad command-line arguments"); - if (atoi (argv[1]) > 1) - { - char cmd[128]; - int child; - - snprintf (cmd, sizeof cmd, "child-rox %d", atoi (argv[1]) - 1); - CHECK ((child = exec (cmd)) != -1, "exec \"%s\"", cmd); - quiet = true; - CHECK (wait (child) == 12, "wait for \"child-rox\""); - quiet = false; - } - - try_write (); - msg ("end"); - - return 12; -} -- cgit v1.2.3