shithub: fuzz

Download patch

ref: ea1df5910952e12c2907b9443228f89a3605d096
parent: bafb7ededb9b9de3f3e01614a2b22c059713f7ea
author: glenda <glenda@cpre431>
date: Sat Oct 27 16:46:14 EDT 2018

Add further handling of commandline arguments and refinement of list

--- a/fuzz.h
+++ b/fuzz.h
@@ -89,7 +89,7 @@
 	call			c;			// System call in use
 	char*		name;		// Real name of syscall
 	int			round;		// Last run executed
-	List			inputs;
+	List			inputs;		// List of input types in order from left→right
 };
 
 /* == Function prototypes == */
--- a/list.c
+++ b/list.c
@@ -18,7 +18,6 @@
 	new->dat = p;
 	new->next = nil;
 	Node* n = l->root;
-	//Node* prev = nil;
 	
 	if(l->size == 0){
 		l->root = new;
--- a/main.c
+++ b/main.c
@@ -12,8 +12,9 @@
 void
 main(int argc, char *argv[])
 {
-	int nrounds = 1;
+	int nrounds = -1;
 	int i;
+	List syscalls;
 
 	ARGBEGIN{
 		case 'n':
@@ -25,9 +26,13 @@
 	}ARGEND
 
 	// Acquire a list of calls specified by spaces (fuzz -n 1 read write seek)
+	for(;*argv;){
+		print("Loading call: %s\n", *argv++);
+		// TODO -- add to list
+	}
 	
-	
-	for(i = 0; i < nrounds; i++){
+	// Operate for the desired number of rounds, -1 is infinite
+	for(i = 0; i < nrounds || nrounds < 0; i++){
 		
 	}