Lines Matching refs:handle

48 uint64_t get_fdsan_tag(const native_handle_t* handle) {  in get_fdsan_tag()  argument
50 reinterpret_cast<uint64_t>(handle)); in get_fdsan_tag()
73 void swap_fdsan_tags(const native_handle_t* handle, uint64_t expected_tag, uint64_t new_tag) { in swap_fdsan_tags() argument
74 if (!handle || handle->version != sizeof(native_handle_t)) return; in swap_fdsan_tags()
76 for (int i = 0; i < handle->numFds; i++) { in swap_fdsan_tags()
78 if (android_fdsan_get_owner_tag(handle->data[i]) != new_tag) { in swap_fdsan_tags()
79 android_fdsan_exchange_owner_tag(handle->data[i], expected_tag, new_tag); in swap_fdsan_tags()
92 native_handle_t* handle = (native_handle_t*)storage; in native_handle_init() local
93 handle->version = sizeof(native_handle_t); in native_handle_init()
94 handle->numFds = numFds; in native_handle_init()
95 handle->numInts = numInts; in native_handle_init()
96 return handle; in native_handle_init()
116 void native_handle_set_fdsan_tag(const native_handle_t* handle) { in native_handle_set_fdsan_tag() argument
117 swap_fdsan_tags(handle, 0, get_fdsan_tag(handle)); in native_handle_set_fdsan_tag()
120 void native_handle_unset_fdsan_tag(const native_handle_t* handle) { in native_handle_unset_fdsan_tag() argument
121 swap_fdsan_tags(handle, get_fdsan_tag(handle), 0); in native_handle_unset_fdsan_tag()
124 native_handle_t* native_handle_clone(const native_handle_t* handle) { in native_handle_clone() argument
125 native_handle_t* clone = native_handle_create(handle->numFds, handle->numInts); in native_handle_clone()
128 for (int i = 0; i < handle->numFds; i++) { in native_handle_clone()
129 clone->data[i] = dup(handle->data[i]); in native_handle_clone()
138 memcpy(&clone->data[handle->numFds], &handle->data[handle->numFds], in native_handle_clone()
139 sizeof(int) * handle->numInts); in native_handle_clone()