1
0

syscall.c 381 B

12345678910111213141516171819202122232425
  1. #include <u.h>
  2. #include <lib9.h>
  3. void
  4. main(void)
  5. {
  6. char buf[1024];
  7. int i, n, oldn, fail;
  8. int fd;
  9. fail = 0;
  10. for(i = 0; i < 10000; i++){
  11. fd = sys_open("/proc/1/status", OREAD);
  12. n = jehanne_read(fd, buf, sizeof buf);
  13. if(i != 0 && n != oldn){
  14. fprint(2, "read %d, want %d\n", n, oldn);
  15. fail++;
  16. }
  17. oldn = n;
  18. sys_close(fd);
  19. }
  20. print("PASS\n");
  21. exits("PASS");
  22. }