L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
L4Re::Vfs::Be_file Class Referenceabstract

Boiler plate class for implementing an open file for L4Re::Vfs. More...

#include <backend>

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

Public Member Functions

int unlock_all_locks () noexcept override
 Unlock all locks on the file.
 
L4::Cap< L4Re::Dataspacedata_space () noexcept override
 Get an L4Re::Dataspace object for the file.
 
ssize_t readv (const struct iovec *, int) noexcept override
 Default backend for POSIX read and readv functions.
 
ssize_t writev (const struct iovec *, int) noexcept override
 Default backend for POSIX write and writev functions.
 
ssize_t pwritev (const struct iovec *, int, off64_t) noexcept override
 Default backend for POSIX pwrite and pwritev functions.
 
ssize_t preadv (const struct iovec *, int, off64_t) noexcept override
 Default backend for POSIX pread and preadv functions.
 
off64_t lseek64 (off64_t, int) noexcept override
 Default backend for POSIX seek and lseek functions.
 
int ftruncate64 (off64_t) noexcept override
 Default backend for the POSIX truncate, ftruncate and similar functions.
 
int fsync () const noexcept override
 Default backend for POSIX fsync.
 
int fdatasync () const noexcept override
 Default backend for POSIX fdatasync.
 
int ioctl (unsigned long, va_list) noexcept override
 Default backend for POSIX ioctl.
 
int fstat64 (struct stat64 *) const noexcept override
 Get status information for the file.
 
int fchmod (mode_t) noexcept override
 Default backend for POSIX chmod and fchmod.
 
int get_status_flags () const noexcept override
 Default backend for POSIX fcntl subfunctions.
 
int set_status_flags (long) noexcept override
 Default backend for POSIX fcntl subfunctions.
 
int get_lock (struct flock64 *) noexcept override
 Default backend for POSIX fcntl subfunctions.
 
int set_lock (struct flock64 *, bool) noexcept override
 Default backend for POSIX fcntl subfunctions.
 
int faccessat (const char *, int, int) noexcept override
 Default backend for POSIX access and faccessat functions.
 
int fchmodat (const char *, mode_t, int) noexcept override
 Default backend for POSIX fchmodat function.
 
int utime (const struct utimbuf *) noexcept override
 Default backend for POSIX utime.
 
int utimes (const struct timeval[2]) noexcept override
 Default backend for POSIX utimes.
 
int utimensat (const char *, const struct timespec[2], int) noexcept override
 Default backend for POSIX utimensat.
 
int mkdir (const char *, mode_t) noexcept override
 Default backend for POSIX mkdir and mkdirat.
 
int unlink (const char *) noexcept override
 Default backend for POSIX unlink, unlinkat.
 
int rename (const char *, const char *) noexcept override
 Default backend for POSIX rename, renameat.
 
int link (const char *, const char *) noexcept override
 Default backend for POSIX link, linkat.
 
int symlink (const char *, const char *) noexcept override
 Default backend for POSIX symlink, symlinkat.
 
int rmdir (const char *) noexcept override
 Default backend for POSIX rmdir, rmdirat.
 
ssize_t readlink (char *, size_t) override
 Default backend for POSIX readlink, readlinkat.
 

Detailed Description

Boiler plate class for implementing an open file for L4Re::Vfs.

This class may be used as a base class for everything that a POSIX file descriptor may point to. This are things such as regular files, directories, special device files, streams, pipes, and so on.

Examples
tmpfs/lib/src/fs.cc.

Definition at line 39 of file backend.

Member Function Documentation

◆ data_space()

L4::Cap< L4Re::Dataspace > L4Re::Vfs::Be_file::data_space ( )
inlineoverridevirtualnoexcept

Get an L4Re::Dataspace object for the file.

This is used as a backend for POSIX mmap and mmap2 functions.

Note
mmap is not possible if the function returns an invalid capability.
Returns
A capability to an L4Re::Dataspace that represents the file contents in an L4Re way.

Implements L4Re::Vfs::Regular_file.

Definition at line 56 of file backend.

◆ fstat64()

int L4Re::Vfs::Be_file::fstat64 ( struct stat64 *  buf) const
inlineoverridevirtualnoexcept

Get status information for the file.

This is the backend for POSIX fstat, stat, fstat64 and friends.

Parameters
[out]bufThis buffer is filled with the status information.
Returns
0 on success, or <0 on error.

Implements L4Re::Vfs::Generic_file.

Definition at line 95 of file backend.

◆ unlock_all_locks()

int L4Re::Vfs::Be_file::unlock_all_locks ( )
inlineoverridevirtualnoexcept

Unlock all locks on the file.

Note
All locks means all locks independent of which file the locks were taken by.

This method is called by the POSIX close implementation to get the POSIX semantics of releasing all locks taken by this application on a close for any fd referencing the real file.

Returns
0 on success, or <0 on error.

Implements L4Re::Vfs::Generic_file.

Definition at line 52 of file backend.


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