+#ifdef BSD_KERNEL_PRIVATE
+
+#include <os/refcnt.h> /* for struct os_refcnt pl_refcnt */
+
+/*
+ * Kernel shareable process resource limits:
+ * Because this structure is moderately large but changed infrequently, it is normally
+ * shared copy-on-write after a fork. The pl_refcnt variable records the number of
+ * "processes" (NOT threads) currently sharing the plimit. A plimit is freed when the
+ * last referencing process exits the system. The refcnt of the plimit is a race-free
+ * _Atomic variable. We allocate new plimits in proc_limitupdate and free them
+ * in proc_limitdrop/proc_limitupdate.
+ */
+struct plimit {
+ struct rlimit pl_rlimit[RLIM_NLIMITS];
+ os_refcnt_t pl_refcnt; /* number of processes using this plimit */
+};
+
+extern rlim_t proc_limitgetcur(proc_t p, int which, boolean_t to_lock_proc);
+extern void proc_limitsetcur_internal(proc_t p, int which, rlim_t value);
+extern struct proc proc0;
+#endif /* BSD_KERNEL_PRIVATE */
+