The Pedigree Project
0.1
|
#include <FileDescriptor.h>
Public Member Functions | |
FileDescriptor () | |
Default constructor. | |
FileDescriptor (File *newFile, uint64_t newOffset=0, size_t newFd=0xFFFFFFFF, int fdFlags=0, int flFlags=0, LockedFile *lf=0) | |
Parameterised constructor. More... | |
FileDescriptor (FileDescriptor &desc) | |
Copy constructor. | |
FileDescriptor (FileDescriptor *desc) | |
Pointer copy constructor. | |
FileDescriptor & | operator= (FileDescriptor &desc) |
Assignment operator implementation. | |
virtual | ~FileDescriptor () |
Destructor - decreases file reference count. More... | |
void | setFlags (int newFlags) |
Set flags, distributing any associated changes as needed. | |
void | addFlag (int newFlag) |
Helper to add a single flag to the descriptor flags. | |
int | getFlags () const |
Get current descriptor flags. | |
void | setStatusFlags (int newFlags) |
Set status flags, distributing any associated changes as needed. More... | |
void | addStatusFlag (int newFlag) |
Helper to add a single flag to the status flags. | |
int | getStatusFlags () const |
Get current status flags. | |
Public Attributes | |
File * | file |
Our open file pointer. | |
uint64_t | offset |
Offset within the file for I/O. | |
size_t | fd |
Descriptor number. | |
LockedFile * | lockedFile |
Locked file, non-zero if there is an advisory lock on the file. | |
SharedPointer< class NetworkSyscalls > | networkImpl |
Network syscall implementation for this descriptor (if it's a socket). | |
IoEvent * | ioevent |
IO event for reporting changes to files. | |
int | fdflags |
File descriptor flags (fcntl) More... | |
int | flflags |
File status flags (fcntl) | |
Abstraction of a file descriptor, which defines an open file and related flags.
Definition at line 36 of file FileDescriptor.h.
FileDescriptor::FileDescriptor | ( | File * | newFile, |
uint64_t | newOffset = 0 , |
||
size_t | newFd = 0xFFFFFFFF , |
||
int | fdFlags = 0 , |
||
int | flFlags = 0 , |
||
LockedFile * | lf = 0 |
||
) |
Parameterised constructor.
Definition at line 42 of file FileDescriptor.cc.
References file, flflags, File::getFullPath(), lockedFile, and RadixTree< T >::lookup().
|
virtual |
Destructor - decreases file reference count.
Definition at line 140 of file FileDescriptor.cc.
References file, flflags, File::getFullPath(), ioevent, lockedFile, networkImpl, RadixTree< T >::remove(), and LockedFile::unlock().
void FileDescriptor::setStatusFlags | ( | int | newFlags | ) |
Set status flags, distributing any associated changes as needed.
Definition at line 194 of file FileDescriptor.cc.
References flflags, and networkImpl.
int FileDescriptor::fdflags |
File descriptor flags (fcntl)
Definition at line 97 of file FileDescriptor.h.
Referenced by addFlag(), FileDescriptor(), PosixSubsystem::freeMultipleFds(), getFlags(), operator=(), and setFlags().