L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
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) noexcept=0
 Get the L4Re::Vfs::File for the file descriptor fd.
 
virtual cxx::Ref_ptr< Fileget_root () noexcept=0
 Get the directory object for the application's root directory.
 
virtual cxx::Ref_ptr< Fileget_cwd () noexcept
 Get the directory object for the application's current working directory.
 
virtual void set_cwd (cxx::Ref_ptr< File > const &) noexcept
 Set the current working directory for the application.
 
virtual int alloc_fd (cxx::Ref_ptr< File > const &f=cxx::Ref_ptr<>::Nil) noexcept=0
 Allocate the next free file descriptor.
 
virtual cxx::Pair< cxx::Ref_ptr< File >, int > set_fd (int fd, cxx::Ref_ptr< File > const &f=cxx::Ref_ptr<>::Nil) noexcept=0
 Set the file object referenced by the file descriptor fd.
 
virtual cxx::Ref_ptr< Filefree_fd (int fd) noexcept=0
 Free the file descriptor fd.
 
virtual int mount (char const *path, cxx::Ref_ptr< File > const &dir) noexcept=0
 Mount a given file object at the given global path in the VFS.
 
int mount (char const *source, char const *target, char const *fstype, unsigned long mountflags, void const *data) noexcept
 Backend for the POSIX mount call.
 

Detailed Description

POSIX File-system related functionality.

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

Definition at line 920 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)
pure virtualnoexcept

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)
pure virtualnoexcept

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)
pure virtualnoexcept

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 
)
pure virtualnoexcept

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::Pair< cxx::Ref_ptr< File >, int > L4Re::Vfs::Fs::set_fd ( int  fd,
cxx::Ref_ptr< File > const &  f = cxx::Ref_ptr<>::Nil 
)
pure virtualnoexcept

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 pair of a pointer to the file object that was previously assigned to fd (first) and a return value (second). second contains -#EBADF if the passed file descriptor is outside the valid range. first contains a Nil pointer in that case. On success, second contains 0.

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