36 #ifndef __FD_ENTRY_HH__
37 #define __FD_ENTRY_HH__
58 virtual std::shared_ptr<FDEntry>
clone()
const = 0;
79 HBFDEntry(
int flags,
int sim_fd,
bool close_on_exec =
false)
106 uint64_t file_offset,
bool close_on_exec =
false)
107 :
HBFDEntry(flags, sim_fd, close_on_exec),
116 inline std::shared_ptr<FDEntry>
119 return std::make_shared<FileFDEntry>(*this);
149 bool close_on_exec =
false)
160 inline std::shared_ptr<FDEntry>
163 return std::make_shared<PipeFDEntry>(*this);
188 bool close_on_exec =
false)
197 std::shared_ptr<FDEntry>
200 return std::make_shared<DeviceFDEntry>(*this);
214 #endif // __FD_ENTRY_HH__
virtual void serialize(CheckpointOut &cp) const
Serialize an object.
PipeFDEntry(int sim_fd, int flags, EndType pipe_end_type, bool close_on_exec=false)
void setCOE(bool close_on_exec)
virtual std::shared_ptr< FDEntry > clone() const =0
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Holds a single file descriptor mapping and that mapping's data for processes running in syscall emula...
uint64_t getFileOffset() const
DeviceFDEntry(DeviceFDEntry const &dev, bool close_on_exec=false)
std::shared_ptr< FDEntry > clone() const override
Holds file descriptors for host-backed files; host-backed files are files which were opened on the ph...
EndType getEndType() const
void setSimFD(int sim_fd)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
PipeFDEntry(PipeFDEntry const &pipe, bool close_on_exec=false)
void setPipeReadSource(int tgt_fd)
HBFDEntry(int flags, int sim_fd, bool close_on_exec=false)
Extends the base class to include a host-backed file descriptor field that records the integer used t...
DeviceFDEntry(EmulatedDriver *driver, std::string const &file_name, bool close_on_exec=false)
void setEndType(EndType type)
void serialize(CheckpointOut &cp) const override
Serialize an object.
Basic support for object serialization.
EmulatedDriver * getDriver() const
FileFDEntry(FileFDEntry const ®, bool close_on_exec=false)
void setFileOffset(uint64_t f_off)
Holds the metadata needed to maintain the mappings for file descriptors allocated with the pipe() sys...
void unserialize(CheckpointIn &cp) override
Unserialize an object.
int getPipeReadSource() const
void serialize(CheckpointOut &cp) const override
Serialize an object.
virtual void unserialize(CheckpointIn &cp)
Unserialize an object.
std::ostream CheckpointOut
std::shared_ptr< FDEntry > clone() const override
void serialize(CheckpointOut &cp) const override
Serialize an object.
EmulatedDriver is an abstract base class for fake SE-mode device drivers.
Holds file descriptors needed to simulate devices opened with pseudo files (commonly with calls to io...
std::string getFileName() const
FileFDEntry(int sim_fd, int flags, std::string const &file_name, uint64_t file_offset, bool close_on_exec=false)
std::shared_ptr< FDEntry > clone() const override
void setFileName(std::string file_name)
std::string getFileName() const
FDEntry(bool close_on_exec=false)