Loading...
Searching...
No Matches
vfs.h
/*
* (c) 2010 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
* Alexander Warg <warg@os.inf.tu-dresden.de>
* economic rights: Technische Universität Dresden (Germany)
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include <l4/sys/compiler.h>
#include <unistd.h>
#include <stdarg.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/socket.h>
#include <utime.h>
#include <errno.h>
#ifndef AT_FDCWD
# define AT_FDCWD -100
#endif
#ifdef __cplusplus
#include <l4/sys/capability>
#include <l4/re/cap_alloc>
#include <l4/re/dataspace>
#include <l4/cxx/pair>
#include <l4/cxx/ref_ptr>
namespace L4Re {
namespace Vfs {
class Mount_tree;
class File;
class Generic_file
{
public:
enum Ready_type : unsigned
{
Read = 0,
Write,
Exception
};
virtual ~Generic_file() noexcept = 0;
virtual int unlock_all_locks() noexcept = 0;
virtual int fstat(struct stat64 *buf) const noexcept = 0;
virtual int fchmod(mode_t) noexcept = 0;
virtual int get_status_flags() const noexcept = 0;
virtual int set_status_flags(long flags) noexcept = 0;
virtual int utime(const struct utimbuf *) noexcept = 0;
virtual int utimes(const struct timeval [2]) noexcept = 0;
virtual ssize_t readlink(char *, size_t) = 0;
virtual bool check_ready(Ready_type rt) noexcept = 0;
};
inline
Generic_file::~Generic_file() noexcept
{}
class Directory
{
public:
virtual ~Directory() noexcept = 0;
virtual int faccessat(const char *path, int mode, int flags) noexcept = 0;
virtual int mkdir(const char *path, mode_t mode) noexcept = 0;
virtual int unlink(const char *path) noexcept = 0;
virtual int rename(const char *src_path, const char *dst_path) noexcept = 0;
virtual int link(const char *src_path, const char *dst_path) noexcept = 0;
virtual int symlink(const char *src_path, const char *dst_path) noexcept = 0;
virtual int rmdir(const char *path) noexcept = 0;
virtual int openat(const char *path, int flags, mode_t mode,
cxx::Ref_ptr<File> *f) noexcept = 0;
virtual ssize_t getdents(char *buf, size_t sizebytes) noexcept = 0;
virtual int fchmodat(const char *pathname,
mode_t mode, int flags) noexcept = 0;
virtual int utimensat(const char *pathname,
const struct timespec times[2], int flags) noexcept = 0;
virtual int get_entry(const char *, int, mode_t, cxx::Ref_ptr<File> *) noexcept = 0;
};
inline
Directory::~Directory() noexcept
{}
class Regular_file
{
public:
virtual ~Regular_file() noexcept = 0;
virtual L4::Cap<L4Re::Dataspace> data_space() noexcept = 0;
virtual ssize_t readv(const struct iovec*, int iovcnt) noexcept = 0;
virtual ssize_t writev(const struct iovec*, int iovcnt) noexcept = 0;
virtual ssize_t preadv(const struct iovec *iov, int iovcnt, off64_t offset) noexcept = 0;
virtual ssize_t pwritev(const struct iovec *iov, int iovcnt, off64_t offset) noexcept = 0;
virtual off64_t lseek(off64_t, int) noexcept = 0;
virtual int ftruncate(off64_t pos) noexcept = 0;
virtual int fsync() const noexcept = 0;
virtual int fdatasync() const noexcept = 0;
virtual int get_lock(struct flock64 *lock) noexcept = 0;
virtual int set_lock(struct flock64 *lock, bool wait) noexcept = 0;
};
inline
Regular_file::~Regular_file() noexcept
{}
class Socket
{
public:
virtual ~Socket() noexcept = 0;
virtual int bind(sockaddr const *, socklen_t) noexcept = 0;
virtual int connect(sockaddr const *, socklen_t) noexcept = 0;
virtual ssize_t send(void const *, size_t, int) noexcept = 0;
virtual ssize_t recv(void *, size_t, int) noexcept = 0;
virtual ssize_t sendto(void const *, size_t, int, sockaddr const *, socklen_t) noexcept = 0;
virtual ssize_t recvfrom(void *, size_t, int, sockaddr *, socklen_t *) noexcept = 0;
virtual ssize_t sendmsg(msghdr const *, int) noexcept = 0;
virtual ssize_t recvmsg(msghdr *, int) noexcept = 0;
virtual int getsockopt(int level, int opt, void *, socklen_t *) noexcept = 0;
virtual int setsockopt(int level, int opt, void const *, socklen_t) noexcept = 0;
virtual int listen(int) noexcept = 0;
virtual int accept(sockaddr *addr, socklen_t *) noexcept = 0;
virtual int shutdown(int) noexcept = 0;
virtual int getsockname(sockaddr *, socklen_t *) noexcept = 0;
virtual int getpeername(sockaddr *, socklen_t *) noexcept = 0;
};
inline
Socket::~Socket() noexcept
{}
class Special_file
{
public:
virtual ~Special_file() noexcept = 0;
virtual int ioctl(unsigned long cmd, va_list args) noexcept = 0;
};
inline
Special_file::~Special_file() noexcept
{}
class File :
public Generic_file,
public Regular_file,
public Directory,
public Special_file,
public Socket
{
friend class Mount_tree;
private:
void operator = (File const &);
protected:
File() noexcept : _ref_cnt(0) {}
File(File const &)
: Generic_file(),Regular_file(), Directory(), Special_file(), _ref_cnt(0)
{}
public:
const char *get_mount(const char *path, cxx::Ref_ptr<File> *dir,
cxx::Ref_ptr<Mount_tree> *mt = 0) noexcept;
int openat(const char *path, int flags, mode_t mode,
cxx::Ref_ptr<File> *f) noexcept override;
void add_ref() noexcept { ++_ref_cnt; }
int remove_ref() noexcept { return --_ref_cnt; }
virtual ~File() noexcept = 0;
cxx::Ref_ptr<Mount_tree> mount_tree() const noexcept
{ return _mount_tree; }
char const *path() const noexcept { return _path; }
private:
int _ref_cnt;
cxx::Ref_ptr<Mount_tree> _mount_tree;
char _path[80] = "";
};
inline
File::~File() noexcept
{}
class Path
{
private:
char const *_p;
unsigned _l;
public:
Path() noexcept : _p(0), _l(0) {}
explicit Path(char const *p) noexcept : _p(p)
{ for (_l = 0; *p; ++p, ++_l) ; }
Path(char const *p, unsigned l) noexcept : _p(p), _l(l)
{}
static bool __is_sep(char s) noexcept;
Path cmp_path(char const *prefix) const noexcept;
struct Invalid_ptr;
operator Invalid_ptr const * () const
{ return reinterpret_cast<Invalid_ptr const *>(_p); }
unsigned length() const { return _l; }
char const *path() const { return _p; }
bool empty() const { return _l == 0; }
bool is_sep(unsigned offset) const { return __is_sep(_p[offset]); }
bool strip_sep()
{
bool s = false;
for (; __is_sep(*_p) && _l; ++_p, --_l)
s = true;
return s;
}
Path first() const
{
unsigned i;
for (i = 0; i < _l && !is_sep(i); ++i)
;
return Path(_p, i);
}
Path strip_first()
{
Path r = first();
_p += r.length();
_l -= r.length();
strip_sep();
return r;
}
};
class Mount_tree
{
public:
explicit Mount_tree(char *n) noexcept;
Path lookup(Path const &path, cxx::Ref_ptr<Mount_tree> *mt,
cxx::Ref_ptr<Mount_tree> *mp = 0) noexcept;
Path find(Path const &p, cxx::Ref_ptr<Mount_tree> *t) noexcept;
cxx::Ref_ptr<File> mount() const
{ return _mount; }
void mount(cxx::Ref_ptr<File> const &m)
{
m->_mount_tree = cxx::ref_ptr(this);
_mount = m;
}
static int create_tree(cxx::Ref_ptr<Mount_tree> const &root,
char const *path,
cxx::Ref_ptr<File> const &dir) noexcept;
void add_child_node(cxx::Ref_ptr<Mount_tree> const &cld);
virtual ~Mount_tree() noexcept = 0;
void add_ref() noexcept { ++_ref_cnt; }
int remove_ref() noexcept { return --_ref_cnt; }
private:
friend class Real_mount_tree;
int _ref_cnt;
char *_name;
cxx::Ref_ptr<Mount_tree> _cld;
cxx::Ref_ptr<Mount_tree> _sib;
cxx::Ref_ptr<File> _mount;
};
inline
Mount_tree::~Mount_tree() noexcept
{}
inline bool
Path::__is_sep(char s) noexcept
{ return s == '/'; }
inline Path
Path::cmp_path(char const *n) const noexcept
{
char const *p = _p;
for (; *p && !__is_sep(*p) && *n; ++p, ++n)
if (*p != *n)
return Path();
if (*n || (*p && !__is_sep(*p)))
return Path();
return Path(p, _l - (p - _p));
}
inline
Mount_tree::Mount_tree(char *n) noexcept
: _ref_cnt(0), _name(n)
{}
inline Path
Mount_tree::find(Path const &p, cxx::Ref_ptr<Mount_tree> *t) noexcept
{
if (!_cld)
return Path();
for (cxx::Ref_ptr<Mount_tree> x = _cld; x; x = x->_sib)
{
Path const r = p.cmp_path(x->_name);
if (r)
{
*t = x;
return r;
}
}
return Path();
}
inline Path
Mount_tree::lookup(Path const &path, cxx::Ref_ptr<Mount_tree> *mt,
cxx::Ref_ptr<Mount_tree> *mp) noexcept
{
cxx::Ref_ptr<Mount_tree> x(this);
Path p = path;
if (p.first().cmp_path("."))
p.strip_first();
Path last_mp = p;
if (mp)
*mp = x;;
while (1)
{
Path r = x->find(p, &x);
if (!r)
{
if (mp)
return last_mp;
if (mt)
*mt = x;
return p;
}
r.strip_sep();
if (mp && x->_mount)
{
last_mp = r;
*mp = x;
}
if (r.empty())
{
if (mt)
*mt = x;
if (mp)
return last_mp;
else
return r;
}
p = r;
}
}
inline
void
Mount_tree::add_child_node(cxx::Ref_ptr<Mount_tree> const &cld)
{
cld->_sib = _cld;
_cld = cld;
}
inline
const char *
File::get_mount(const char *path, cxx::Ref_ptr<File> *dir,
cxx::Ref_ptr<Mount_tree> *mt) noexcept
{
if (!_mount_tree)
{
*dir = cxx::ref_ptr(this);
return path;
}
cxx::Ref_ptr<Mount_tree> mp;
Path p = _mount_tree->lookup(Path(path), mt, &mp);
if (mp->mount())
{
*dir = mp->mount();
return p.path();
}
else
{
*dir = cxx::ref_ptr(this);
return path;
}
}
inline int
File::openat(const char *path, int flags, mode_t mode,
cxx::Ref_ptr<File> *f) noexcept
{
cxx::Ref_ptr<File> dir;
cxx::Ref_ptr<Mount_tree> mt;
char const *m_path = get_mount(path, &dir, &mt);
int res = dir->get_entry(m_path, flags, mode, f);
if (res < 0)
return res;
if (!(*f)->_mount_tree && mt)
(*f)->_mount_tree = mt;
// Debugging {
size_t i = 0;
for (; i < sizeof((*f)->_path) - 1 && path[i]; ++i)
(*f)->_path[i] = path[i];
(*f)->_path[i] = '\0';
// } Debugging
return res;
}
class Mman
{
public:
virtual int mmap2(void *start, size_t len, int prot, int flags, int fd,
off_t offset, void **ptr) noexcept = 0;
virtual int munmap(void *start, size_t len) noexcept = 0;
virtual int mremap(void *old, size_t old_sz, size_t new_sz, int flags,
void **new_addr) noexcept = 0;
virtual int mprotect(const void *a, size_t sz, int prot) noexcept = 0;
virtual int msync(void *addr, size_t len, int flags) noexcept = 0;
virtual int madvise(void *addr, size_t len, int advice) noexcept = 0;
virtual ~Mman() noexcept = 0;
};
inline
Mman::~Mman() noexcept {}
class File_factory
{
private:
int _ref_cnt = 0;
int _proto = 0;
char const *_proto_name = 0;
template<typename T> friend struct cxx::Default_ref_counter;
void add_ref() noexcept { ++_ref_cnt; }
int remove_ref() noexcept { return --_ref_cnt; }
public:
explicit File_factory(int proto) : _proto(proto) {}
explicit File_factory(char const *proto_name) : _proto_name(proto_name) {}
File_factory(int proto, char const *proto_name)
: _proto(proto), _proto_name(proto_name)
{}
File_factory(File_factory const &) = delete;
File_factory &operator = (File_factory const &) = delete;
char const *proto_name() const { return _proto_name; }
int proto() const { return _proto; }
virtual ~File_factory() noexcept = 0;
virtual cxx::Ref_ptr<File> create(L4::Cap<void> file) = 0;
};
inline File_factory::~File_factory() noexcept {}
template<typename IFACE, typename IMPL>
class File_factory_t : public File_factory
{
public:
File_factory_t()
: File_factory(IFACE::Protocol, L4::kobject_typeid<IFACE>()->name())
{}
cxx::Ref_ptr<File> create(L4::Cap<void> file) override
{ return cxx::make_ref_obj<IMPL>(L4::cap_cast<IFACE>(file)); }
};
class File_system
{
protected:
File_system *_next;
public:
File_system() noexcept : _next(0) {}
virtual char const *type() const noexcept = 0;
virtual int mount(char const *source, unsigned long mountflags,
void const *data, cxx::Ref_ptr<File> *dir) noexcept = 0;
virtual ~File_system() noexcept = 0;
File_system *next() const noexcept { return _next; }
File_system *&next() noexcept { return _next; }
void next(File_system *n) noexcept { _next = n; }
};
inline
File_system::~File_system() noexcept
{}
class File_system_list
{
public:
class Iterator
{
public:
explicit constexpr Iterator(File_system *c = nullptr) : _c(c) {}
Iterator &operator++()
{
if (_c)
_c = _c->next();
return *this;
}
bool operator==(Iterator const &other) const { return _c == other._c; }
bool operator!=(Iterator const &other) const { return _c != other._c; }
File_system *operator*() const { return _c; }
File_system *operator->() const { return _c; }
private:
File_system *_c;
};
File_system_list(File_system *head) : _head(head) {}
constexpr Iterator begin() const
{ return Iterator(_head); }
constexpr Iterator end() const
{ return Iterator(); }
private:
File_system *_head;
};
class Fs
{
public:
virtual cxx::Ref_ptr<File> get_file(int fd) noexcept = 0;
virtual cxx::Ref_ptr<File> get_root() noexcept = 0;
virtual cxx::Ref_ptr<File> get_cwd() noexcept { return get_root(); }
virtual void set_cwd(cxx::Ref_ptr<File> const &) noexcept {}
virtual int alloc_fd(cxx::Ref_ptr<File> const &f = cxx::Ref_ptr<>::Nil) noexcept = 0;
virtual cxx::Pair<cxx::Ref_ptr<File>, int>
set_fd(int fd, cxx::Ref_ptr<File> const &f = cxx::Ref_ptr<>::Nil) noexcept = 0;
virtual cxx::Ref_ptr<File> free_fd(int fd) noexcept = 0;
virtual int mount(char const *path, cxx::Ref_ptr<File> const &dir) noexcept = 0;
virtual int register_file_system(File_system *f) noexcept = 0;
virtual int unregister_file_system(File_system *f) noexcept = 0;
virtual File_system *get_file_system(char const *fstype) noexcept = 0;
virtual File_system_list file_system_list() noexcept = 0;
int mount(char const *source, char const *target,
char const *fstype, unsigned long mountflags,
void const *data) noexcept;
virtual int register_file_factory(cxx::Ref_ptr<File_factory> f) noexcept = 0;
virtual int unregister_file_factory(cxx::Ref_ptr<File_factory> f) noexcept = 0;
virtual cxx::Ref_ptr<File_factory> get_file_factory(int proto) noexcept = 0;
virtual cxx::Ref_ptr<File_factory> get_file_factory(char const *proto_name) noexcept = 0;
virtual ~Fs() = 0;
private:
int mount_one(char const *source, char const *target,
File_system *fs, unsigned long mountflags,
void const *data) noexcept;
};
inline int
Fs::mount_one(char const *source, char const *target,
File_system *fs, unsigned long mountflags,
void const *data) noexcept
{
cxx::Ref_ptr<File> dir;
int res = fs->mount(source, mountflags, data, &dir);
if (res < 0)
return res;
return mount(target, dir);
}
inline int
Fs::mount(char const *source, char const *target,
char const *fstype, unsigned long mountflags,
void const *data) noexcept
{
if ( fstype[0] == 'a'
&& fstype[1] == 'u'
&& fstype[2] == 't'
&& fstype[3] == 'o'
&& fstype[4] == 0)
{
File_system_list fsl = file_system_list();
for (File_system_list::Iterator c = fsl.begin(); c != fsl.end(); ++c)
if (mount_one(source, target, *c, mountflags, data) == 0)
return 0;
return -ENODEV;
}
File_system *fs = get_file_system(fstype);
if (!fs)
return -ENODEV;
return mount_one(source, target, fs, mountflags, data);
}
inline
Fs::~Fs()
{}
class Ops : public Mman, public Fs
{
public:
virtual void *malloc(size_t bytes) noexcept = 0;
virtual void free(void *mem) noexcept = 0;
virtual ~Ops() noexcept = 0;
char *strndup(char const *str, unsigned l) noexcept
{
unsigned len;
for (len = 0; str[len] && len < l; ++len)
;
if (len == 0)
return nullptr;
++len;
char *b = static_cast<char *>(this->malloc(len));
if (b == nullptr)
return nullptr;
char *r = b;
for (; len - 1 > 0 && *str; --len, ++b, ++str)
*b = *str;
*b = 0;
return r;
}
};
inline
Ops::~Ops() noexcept
{}
}}
#endif
cap_alloc
Abstract capability-allocator interface.
capability
L4::Cap related definitions.
L4Re::Vfs::Directory
Interface for a POSIX file that is a directory.
Definition vfs.h:161
L4Re::Vfs::Directory::mkdir
virtual int mkdir(const char *path, mode_t mode) noexcept=0
Create a new subdirectory.
L4Re::Vfs::Directory::link
virtual int link(const char *src_path, const char *dst_path) noexcept=0
Create a hard link (second name) for the given file.
L4Re::Vfs::Directory::unlink
virtual int unlink(const char *path) noexcept=0
Unlink the given file from that directory.
L4Re::Vfs::Directory::symlink
virtual int symlink(const char *src_path, const char *dst_path) noexcept=0
Create a symbolic link for the given file.
L4Re::Vfs::Directory::rmdir
virtual int rmdir(const char *path) noexcept=0
Delete an empty directory.
L4Re::Vfs::Directory::rename
virtual int rename(const char *src_path, const char *dst_path) noexcept=0
Rename the given file.
L4Re::Vfs::Directory::faccessat
virtual int faccessat(const char *path, int mode, int flags) noexcept=0
Check access permissions on the given file.
L4Re::Vfs::File_system
Basic interface for an L4Re::Vfs file system.
Definition vfs.h:858
L4Re::Vfs::File_system::type
virtual char const * type() const noexcept=0
Returns the type of the file system used in mount as fstype argument.
L4Re::Vfs::File_system::mount
virtual int mount(char const *source, unsigned long mountflags, void const *data, cxx::Ref_ptr< File > *dir) noexcept=0
Create a directory object dir representing source mounted with this file system.
L4Re::Vfs::File
The basic interface for an open POSIX file.
Definition vfs.h:461
L4Re::Vfs::Fs
POSIX File-system related functionality.
Definition vfs.h:947
L4Re::Vfs::Fs::set_cwd
virtual void set_cwd(cxx::Ref_ptr< File > const &) noexcept
Set the current working directory for the application.
Definition vfs.h:963
L4Re::Vfs::Fs::mount
virtual int mount(char const *path, cxx::Ref_ptr< File > const &dir) noexcept=0
Mount a given file object at the given global path in the VFS.
L4Re::Vfs::Fs::get_file
virtual cxx::Ref_ptr< File > get_file(int fd) noexcept=0
Get the L4Re::Vfs::File for the file descriptor fd.
L4Re::Vfs::Fs::free_fd
virtual cxx::Ref_ptr< File > free_fd(int fd) noexcept=0
Free the file descriptor fd.
L4Re::Vfs::Fs::set_fd
virtual cxx::Pair< cxx::Ref_ptr< File >, int > set_fd(int fd, cxx::Ref_ptr< File > const &f=cxx::Ref_ptr<>::Nil) noexcept=0
Set the file object referenced by the file descriptor fd.
L4Re::Vfs::Fs::alloc_fd
virtual int alloc_fd(cxx::Ref_ptr< File > const &f=cxx::Ref_ptr<>::Nil) noexcept=0
Allocate the next free file descriptor.
L4Re::Vfs::Fs::get_root
virtual cxx::Ref_ptr< File > get_root() noexcept=0
Get the directory object for the application's root directory.
L4Re::Vfs::Fs::get_cwd
virtual cxx::Ref_ptr< File > get_cwd() noexcept
Get the directory object for the application's current working directory.
Definition vfs.h:960
L4Re::Vfs::Generic_file
The common interface for an open POSIX file.
Definition vfs.h:53
L4Re::Vfs::Generic_file::unlock_all_locks
virtual int unlock_all_locks() noexcept=0
Unlock all locks on the file.
L4Re::Vfs::Generic_file::fchmod
virtual int fchmod(mode_t) noexcept=0
Change POSIX access rights on the file.
L4Re::Vfs::Generic_file::fstat
virtual int fstat(struct stat64 *buf) const noexcept=0
Get status information for the file.
L4Re::Vfs::Generic_file::set_status_flags
virtual int set_status_flags(long flags) noexcept=0
Set file status flags (fcntl F_SETFL).
L4Re::Vfs::Generic_file::Ready_type
Ready_type
Type of I/O operation/condition a file can indicate readiness.
Definition vfs.h:61
L4Re::Vfs::Generic_file::check_ready
virtual bool check_ready(Ready_type rt) noexcept=0
Check whether the file is ready for an I/O operation/condition.
L4Re::Vfs::Generic_file::get_status_flags
virtual int get_status_flags() const noexcept=0
Get file status flags (fcntl F_GETFL).
L4Re::Vfs::Mman
Interface for POSIX memory management.
Definition vfs.h:774
L4Re::Vfs::Mman::mmap2
virtual int mmap2(void *start, size_t len, int prot, int flags, int fd, off_t offset, void **ptr) noexcept=0
Backend for the mmap2 system call.
L4Re::Vfs::Mman::msync
virtual int msync(void *addr, size_t len, int flags) noexcept=0
Backend for the msync system call.
L4Re::Vfs::Mman::munmap
virtual int munmap(void *start, size_t len) noexcept=0
Backend for the munmap system call.
L4Re::Vfs::Mman::mremap
virtual int mremap(void *old, size_t old_sz, size_t new_sz, int flags, void **new_addr) noexcept=0
Backend for the mremap system call.
L4Re::Vfs::Mman::madvise
virtual int madvise(void *addr, size_t len, int advice) noexcept=0
Backend for the madvice system call.
L4Re::Vfs::Mman::mprotect
virtual int mprotect(const void *a, size_t sz, int prot) noexcept=0
Backend for the mprotect system call.
L4Re::Vfs::Ops
Interface for the POSIX backends of an application.
Definition vfs.h:1110
L4Re::Vfs::Regular_file
Interface for a POSIX file that provides regular file semantics.
Definition vfs.h:288
L4Re::Vfs::Regular_file::writev
virtual ssize_t writev(const struct iovec *, int iovcnt) noexcept=0
Write one or more blocks of data to the file.
L4Re::Vfs::Regular_file::data_space
virtual L4::Cap< L4Re::Dataspace > data_space() noexcept=0
Get an L4Re::Dataspace object for the file.
L4Re::Vfs::Regular_file::readv
virtual ssize_t readv(const struct iovec *, int iovcnt) noexcept=0
Read one or more blocks of data from the file.
L4Re::Vfs::Regular_file::fdatasync
virtual int fdatasync() const noexcept=0
Sync the data to persistent storage.
L4Re::Vfs::Regular_file::fsync
virtual int fsync() const noexcept=0
Sync the data and meta data to persistent storage.
L4Re::Vfs::Regular_file::lseek
virtual off64_t lseek(off64_t, int) noexcept=0
Change the file pointer.
L4Re::Vfs::Regular_file::get_lock
virtual int get_lock(struct flock64 *lock) noexcept=0
Test if the given lock can be placed in the file.
L4Re::Vfs::Regular_file::ftruncate
virtual int ftruncate(off64_t pos) noexcept=0
Truncate the file at the given position.
L4Re::Vfs::Regular_file::set_lock
virtual int set_lock(struct flock64 *lock, bool wait) noexcept=0
Acquire or release the given lock on the file.
L4Re::Vfs::Special_file
Interface for a POSIX file that provides special file semantics.
Definition vfs.h:421
L4Re::Vfs::Special_file::ioctl
virtual int ioctl(unsigned long cmd, va_list args) noexcept=0
The famous IO control.
L4::Cap
C++ interface for capabilities.
Definition capability.h:224
cxx::Ref_ptr
A reference-counting pointer with automatic cleanup.
Definition ref_ptr:71
compiler.h
L4 compiler related defines.
dataspace
Dataspace interface.
L4::kobject_typeid
Type_info const * kobject_typeid() noexcept
Get the L4::Type_info for the L4Re interface given in T.
Definition __typeinfo.h:682
L4Re::Vfs
Virtual file system for interfaces in POSIX libc.
Definition backend:16
L4Re
L4Re C++ Interfaces.
Definition cmd_control:14
L4::cap_cast
Cap< T > cap_cast(Cap< F > const &c) noexcept
static_cast for capabilities.
Definition capability.h:416
cxx
Our C++ library.
Definition arith:11
pair
Pair implementation.
cxx::Pair
Pair of two values.
Definition pair:28