Add a pre-chroot hook
This hook can be used to perform some setup in the mount namespace,
prior to calling chroot(2)/pivot_root(2).
Bug: 65462041
Change-Id: If4399c3642d86a107de4849a328836e9fc0ccdbf
Test: hook is called in the appropriate place
diff --git a/libminijail.h b/libminijail.h
index a783067..15fa124 100644
--- a/libminijail.h
+++ b/libminijail.h
@@ -51,6 +51,9 @@
/* The hook will run just before calling execve(2). */
MINIJAIL_HOOK_EVENT_PRE_EXECVE,
+ /* The hook will run just before calling chroot(2) / pivot_root(2). */
+ MINIJAIL_HOOK_EVENT_PRE_CHROOT,
+
/* Sentinel for error checking. Must be last. */
MINIJAIL_HOOK_EVENT_MAX,
} minijail_hook_event_t;