Lines Matching refs:h
53 int close_internal(const native_handle_t* h, bool allowUntagged) { in close_internal() argument
54 if (!h) return 0; in close_internal()
56 if (h->version != sizeof(native_handle_t)) return -EINVAL; in close_internal()
58 const int numFds = h->numFds; in close_internal()
60 if (allowUntagged && numFds > 0 && android_fdsan_get_owner_tag(h->data[0]) == 0) { in close_internal()
63 tag = get_fdsan_tag(h); in close_internal()
67 android_fdsan_close_with_tag(h->data[i], tag); in close_internal()
107 native_handle_t* h = static_cast<native_handle_t*>(malloc(mallocSize)); in native_handle_create() local
108 if (h) { in native_handle_create()
109 h->version = sizeof(native_handle_t); in native_handle_create()
110 h->numFds = numFds; in native_handle_create()
111 h->numInts = numInts; in native_handle_create()
113 return h; in native_handle_create()
144 int native_handle_delete(native_handle_t* h) { in native_handle_delete() argument
145 if (h) { in native_handle_delete()
146 if (h->version != sizeof(native_handle_t)) return -EINVAL; in native_handle_delete()
147 free(h); in native_handle_delete()
152 int native_handle_close(const native_handle_t* h) { in native_handle_close() argument
153 return close_internal(h, /*allowUntagged=*/true); in native_handle_close()
156 int native_handle_close_with_tag(const native_handle_t* h) { in native_handle_close_with_tag() argument
157 return close_internal(h, /*allowUntagged=*/false); in native_handle_close_with_tag()