summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2006-06-09 17:47:23 -0400
committerKorey Sewell <ksewell@umich.edu>2006-06-09 17:47:23 -0400
commitf8df550db826c9fe29cc184fce873db6789e42ee (patch)
tree96aa51eef059ef3740c5e67459682f4256a95812 /src/sim
parentcaca57421b32410f6ff1356ae75684891337073f (diff)
parentb94fecfa10236b51ded904a5f1a57f4a5ebe7acc (diff)
downloadgem5-f8df550db826c9fe29cc184fce873db6789e42ee.tar.xz
Merge zizzer:/bk/newmem
into zizzer.eecs.umich.edu:/.automount/zooks/y/ksewell/research/m5-sim/newmem-release --HG-- extra : convert_revision : 82b83199a36059d4b402f89f7db2de299ea59c1e
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/syscall_emul.cc29
-rw-r--r--src/sim/syscall_emul.hh4
2 files changed, 33 insertions, 0 deletions
diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc
index 888c133c0..e32295131 100644
--- a/src/sim/syscall_emul.cc
+++ b/src/sim/syscall_emul.cc
@@ -341,6 +341,35 @@ fcntlFunc(SyscallDesc *desc, int num, Process *process,
}
SyscallReturn
+fcntl64Func(SyscallDesc *desc, int num, Process *process,
+ ThreadContext *tc)
+{
+ int fd = tc->getSyscallArg(0);
+
+ if (fd < 0 || process->sim_fd(fd) < 0)
+ return -EBADF;
+
+ int cmd = tc->getSyscallArg(1);
+ switch (cmd) {
+ case 33: //F_GETLK64
+ warn("fcntl64(%d, F_GETLK64) not supported, error returned\n", fd);
+ return -EMFILE;
+
+ case 34: // F_SETLK64
+ case 35: // F_SETLKW64
+ warn("fcntl64(%d, F_SETLK(W)64) not supported, error returned\n", fd);
+ return -EMFILE;
+
+ default:
+ // not sure if this is totally valid, but we'll pass it through
+ // to the underlying OS
+ warn("fcntl64(%d, %d) passed through to host\n", fd, cmd);
+ return fcntl(process->sim_fd(fd), cmd);
+ // return 0;
+ }
+}
+
+SyscallReturn
pipePseudoFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 874eaf6a4..ffd12dd83 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -249,6 +249,10 @@ SyscallReturn fchownFunc(SyscallDesc *desc, int num,
SyscallReturn fcntlFunc(SyscallDesc *desc, int num,
Process *process, ThreadContext *tc);
+/// Target fcntl64() handler.
+SyscallReturn fcntl64Func(SyscallDesc *desc, int num,
+ Process *process, ThreadContext *tc);
+
/// Target setuid() handler.
SyscallReturn setuidFunc(SyscallDesc *desc, int num,
Process *p, ThreadContext *tc);