L4Re - L4 Runtime Environment
L4Re::Vfs::Be_file Class Referenceabstract

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

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

Public Member Functions

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

Member Function Documentation

◆ data_space()

L4::Cap<L4Re::Dataspace> L4Re::Vfs::Be_file::data_space ( ) const
throw (
)
inlinevirtual

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 functions returns an invalid capability.
Returns
A capability to an L4Re::Dataspace, that represents the files contents in an L4Re way.

Implements L4Re::Vfs::Regular_file.

Definition at line 57 of file backend.

◆ fstat64()

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

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

◆ unlock_all_locks()

int L4Re::Vfs::Be_file::unlock_all_locks ( )
throw (
)
inlinevirtual

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.

Implements L4Re::Vfs::Generic_file.

Definition at line 53 of file backend.


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