L4Re Operating System Framework
Interface and Usage Documentation
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 Member Functions

virtual int unlock_all_locks () noexcept=0
 Unlock all locks on the file.
 
virtual int fstat64 (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).
 

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 62 of file vfs.h.

Member Function Documentation

◆ 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.

◆ fstat64()

virtual int L4Re::Vfs::Generic_file::fstat64 ( 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]bufThis buffer is filled with the status information.
Returns
0 on success, or <0 on error.

Implemented in L4Re::Vfs::Be_file.

◆ 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.

◆ 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
flagsThe 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.

◆ 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.


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