32#ifndef __FD_ENTRY_HH__
33#define __FD_ENTRY_HH__
70 virtual std::shared_ptr<FDEntry>
clone()
const = 0;
102 std::shared_ptr<FDEntry>
105 return std::make_shared<HBFDEntry>(*
this);
131 uint64_t file_offset,
bool close_on_exec =
false)
141 std::shared_ptr<FDEntry>
144 return std::make_shared<FileFDEntry>(*
this);
178 bool close_on_exec =
false)
189 std::shared_ptr<FDEntry>
192 return std::make_shared<PipeFDEntry>(*
this);
217 bool close_on_exec =
false)
226 std::shared_ptr<FDEntry>
229 return std::make_shared<DeviceFDEntry>(*
this);
247 bool close_on_exec =
false)
257 std::shared_ptr<FDEntry>
260 return std::make_shared<SocketFDEntry>(*
this);
Holds file descriptors needed to simulate devices opened with pseudo files (commonly with calls to io...
EmulatedDriver * getDriver() const
std::string const & getFileName() const
std::shared_ptr< FDEntry > clone() const override
void serialize(CheckpointOut &cp) const override
Serialize an object.
DeviceFDEntry(EmulatedDriver *driver, std::string const &file_name, bool close_on_exec=false)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
DeviceFDEntry(DeviceFDEntry const &dev, bool close_on_exec=false)
EmulatedDriver is an abstract base class for fake SE-mode device drivers.
Holds a single file descriptor mapping and that mapping's data for processes running in syscall emula...
virtual std::shared_ptr< FDEntry > clone() const =0
void setCOE(bool close_on_exec)
FDEntry(bool close_on_exec=false)
virtual void unserialize(CheckpointIn &cp)
Unserialize an object.
virtual void serialize(CheckpointOut &cp) const
Serialize an object.
Holds file descriptors for host-backed files; host-backed files are files which were opened on the ph...
void setFileMode(mode_t mode)
FileFDEntry(int sim_fd, int flags, std::string const &file_name, uint64_t file_offset, bool close_on_exec=false)
std::string const & getFileName() const
void serialize(CheckpointOut &cp) const override
Serialize an object.
void setFileName(std::string const &file_name)
mode_t getFileMode() const
FileFDEntry(FileFDEntry const ®, bool close_on_exec=false)
void setFileOffset(uint64_t f_off)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
std::shared_ptr< FDEntry > clone() const override
uint64_t getFileOffset() const
Extends the base class to include a host-backed file descriptor field that records the integer used t...
void setSimFD(int sim_fd)
std::shared_ptr< FDEntry > clone() const override
HBFDEntry(HBFDEntry const ®, bool close_on_exec=false)
HBFDEntry(int flags, int sim_fd, bool close_on_exec=false)
Holds the metadata needed to maintain the mappings for file descriptors allocated with the pipe() sys...
int getPipeReadSource() const
void serialize(CheckpointOut &cp) const override
Serialize an object.
std::shared_ptr< FDEntry > clone() const override
void setEndType(EndType type)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
EndType getEndType() const
PipeFDEntry(int sim_fd, int flags, EndType pipe_end_type, bool close_on_exec=false)
void setPipeReadSource(int tgt_fd)
PipeFDEntry(PipeFDEntry const &pipe, bool close_on_exec=false)
Basic support for object serialization.
SocketFDEntry(int sim_fd, int domain, int type, int protocol, bool close_on_exec=false)
SocketFDEntry(SocketFDEntry const ®, bool close_on_exec=false)
std::shared_ptr< FDEntry > clone() const override
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::ostream CheckpointOut