20 #include "FileDescriptor.h" 21 #include "net-syscalls.h" 23 #include "modules/subsys/posix/IoEvent.h" 24 #include "modules/system/vfs/File.h" 28 #define ENABLE_LOCKED_FILES 0 30 #if ENABLE_LOCKED_FILES 36 : file(0), offset(0), fd(0xFFFFFFFF), lockedFile(0), networkImpl(nullptr),
37 ioevent(nullptr), fdflags(0), flflags(0)
43 File *newFile, uint64_t newOffset,
size_t newFd,
int fdFlags,
int flFlags,
51 #if ENABLE_LOCKED_FILES 66 #if ENABLE_LOCKED_FILES 96 #if ENABLE_LOCKED_FILES 121 #if ENABLE_LOCKED_FILES 144 #if ENABLE_LOCKED_FILES 204 bool nonblock = (
flflags & O_NONBLOCK) == O_NONBLOCK;
uint64_t offset
Offset within the file for I/O.
LockedFile * lockedFile
Locked file, non-zero if there is an advisory lock on the file.
A key/value dictionary for string keys.
void setFlags(int newFlags)
Set flags, distributing any associated changes as needed.
SharedPointer< class NetworkSyscalls > networkImpl
Network syscall implementation for this descriptor (if it's a socket).
void addFlag(int newFlag)
Helper to add a single flag to the descriptor flags.
virtual ~FileDescriptor()
Destructor - decreases file reference count.
int getFlags() const
Get current descriptor flags.
int getStatusFlags() const
Get current status flags.
size_t fd
Descriptor number.
File * file
Our open file pointer.
Result< T, bool > lookup(const String &key) const
virtual String getFullPath(bool bWithLabel=true)
int flflags
File status flags (fcntl)
void addStatusFlag(int newFlag)
Helper to add a single flag to the status flags.
FileDescriptor & operator=(FileDescriptor &desc)
Assignment operator implementation.
void setStatusFlags(int newFlags)
Set status flags, distributing any associated changes as needed.
int fdflags
File descriptor flags (fcntl)
IoEvent * ioevent
IO event for reporting changes to files.
FileDescriptor()
Default constructor.
void remove(const String &key)