2016-11-25 17:18:40 +01:00
|
|
|
// Ensure that many calls to waserror:
|
|
|
|
// -- return an error
|
|
|
|
// -- complete
|
|
|
|
// Since we're going to improve waserror
|
|
|
|
#include <u.h>
|
2017-04-19 23:33:14 +02:00
|
|
|
#include <lib9.h>
|
2016-11-25 17:18:40 +01:00
|
|
|
|
|
|
|
void
|
|
|
|
main(void)
|
|
|
|
{
|
|
|
|
char buf[1];
|
|
|
|
int i;
|
|
|
|
// Just to be sure.
|
|
|
|
if (close(3) >= 0) {
|
|
|
|
print("waserror: close of 3 did not get an error\n");
|
|
|
|
exits("FAIL");
|
|
|
|
}
|
|
|
|
|
|
|
|
for(i = 0; i < 100000; i++) {
|
|
|
|
if (read(3, buf, 1) >= 0){
|
|
|
|
print("waserror: read of 3 did not get an error\n");
|
|
|
|
exits("FAIL");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
print("PASS\n");
|
|
|
|
exits("PASS");
|
|
|
|
}
|