L4Re - L4 Runtime Environment
L4Re::Vfs::Fs Class Referenceabstract

POSIX File-system related functionality. More...

#include <vfs.h>

+ Inheritance diagram for L4Re::Vfs::Fs:
+ Collaboration diagram for L4Re::Vfs::Fs:

Public Member Functions

virtual cxx::Ref_ptr< Fileget_file (int fd)=0 throw ()
 Get the L4Re::Vfs::File for the file descriptor fd. More...
 
virtual cxx::Ref_ptr< Fileget_root ()=0 throw ()
 Get the directory object for the applications root directory.
 
virtual cxx::Ref_ptr< Fileget_cwd () throw ()
 Get the directory object for the applications current working directory.
 
virtual void set_cwd (cxx::Ref_ptr< File > const &) throw ()
 Set the current working directory for the application.
 
virtual int alloc_fd (cxx::Ref_ptr< File > const &f=cxx::Ref_ptr<>::Nil)=0 throw ()
 Allocate the next free file descriptor. More...
 
virtual cxx::Ref_ptr< Fileset_fd (int fd, cxx::Ref_ptr< File > const &f=cxx::Ref_ptr<>::Nil)=0 throw ()
 Set the file object referenced by the file descriptor fd. More...
 
virtual cxx::Ref_ptr< Filefree_fd (int fd)=0 throw ()
 Free the file descriptor fd. More...
 
virtual int mount (char const *path, cxx::Ref_ptr< File > const &dir)=0 throw ()
 Mount a given file object at the given global path in the VFS. More...
 
int mount (char const *source, char const *target, char const *fstype, unsigned long mountflags, void const *data) throw ()
 Backend for the POSIX mount call.
 

Detailed Description

POSIX File-system related functionality.

Note
This class usually exists as a singleton as a superclass of L4Re::Vfs::Ops (
See also
L4Re::Vfs::vfs_ops).

Definition at line 873 of file vfs.h.

Member Function Documentation

◆ alloc_fd()

virtual int L4Re::Vfs::Fs::alloc_fd ( cxx::Ref_ptr< File > const &  f = cxx::Ref_ptr<>::Nil)
throw (
)
pure virtual

Allocate the next free file descriptor.

Parameters
fThe file to assign to that file descriptor.
Returns
the allocated file descriptor, or -EMFILE on error.

◆ free_fd()

virtual cxx::Ref_ptr<File> L4Re::Vfs::Fs::free_fd ( int  fd)
throw (
)
pure virtual

Free the file descriptor fd.

Parameters
fdThe file descriptor to free.
Returns
A pointer to the file object that was assigned to the fd.

◆ get_file()

virtual cxx::Ref_ptr<File> L4Re::Vfs::Fs::get_file ( int  fd)
throw (
)
pure virtual

Get the L4Re::Vfs::File for the file descriptor fd.

Parameters
fdThe POSIX file descriptor number.
Returns
A pointer to the File object, or 0 if fd is not open.

◆ mount()

virtual int L4Re::Vfs::Fs::mount ( char const *  path,
cxx::Ref_ptr< File > const &  dir 
)
throw (
)
pure virtual

Mount a given file object at the given global path in the VFS.

Parameters
pathThe global path to mount dir at.
dirA pointer to the file/directory object that shall be mounted at path.
Returns
0 on success, or <0 on error.

◆ set_fd()

virtual cxx::Ref_ptr<File> L4Re::Vfs::Fs::set_fd ( int  fd,
cxx::Ref_ptr< File > const &  f = cxx::Ref_ptr<>::Nil 
)
throw (
)
pure virtual

Set the file object referenced by the file descriptor fd.

Parameters
fdThe file descriptor to set to f;
fThe file object to assign.
Returns
A pointer to the file object that was previously assigned to fd.

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