Miosix  2.0alpha1
miosix::MountpointFsDirectory Class Reference
Inheritance diagram for miosix::MountpointFsDirectory:
Collaboration diagram for miosix::MountpointFsDirectory:

Public Member Functions

 MountpointFsDirectory (intrusive_ref_ptr< FilesystemBase > parent, FastMutex &mutex, map< StringPart, int > &dirs, bool root, int currentInode, int parentInode)
 
virtual int getdents (void *dp, int len)
 
- Public Member Functions inherited from miosix::DirectoryBase
 DirectoryBase (intrusive_ref_ptr< FilesystemBase > parent)
 
virtual ssize_t write (const void *data, size_t len)
 
virtual ssize_t read (void *data, size_t len)
 
virtual off_t lseek (off_t pos, int whence)
 
virtual int fstat (struct stat *pstat) const
 
- Public Member Functions inherited from miosix::FileBase
 FileBase (intrusive_ref_ptr< FilesystemBase > parent)
 
virtual int isatty () const
 
virtual int fcntl (int cmd, int opt)
 
virtual int ioctl (int cmd, void *arg)
 
const intrusive_ref_ptr
< FilesystemBase
getParent () const
 
virtual ~FileBase ()
 

Additional Inherited Members

- Protected Member Functions inherited from miosix::IntrusiveRefCounted
 IntrusiveRefCounted ()
 
 IntrusiveRefCounted (const IntrusiveRefCounted &)
 
IntrusiveRefCountedoperator= (const IntrusiveRefCounted &)
 
- Static Protected Member Functions inherited from miosix::DirectoryBase
static int addEntry (char **pos, char *end, int ino, char type, const StringPart &n)
 
static int addDefaultEntries (char **pos, int thisIno, int upIno)
 
static int addTerminatingEntry (char **pos, char *end)
 
- Static Protected Attributes inherited from miosix::DirectoryBase
static const int direntHeaderSizeNoPadding =offsetof(struct dirent,d_name)
 
static const int direntHeaderSize =(direntHeaderSizeNoPadding+3+3)/4*4
 
static const int minimumBufferSize =3*direntHeaderSize
 Minimum buffer accepted by getdents, two for . and .., plus terminating.
 

Detailed Description

Directory class for MountpointFs

Constructor & Destructor Documentation

miosix::MountpointFsDirectory::MountpointFsDirectory ( intrusive_ref_ptr< FilesystemBase parent,
FastMutex mutex,
map< StringPart, int > &  dirs,
bool  root,
int  currentInode,
int  parentInode 
)
inline
Parameters
parentparent filesystem
mutexmutex to lock when accessing the file map
dirsfile map
roottrue if we're listing the root directory
currentInodeinode of the directory we're listing
parentInodeinode of the parent directory

Member Function Documentation

int miosix::MountpointFsDirectory::getdents ( void *  dp,
int  len 
)
virtual

Also directories can be opened as files. In this case, this system call allows to retrieve directory entries.

Parameters
dppointer to a memory buffer where one or more struct dirent will be placed. dp must be four words aligned.
lenmemory buffer size.
Returns
the number of bytes read on success, or a negative number on failure.

Reimplemented from miosix::FileBase.


The documentation for this class was generated from the following file: