9 // For some reason, the stack frame below __GI_write is disappearing.
10 // Therefore, if I don't want the write errors to be merged, I have to
11 // ensure they have a different stack trace. I do this by using this
13 __attribute__((noinline))
14 void mywrite(char* buf, int len)
19 __attribute__((noinline))
20 void mygetitimer(long arg1, struct itimerval* itval)
22 getitimer(arg1, itval);
25 __attribute__((noinline))
26 void myopen(char* name, long flags)
33 char *buf = malloc(sizeof(char)*6), *buf2 = malloc(sizeof(char)*6);
34 struct itimerval* itval = malloc(sizeof(struct itimerval) - 1);
35 int diff = buf2 - buf;
43 // error (read) (will fail due to -1, as we want -- don't want any
44 // unpredictable output to foul up the test)
45 mywrite(buf+3, 5); // error (read)
46 mywrite(buf-1, 5); // error (read)
47 mywrite(buf+1, diff); // error (read)
48 myopen(buf+3, 0x0); // error (read_asciiz)
50 mygetitimer(0, itval); // error (write)
54 mywrite(buf, 5); // error
55 mywrite(buf+3, 5); // error
56 mywrite(buf+1, diff); // error (read)