00001 /* Tries to open the same file twice, 00002 which must succeed and must return a different file descriptor 00003 in each case. */ 00004 00005 #include <syscall.h> 00006 #include "tests/lib.h" 00007 #include "tests/main.h" 00008 00009 void 00010 test_main (void) 00011 { 00012 int h1 = open ("sample.txt"); 00013 int h2 = open ("sample.txt"); 00014 00015 CHECK ((h1 = open ("sample.txt")) > 1, "open \"sample.txt\" once"); 00016 CHECK ((h2 = open ("sample.txt")) > 1, "open \"sample.txt\" again"); 00017 if (h1 == h2) 00018 fail ("open() returned %d both times", h1); 00019 }