lseek simulator working

This commit is contained in:
fares
2019-11-18 15:30:51 -05:00
parent 3bc2f449e4
commit f3e2bacee7
6 changed files with 30423 additions and 30126 deletions

View File

@@ -197,7 +197,20 @@ void trap_to_simulator(Warp & c)
case (LSEEK):
{
cerr << "trap_to_simulator: LSEEK not supported yet\n";
// cerr << "trap_to_simulator: LSEEK not supported yet\n";
int fd;
int offset;
int whence;
download(&read_buffer, (char *) &fd , c);
download(&read_buffer, (char *) &offset , c);
download(&read_buffer, (char *) &whence , c);
int retval = lseek(fd, offset, whence);
upload(&write_buffer, (char *) &retval, sizeof(int), c);
}
break;
case (READ):