11namespace L4Re {
namespace Util {
20 explicit Env_ns(Env
const *env =
Env::env(),
22 : _ca(ca), _env(env) {}
26 l4_umword_t *local_id = 0,
bool iterate =
true) const noexcept
31 if (len && name[0] ==
'/')
38 for (; len && *n !=
'/'; ++n, --len)
41 Cap_entry
const *e = _env->get(name, n - name);
45 if (len > 0 && *n ==
'/')
53 long r = ns->query(n + 1, len - 1, cap, timeout, local_id, iterate);
67 l4_umword_t *local_id = 0,
bool iterate =
true) const noexcept
68 {
return query(name, __builtin_strlen(name), timeout, local_id, iterate); }
73 l4_umword_t *local_id = 0,
bool iterate =
true) const noexcept
75 return L4::cap_cast<T>(query(name, __builtin_strlen(name),
76 timeout, local_id, iterate));
Abstract capability-allocator interface.
Capability allocator interface.
virtual L4::Cap< void > alloc() noexcept=0
Allocate a capability.
static L4Re::Cap_alloc * get_cap_alloc(CAP_ALLOC &ca)
Construct an instance of a capability allocator.
virtual void free(L4::Cap< void > cap, l4_cap_idx_t task=L4_INVALID_CAP, unsigned unmap_flags=L4_FP_ALL_SPACES) noexcept=0
Free a capability.
static Env const * env() noexcept
Returns the initial environment for the current task.
l4re_env_cap_entry_t Cap_entry
C++ type for an entry in the initial objects array.
@ To_default
Default timeout.
bool is_valid() const noexcept
Test whether the capability is a valid capability index (i.e., not L4_INVALID_CAP).
C++ interface for capabilities.
unsigned long l4_umword_t
Unsigned machine word.
@ L4_ENOENT
No such entity.
_Cap_alloc & cap_alloc
Capability allocator.