+int
+work_interval_get_flags_from_port(mach_port_t port, uint32_t *flags)
+{
+ if (!MACH_PORT_VALID(port) || flags == NULL) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ struct work_interval_create_params create_params = { 0 };
+
+ int ret = __work_interval_ctl(WORK_INTERVAL_OPERATION_GET_FLAGS, port,
+ &create_params, sizeof(create_params));
+ if (ret == -1) {
+ return ret;
+ }
+
+ *flags = create_params.wicp_create_flags;
+ return 0;
+}
+