#include <memory>
#include <string>
-#include "base/misc.hh"
+#include "base/logging.hh"
#include "params/Process.hh"
#include "sim/fd_entry.hh"
* possible to guarantee that the simulation will proceed as it should
* have in the same way that it would have proceeded sans checkpoints.
*/
- void (*seek)(std::shared_ptr<FileFDEntry>)
- = [] (std::shared_ptr<FileFDEntry> ffd)
+ auto seek = [] (std::shared_ptr<FileFDEntry> ffd)
{
if (lseek(ffd->getSimFD(), ffd->getFileOffset(), SEEK_SET) < 0)
fatal("Unable to seek to location in %s", ffd->getFileName());
return _fdArray[tgt_fd];
}
+void
+FDArray::setFDEntry(int tgt_fd, std::shared_ptr<FDEntry> fdep)
+{
+ assert(0 <= tgt_fd && tgt_fd < _fdArray.size());
+ _fdArray[tgt_fd] = fdep;
+}
+
int
FDArray::closeFDEntry(int tgt_fd)
{