Provide is_resource_attr_interested function to check whether
some attribute id is already interested or not. It will be
used as internal function for libpass-resource-monitor
and capi-resource-monitor.
Change-Id: I1cdac2eab2672869cfa98069fc7d958c4da4dc93
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
int set_resource_attr_interest(struct resource *resource, u_int64_t interest_mask);
int unset_resource_attr_interest(struct resource *resource, u_int64_t interest_mask);
+bool is_resource_attr_interested(struct resource *resource, u_int64_t interest_mask);
inline __attribute__((always_inline)) int64_t get_time_now(void)
{
return 0;
}
+
+bool is_resource_attr_interested(struct resource *resource, u_int64_t interest_mask)
+{
+ if (!resource)
+ return false;
+
+ if (resource->attr_interest != (resource->attr_interest | interest_mask))
+ return false;
+
+ return true;
+}