sys_write() "seems to" work. Also added support for sys_lseek().

This commit is contained in:
Bahadir Balban
2008-04-23 14:14:45 +01:00
parent 59bdaf22ec
commit 0629ba3c1a
6 changed files with 101 additions and 46 deletions

View File

@@ -23,17 +23,20 @@ int fileio(void)
}
printf("Created newfile.txt\n");
printf("%s: write.\n", __TASKNAME__);
if ((int)(cnt = write(fd, str, strlen(str))) < 0) {
perror("WRITE");
return -1;
}
printf("%s: lseek.\n", __TASKNAME__);
if ((int)(offset = lseek(fd, 0, SEEK_SET)) < 0) {
perror("LSEEK");
return -1;
}
printf("%s: read.\n", __TASKNAME__);
if ((int)(cnt = read(fd, buf, strlen(str))) < 0) {
perror("WRITE");
perror("READ");
return -1;
}