16namespace L4Re {
namespace Core {
18Ds_file::~Ds_file() noexcept
23 L4Re::virt_cap_alloc->release(_ds);
31 memset(buf, 0,
sizeof(*buf));
33 buf->st_mode = S_IFREG | 0644;
34 buf->st_dev = _ds.cap();
42Ds_file::read_single(
const struct iovec *vec, off64_t pos)
noexcept
47 if (vec->iov_len > SSIZE_MAX)
50 off64_t l = vec->iov_len;
56 Vfs_config::memcpy(vec->iov_base, _addr + pos, l);
64Ds_file::preadv(
const struct iovec *vec,
int cnt, off64_t offset)
noexcept
66 if (cnt < 0 || offset < 0)
91 _addr =
static_cast<char *
>(file);
98 ssize_t r = read_single(vec, offset);
103 return (l == 0) ? r : l;
108 if (
static_cast<size_t>(r) < vec->iov_len)
118Ds_file::write_single(
const struct iovec *vec, off64_t pos)
noexcept
123 if (vec->iov_len > SSIZE_MAX)
128 off64_t l = vec->iov_len;
134 Vfs_config::memcpy(_addr + pos, vec->iov_base, l);
144Ds_file::pwritev(
const struct iovec *vec,
int cnt, off64_t offset)
noexcept
146 if (cnt < 0 || offset < 0)
163 _addr =
static_cast<char *
>(file);
170 ssize_t r = write_single(vec, offset);
175 return (l == 0) ? r : l;
181 if (
static_cast<size_t>(r) < vec->iov_len)
197 int *available = va_arg(args,
int *);
198 *available = _size - pos();
int fstat(struct stat64 *buf) const noexcept override
Get status information for the file.
int ioctl(unsigned long, va_list) noexcept override
The famous IO control.
static Env const * env() noexcept
Returns the initial environment for the current task.
L4::Cap< Rm > rm() const noexcept
Object-capability to the region map.
Capability type for RPC interfaces (see L4::Cap<T>).
unsigned long l4_addr_t
Address type.
l4_addr_t l4_round_page(l4_addr_t address) L4_NOTHROW
Round address up to the next page.
#define L4_PAGESIZE
Minimal page size (in bytes).
Cap< T > make_cap_rw(L4::Cap< T > cap) noexcept
Make an L4::Ipc::Cap<T> for the given capability with L4_CAP_FPAGE_RW rights.
@ RW
Readable and writable region.
@ Search_addr
Search for a suitable address range.
@ Search_addr
Search for a suitable address range.