MCPcopy Create free account
hub / github.com/F-Stack/f-stack / right_to_index

Function right_to_index

freebsd/kern/subr_capability.c:160–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158#define CAPARSIZE_MAX (CAP_RIGHTS_VERSION + 2)
159
160static __inline int
161right_to_index(uint64_t right)
162{
163 static const int bit2idx[] = {
164 -1, 0, 1, -1, 2, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1,
165 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
166 };
167 int idx;
168
169 idx = CAPIDXBIT(right);
170 assert(idx >= 0 && idx < sizeof(bit2idx) / sizeof(bit2idx[0]));
171 return (bit2idx[idx]);
172}
173
174static void
175cap_rights_vset(cap_rights_t *rights, va_list ap)

Callers 4

cap_rights_vsetFunction · 0.85
cap_rights_vclearFunction · 0.85
cap_rights_is_vsetFunction · 0.85
cap_rights_is_validFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected