22 #include <sys/ioctl.h> 26 namespace L4Re {
namespace Core {
28 Ro_file::~Ro_file() throw()
33 L4Re::virt_cap_alloc->release(_ds);
37 Ro_file::fstat64(
struct stat64 *buf)
const throw()
41 memset(buf, 0,
sizeof(*buf));
43 buf->st_mode = S_IFREG | 0644;
44 buf->st_dev = _ds.cap();
52 Ro_file::read_single(
const struct iovec *vec, off64_t pos)
throw()
54 off64_t l = vec->iov_len;
60 Vfs_config::memcpy(vec->iov_base, _addr + pos, l);
68 Ro_file::preadv(
const struct iovec *vec,
int cnt, off64_t offset)
throw()
80 _addr = (
char const *)file;
87 ssize_t r = read_single(vec, offset);
91 if ((
size_t)r < vec->iov_len)
101 Ro_file::pwritev(
const struct iovec *,
int, off64_t)
throw()
107 Ro_file::ioctl(
unsigned long v, va_list args)
throw()
112 int *available = va_arg(args,
int *);
113 *available = _size - pos();
l4_addr_t l4_round_page(l4_addr_t address) L4_NOTHROW
Round address up to the next page.
Search for a suitable address range.
#define L4_PAGESIZE
Minimal page size (in bytes).
static Env const * env()
Returns the initial environment for the current task.
unsigned long l4_addr_t
Address type.
L4::Cap< Rm > rm() const
Object-capability to the region map.