Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "syscall.h"
- #include "stdio.h"
- #include "stdlib.h"
- int main(int argc, char** argv)
- {
- char *args1[3];
- char *args2[1];
- char *args3[2];
- int fileDescr;
- int status;
- args1[0] = "cp.coff";
- args1[1] = "test1.txt";
- args1[2] = "test2.txt";
- args2[0] = "part1_tests.coff";
- args3[0] = "simpleWrite.coff";
- args3[1] = "simpleWriteTest.txt";
- int pid2 = exec("cp.coff", 3, args1);
- // join(pid2, &status);
- int pid1 = exec("part1_tests.coff", 1, args2);
- // join(pid1, &status);
- int pid3 = exec("simpleWrite.coff", 2, args3);
- // join(pid3, &status);
- fileDescr = open("test2.txt");
- if (fileDescr == -1) {
- printf("FAIL: Could not re-open test2.txt. exec(\"cp.coff\", 3, args1) did not work correctly.\n");
- return 0;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement