shithub: fuzz

Download patch

ref: 5265706035146d7a040eb68add7cbfc2e0f00a80
parent: 0dacfe5d0727717f4664bfda558e81a46639aad0
author: Steven Sleder <ssleder@iastate.edu>
date: Fri Nov 9 23:47:51 EST 2018

Merge hell

--- a/input.c
+++ b/input.c
@@ -17,14 +17,24 @@
 		case sc_close :			//	close(int);
 			// increment the round counter
 			(sc->round)++;
-			// with this call, pass the address of the input so that
-			// it's value is directly modified by the input generator
 
-			//(sc->List)->
+			// mutate the input
+			int fd;
+			mut_int(&fd);
+			mut_int(&(((sc->List)->root)->dat));
 			
+			// store arguments in temp values for readability
+			int fd = (((sc->List)->root)->dat);
+
+			// log the variables
+			log_call(&sc);
+
+			// sync the disk
 			hjsync();
 			
 			// execute the call
+			close(fd);
+
 			break;
 		case sc_create :		//	create(char* : int : ulong);
 		case sc_dup :			//	dup(int : int);
@@ -88,7 +98,21 @@
 	}
 }
 
+// Logs the syscall arguments
+void
+log_call(caller *sc)
+{
+	fprint(logfd, "\nSystem Call: %s", sc->name);
+	fprint(logfd, "\n\tRound #: %d", sc->round);
+	fprint(logfd, "\n\tSeed: %d", sc->seed);
 
+
+	int x;
+	for (x; x < ((sc->List)->size); x++) {
+	
+	}
+}
+
 // Syncs the disk in hjfs
 void
 hjsync()
@@ -98,7 +122,6 @@
 	fprint(hjfs, "sync\n");
 	close(hjfs);
 }
-
 
 // Init callnames here, is extern in fuzz.h
 char *callnames[NCALLS]= {