Go to the documentation of this file.
34 #ifndef __FD_ARRAY_HH__
35 #define __FD_ARRAY_HH__
55 std::string
const& errout);
75 void setFDEntry(
int tgt_fd, std::shared_ptr<FDEntry> fdep);
82 std::shared_ptr<FDEntry>
103 int allocFD(std::shared_ptr<FDEntry> fdp);
119 int openFile(std::string
const& file_name,
int flags, mode_t
mode)
const;
129 std::shared_ptr<FDEntry>
getFDEntry(
int tgt_fd);
157 #endif // __FD_ARRAY_HH__
static void output(const char *filename)
int openFile(std::string const &file_name, int flags, mode_t mode) const
Help clarify our intention when opening files in the init and restoration code.
std::shared_ptr< FDEntry > operator[](int tgt_fd)
Treat this object like a normal array in using the subscript operator to pull entries out of it.
static constexpr size_t _numFDs
Hold pointers to the file descriptor entries.
FDArray(std::string const &input, std::string const &output, std::string const &errout)
Initialize the file descriptor array and set the standard file descriptors to defaults or values pass...
std::string _input
Hold param strings passed from the Process class which indicate the filename for each of the correspo...
std::array< std::shared_ptr< FDEntry >, _numFDs > _fdArray
int openInputFile(std::string const &file_name) const
void updateFileOffsets()
Figure out the file offsets for all currently open files and save them the offsets during the calls t...
int allocFD(std::shared_ptr< FDEntry > fdp)
Step through the file descriptor array and find the first available entry which is denoted as being f...
std::map< std::string, int > _oemap
void setFDEntry(int tgt_fd, std::shared_ptr< FDEntry > fdep)
Put the pointer specified by fdep into the _fdArray entry indexed by tgt_fd.
std::map< std::string, int > _imap
Hold strings which represent the default values which are checked against to initialize the standard ...
std::shared_ptr< FDEntry > getFDEntry(int tgt_fd)
Return the file descriptor entry object associated with the index provided.
int getSize() const
Return the size of the _fdArray field.
void restoreFileOffsets()
Restore all offsets for currently open files during the unserialize phase for the owning process clas...
int closeFDEntry(int tgt_fd)
Try to close the host file descriptor.
int openOutputFile(std::string const &file_name) const
Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17