summaryrefslogtreecommitdiff
path: root/sim/syscall_emul.hh
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2005-11-10 21:08:33 -0500
committerSteve Reinhardt <stever@eecs.umich.edu>2005-11-10 21:08:33 -0500
commit4410876773fa076a2b197cfbaf23ceea73137397 (patch)
tree8af6c6e78f944c8b6f1df34c23ea2e4315f146a3 /sim/syscall_emul.hh
parent99bf6ed0849085588c3d51679218c5b53ab4b9c0 (diff)
downloadgem5-4410876773fa076a2b197cfbaf23ceea73137397.tar.xz
Actually free Process fd_map entries when a file is closed...
amazingly we never did that before. Caused us to run out of file descriptors in twolf. sim/process.cc: Add free_fd() method to free closed target fd in simulator fd map. Rename open_fd() to alloc_fd() for symmetry with free_fd(). sim/process.hh: Add free_fd() method to free closed target fd in simulator fd map. Rename open_fd() to alloc_fd() for symmetry with free_fd(). Crank up MAX_FD while we're at it. sim/syscall_emul.cc: Call free_fd() on process when target closes a file. sim/syscall_emul.hh: Process open_fd() renamed to alloc_fd(). --HG-- extra : convert_revision : d780f4ccfd5a0989230b0afbdbd276212b87550c
Diffstat (limited to 'sim/syscall_emul.hh')
-rw-r--r--sim/syscall_emul.hh2
1 files changed, 1 insertions, 1 deletions
diff --git a/sim/syscall_emul.hh b/sim/syscall_emul.hh
index 17889113e..f22b6dcb7 100644
--- a/sim/syscall_emul.hh
+++ b/sim/syscall_emul.hh
@@ -339,7 +339,7 @@ openFunc(SyscallDesc *desc, int callnum, Process *process,
// open the file
int fd = open(path.c_str(), hostFlags, mode);
- return (fd == -1) ? -errno : process->open_fd(fd);
+ return (fd == -1) ? -errno : process->alloc_fd(fd);
}