Closed mikeizbicki closed 10 years ago
I just checked my homeworks and they both need to be corrected
Here's what I got for hw1: kgall005@well $ scripts/checksyscalls.sh ~/cs100/rshell/rshell/src/rshell.cpp
lines with syscalls: 101: if(getlogin_r(username,sizeof(username)-1)) 105: if(-1 == gethostname(hostname,sizeof(hostname)-1)) 84: if(-1 == execvp(argv[0], argv)) 77: int pid = fork(); 90: if(!backgroundproc) wait(0);
lines with perror: 80: perror(); 86: perror(); 103: perror(); 107: perror();
summary: number of syscalls... 5 number of perror..... 4 grade modifier....... -5
and hw2: kgall005@well $ scripts/checksyscalls.sh ~/cs100/rshell/rshell/src/ls.cpp
lines with syscalls: 101: while((direntp = readdir(dirp))) 248: while((direntp = readdir(dirp2))) 348: while((finddiglength = readdir(dirp))) 118: if(-1 ==stat(newpath,&s)) 258: if(-1 ==stat(newpath,&s)) 359: if(-1 == stat(newpath,&dig))
lines with perror: 89: perror(); 94: perror(); 104: perror(); 119: perror(); 138: perror(); 243: perror(); 251: perror(); 259: perror(); 339: perror(); 345: perror(); 351: perror(); 360: perror(); 411: perror(); 414: perror();
summary: number of syscalls... 6 number of perror..... 14 grade modifier....... -0
I've updated the file
checksyscalls.sh
so that it now prints out all of the lines you use syscalls, and all the lines you use perror. So you can manually verify that the results are correct.Also, there was a bug in the program that caused it to sometimes overcount the number of syscalls. If this applies to you, let me know and I'll correct your grade.