L4Re - L4 Runtime Environment
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 ()=0 throw ()
 Unlock all locks on the file. More...
 
virtual int fstat64 (struct stat64 *buf) const =0 throw ()
 Get status information for the file. More...
 
virtual int fchmod (mode_t)=0 throw ()
 Change POSIX access rights on that file. More...
 
virtual int get_status_flags () const =0 throw ()
 Get file status flags (fcntl F_GETFL). More...
 
virtual int set_status_flags (long flags)=0 throw ()
 Set file status flags (fcntl F_SETFL). More...
 

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 mor information.

Definition at line 61 of file vfs.h.

Member Function Documentation

◆ fchmod()

virtual int L4Re::Vfs::Generic_file::fchmod ( mode_t  )
throw (
)
pure virtual

Change POSIX access rights on that 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
throw (
)
pure virtual

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
throw (
)
pure virtual

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)
throw (
)
pure virtual

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 ( )
throw (
)
pure virtual

Unlock all locks on the file.

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

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: