00001
00002
00003
00004 #include <syscall.h>
00005 #include "tests/lib.h"
00006 #include "tests/main.h"
00007
00008 static char buf[76543];
00009
00010 void
00011 test_main (void)
00012 {
00013 const char *file_name = "testfile";
00014 char zero = 0;
00015 int fd;
00016
00017 CHECK (create (file_name, 0), "create \"%s\"", file_name);
00018 CHECK ((fd = open (file_name)) > 1, "open \"%s\"", file_name);
00019 msg ("seek \"%s\"", file_name);
00020 seek (fd, sizeof buf - 1);
00021 CHECK (write (fd, &zero, 1) > 0, "write \"%s\"", file_name);
00022 msg ("close \"%s\"", file_name);
00023 close (fd);
00024 check_file (file_name, buf, sizeof buf);
00025 }