Loading...
Searching...
No Matches
L4Re::Vfs::Generic_file Class Referenceabstract

The common interface for an open POSIX file. More...

`#include <vfs.h>`

Inheritance diagram for L4Re::Vfs::Generic_file:
Collaboration diagram for L4Re::Vfs::Generic_file:

## Public Types

enum | Ready_type : unsigned
| Type of I/O operation/condition a file can indicate readiness. More...

## Public Member Functions

virtual int | unlock_all_locks () noexcept=0
| Unlock all locks on the file.
virtual int | fstat (struct stat64 *buf) const noexcept=0
| Get status information for the file.
virtual int | fchmod (mode_t) noexcept=0
| Change POSIX access rights on the file.
virtual int | get_status_flags () const noexcept=0
| Get file status flags (fcntl F_GETFL).
virtual int | set_status_flags (long flags) noexcept=0
| Set file status flags (fcntl F_SETFL).
virtual bool | check_ready (Ready_type rt) noexcept=0
| Check whether the file is ready for an I/O operation/condition.

## Detailed Description

The common interface for an open POSIX file.

This interface is common to all kinds of open files, independent of the file type (e.g., directory, regular file etc.). However, in the L4Re::Vfs the interface File is used for every real object.

See also
  L4Re::Vfs::File for more information.

Definition at line 52 of file vfs.h.

## Member Enumeration Documentation

## Ready_type

enum L4Re::Vfs::Generic_file::Ready_type : unsigned

Type of I/O operation/condition a file can indicate readiness.

As defined by select() and similar functions.

Definition at line 60 of file vfs.h.

## Member Function Documentation

## check_ready()

virtual bool L4Re::Vfs::Generic_file::check_ready | ( | Ready_type | rt | ) |

pure virtualnoexcept

Check whether the file is ready for an I/O operation/condition.

This method is used by the implementation of select() and similar functions.

Parameters

  rt | Type of the I/O operation/condition to be ready, as defined by the select() and similar functions (Read, Write, Exception).

Return values

  true | The file is ready for the given type of I/O operation/condition.
  false | The file is not ready for the given type of I/O operation/condition.

Implemented in L4Re::Vfs::Be_file.

References check_ready().

Referenced by check_ready().

Here is the call graph for this function:
Here is the caller graph for this function:

## fchmod()

virtual int L4Re::Vfs::Generic_file::fchmod | ( | mode_t |  | ) |

pure virtualnoexcept

Change POSIX access rights on the file.

Backend for POSIX chmod and fchmod.

Implemented in L4Re::Vfs::Be_file.

References fchmod().

Referenced by fchmod().

Here is the call graph for this function:
Here is the caller graph for this function:

## fstat()

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

pure virtualnoexcept

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.

Implemented in L4Re::Vfs::Be_file.

References fstat().

Referenced by fstat().

Here is the call graph for this function:
Here is the caller graph for this function:

## get_status_flags()

virtual int L4Re::Vfs::Generic_file::get_status_flags | ( |  | ) | const

pure virtualnoexcept

Get file status flags (fcntl F_GETFL).

This function is used by the fcntl implementation for the F_GETFL command.

Returns
  flags such as O_RDONLY, O_WRONLY, O_RDWR, O_DIRECT, O_ASYNC, O_NOATIME, O_NONBLOCK, or <0 on error.

Implemented in L4Re::Vfs::Be_file.

References get_status_flags().

Referenced by get_status_flags().

Here is the call graph for this function:
Here is the caller graph for this function:

## set_status_flags()

virtual int L4Re::Vfs::Generic_file::set_status_flags | ( | long | flags | ) |

pure virtualnoexcept

Set file status flags (fcntl F_SETFL).

This function is used by the fcntl implementation for the F_SETFL command.

Parameters

  flags | The file status flags to set. This must be a combination of O_RDONLY, O_WRONLY, O_RDWR, O_APPEND, O_ASYNC, O_DIRECT, O_NOATIME, O_NONBLOCK.

Note
  Creation flags such as O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC are ignored.

Returns
  0 on success, or <0 on error.

Implemented in L4Re::Vfs::Be_file.

References set_status_flags().

Referenced by set_status_flags().

Here is the call graph for this function:
Here is the caller graph for this function:

## unlock_all_locks()

virtual int L4Re::Vfs::Generic_file::unlock_all_locks | ( |  | ) |

pure virtualnoexcept

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.

Implemented in L4Re::Vfs::Be_file.

References unlock_all_locks().

Referenced by unlock_all_locks().

Here is the call graph for this function:
Here is the caller graph for this function:

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

- l4/l4re_vfs/vfs.h