+typedef int (*proc_iterate_fn_t)(proc_t, void *);
+
+/*
+ * These are the only valid return values of `callout` functions provided to
+ * process iterators.
+ *
+ * CLAIMED returns expect the caller to call proc_rele on the proc. DONE
+ * returns stop iterating processes early.
+ */
+#define PROC_RETURNED (0)
+#define PROC_RETURNED_DONE (1)
+#define PROC_CLAIMED (2)
+#define PROC_CLAIMED_DONE (3)
+
+/*
+ * pgrp_iterate walks the provided process group, calling `filterfn` with
+ * `filterarg` for each process. For processes where `filterfn` returned
+ * non-zero, `callout` is called with `arg`. If `PGRP_DROPREF` is supplied in
+ * `flags`, a reference will be dropped from the process group after obtaining
+ * the list of processes to call `callout` on.
+ *
+ * `PGMEMBERS_FOREACH` might also be used under the pgrp_lock to achieve a
+ * similar effect.
+ */
+#define PGRP_DROPREF (1)
+
+extern int pgrp_iterate(struct pgrp *pgrp, unsigned int flags, proc_iterate_fn_t callout, void *arg, proc_iterate_fn_t filterfn, void *filterarg);
+
+/*
+ * proc_iterate walks the `allproc` and/or `zombproc` lists, calling `filterfn`
+ * with `filterarg` for each process. For processes where `filterfn` returned
+ * non-zero, `callout` is called with `arg`. If the `PROC_NOWAITTRANS` flag is
+ * set, this function waits for transitions.
+ *
+ * `ALLPROC_FOREACH` or `ZOMBPROC_FOREACH` might also be used under the
+ * `proc_list_lock` to achieve a similar effect.
+ */
+#define PROC_ALLPROCLIST (1U << 0) /* walk the allproc list (processes not yet exited) */
+#define PROC_ZOMBPROCLIST (1U << 1) /* walk the zombie list */
+#define PROC_NOWAITTRANS (1U << 2) /* do not wait for transitions (checkdirs only) */
+
+extern int proc_iterate(unsigned int flags, proc_iterate_fn_t callout, void *arg, proc_iterate_fn_t filterfn, void *filterarg);
+
+/*
+ * proc_childrenwalk walks the children of process `p`, calling `callout` for
+ * each one.
+ *
+ * `PCHILDREN_FOREACH` might also be used under the `proc_list_lock` to achieve
+ * a similar effect.
+ */
+extern int proc_childrenwalk(proc_t p, proc_iterate_fn_t callout, void *arg);
+
+/*
+ * proc_rebootscan should only be used by kern_shutdown.c
+ */
+extern void proc_rebootscan(proc_iterate_fn_t callout, void *arg, proc_iterate_fn_t filterfn, void *filterarg);