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::Dataspace > | data_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 | lseek (off64_t, int) noexcept override
| Default backend for POSIX seek and lseek functions.
int | ftruncate (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 | fstat (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.
bool | check_ready (Ready_type) noexcept override
| Default implementation of a readiness check.

## Additional Inherited Members

Public Types inherited from L4Re::Vfs::Generic_file
enum | Ready_type : unsigned
| Type of I/O operation/condition a file can indicate readiness. More...

## 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 30 of file backend.

## Member Function Documentation

## check_ready()

bool L4Re::Vfs::Be_file::check_ready | ( | Ready_type |  | ) |

inlineoverridevirtualnoexcept

Default implementation of a readiness check.

By default, we assume a file is not ready for an I/O operation/condition since the proper semantics of that relies on the backend.

Returns
  Always false.

Implements L4Re::Vfs::Generic_file.

Definition at line 217 of file backend.

## 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 47 of file backend.

References L4::Cap_base::Invalid.

## fstat()

int L4Re::Vfs::Be_file::fstat | ( | struct stat64 * | buf | ) | const

inlineoverridevirtualnoexcept

Get status information for the file.

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

Parameters

  [out] | buf | This buffer is filled with the status information.

Returns
  0 on success, or <0 on error.

Implements L4Re::Vfs::Generic_file.

Definition at line 86 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 43 of file backend.

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

- l4/l4re_vfs/backend