diff options
author | rtm <rtm> | 2006-08-12 22:34:13 +0000 |
---|---|---|
committer | rtm <rtm> | 2006-08-12 22:34:13 +0000 |
commit | cd93074e5bed8fdbc84f2960c3219c7cf791b020 (patch) | |
tree | 1c08629ac66cb608ed03601ca0edce0170f71546 /usertests.c | |
parent | 22bac2cb9d0b8050573a4b5c6cb5d8f460ee4167 (diff) | |
download | xv6-labs-cd93074e5bed8fdbc84f2960c3219c7cf791b020.tar.gz xv6-labs-cd93074e5bed8fdbc84f2960c3219c7cf791b020.tar.bz2 xv6-labs-cd93074e5bed8fdbc84f2960c3219c7cf791b020.zip |
LRU disk cache replacement
Diffstat (limited to 'usertests.c')
-rw-r--r-- | usertests.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/usertests.c b/usertests.c index 9bd144c..3cb4a37 100644 --- a/usertests.c +++ b/usertests.c @@ -303,7 +303,7 @@ createdelete() void unlinkread() { - int fd; + int fd, fd1; fd = open("unlinkread", O_CREATE | O_RDWR); if(fd < 0){ @@ -322,15 +322,25 @@ unlinkread() puts("unlink unlinkread failed\n"); exit(); } + + fd1 = open("xxx", O_CREATE | O_RDWR); + write(fd1, "yyy", 3); + close(fd1); + if(read(fd, buf, sizeof(buf)) != 5){ puts("unlinkread read failed"); exit(); } + if(buf[0] != 'h'){ + puts("unlinkread wrong data\n"); + exit(); + } if(write(fd, buf, 10) != 10){ puts("unlinkread write failed\n"); exit(); } close(fd); + unlink("xxx"); puts("unlinkread ok\n"); } @@ -339,7 +349,7 @@ main(int argc, char *argv[]) { puts("usertests starting\n"); - //unlinkread(); + unlinkread(); createdelete(); twofiles(); sharedfd(); |