+ rlim_t rlim_cur; /* current (soft) limit */
+ rlim_t rlim_max; /* maximum value for rlim_cur */
+};
+
+#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
+/*
+ * proc_rlimit_control()
+ *
+ * Resource limit flavors
+ */
+#define RLIMIT_WAKEUPS_MONITOR 0x1 /* Configure the wakeups monitor. */
+#define RLIMIT_CPU_USAGE_MONITOR 0x2 /* Configure the CPU usage monitor. */
+#define RLIMIT_THREAD_CPULIMITS 0x3 /* Configure a blocking, per-thread, CPU limits. */
+#define RLIMIT_FOOTPRINT_INTERVAL 0x4 /* Configure memory footprint interval tracking */
+
+/*
+ * Flags for wakeups monitor control.
+ */
+#define WAKEMON_ENABLE 0x01
+#define WAKEMON_DISABLE 0x02
+#define WAKEMON_GET_PARAMS 0x04
+#define WAKEMON_SET_DEFAULTS 0x08
+#define WAKEMON_MAKE_FATAL 0x10 /* Configure the task so that violations are fatal. */
+
+/*
+ * Flags for CPU usage monitor control.
+ */
+#define CPUMON_MAKE_FATAL 0x1000
+
+/*
+ * Flags for memory footprint interval tracking.
+ */
+#define FOOTPRINT_INTERVAL_RESET 0x1 /* Reset the footprint interval counter to zero */
+
+struct proc_rlimit_control_wakeupmon {
+ uint32_t wm_flags;
+ int32_t wm_rate;
+};
+
+#if PRIVATE
+/*
+ * Flags for I/O monitor control.
+ */
+#define IOMON_ENABLE 0x01
+#define IOMON_DISABLE 0x02
+
+#endif /* PRIVATE */
+
+
+/* I/O type */
+#define IOPOL_TYPE_DISK 0
+#if PRIVATE
+#define IOPOL_TYPE_VFS_HFS_CASE_SENSITIVITY 1
+#endif
+#define IOPOL_TYPE_VFS_ATIME_UPDATES 2
+#define IOPOL_TYPE_VFS_MATERIALIZE_DATALESS_FILES 3
+#define IOPOL_TYPE_VFS_STATFS_NO_DATA_VOLUME 4
+#define IOPOL_TYPE_VFS_TRIGGER_RESOLVE 5
+#define IOPOL_TYPE_VFS_IGNORE_CONTENT_PROTECTION 6
+#define IOPOL_TYPE_VFS_IGNORE_PERMISSIONS 7
+#define IOPOL_TYPE_VFS_SKIP_MTIME_UPDATE 8
+
+/* scope */
+#define IOPOL_SCOPE_PROCESS 0
+#define IOPOL_SCOPE_THREAD 1
+#define IOPOL_SCOPE_DARWIN_BG 2
+
+/* I/O Priority */
+#define IOPOL_DEFAULT 0
+#define IOPOL_IMPORTANT 1
+#define IOPOL_PASSIVE 2
+#define IOPOL_THROTTLE 3
+#define IOPOL_UTILITY 4
+#define IOPOL_STANDARD 5
+
+/* compatibility with older names */
+#define IOPOL_APPLICATION IOPOL_STANDARD
+#define IOPOL_NORMAL IOPOL_IMPORTANT
+
+#if PRIVATE
+#define IOPOL_VFS_HFS_CASE_SENSITIVITY_DEFAULT 0
+#define IOPOL_VFS_HFS_CASE_SENSITIVITY_FORCE_CASE_SENSITIVE 1
+#endif
+
+#define IOPOL_ATIME_UPDATES_DEFAULT 0
+#define IOPOL_ATIME_UPDATES_OFF 1
+
+#define IOPOL_MATERIALIZE_DATALESS_FILES_DEFAULT 0
+#define IOPOL_MATERIALIZE_DATALESS_FILES_OFF 1
+#define IOPOL_MATERIALIZE_DATALESS_FILES_ON 2
+
+#define IOPOL_VFS_STATFS_NO_DATA_VOLUME_DEFAULT 0
+#define IOPOL_VFS_STATFS_FORCE_NO_DATA_VOLUME 1
+
+#define IOPOL_VFS_TRIGGER_RESOLVE_DEFAULT 0
+#define IOPOL_VFS_TRIGGER_RESOLVE_OFF 1
+
+#define IOPOL_VFS_CONTENT_PROTECTION_DEFAULT 0
+#define IOPOL_VFS_CONTENT_PROTECTION_IGNORE 1
+
+#define IOPOL_VFS_IGNORE_PERMISSIONS_OFF 0
+#define IOPOL_VFS_IGNORE_PERMISSIONS_ON 1
+
+#define IOPOL_VFS_SKIP_MTIME_UPDATE_OFF 0
+#define IOPOL_VFS_SKIP_MTIME_UPDATE_ON 1
+
+#ifdef PRIVATE
+/*
+ * Structures for use in communicating via iopolicysys() between Libc and the
+ * kernel. Not to be used by user programs directly.
+ */
+
+/*
+ * the command to iopolicysys()
+ */
+#define IOPOL_CMD_GET 0x00000001 /* Get I/O policy */
+#define IOPOL_CMD_SET 0x00000002 /* Set I/O policy */
+
+/*
+ * Second parameter to iopolicysys()
+ */
+struct _iopol_param_t {
+ int iop_scope; /* current process or a thread */
+ int iop_iotype;
+ int iop_policy;