diff options
Diffstat (limited to 'sys/compat/linux/linux_common.c')
-rw-r--r-- | sys/compat/linux/linux_common.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/sys/compat/linux/linux_common.c b/sys/compat/linux/linux_common.c index 5427b61..3cee92a 100644 --- a/sys/compat/linux/linux_common.c +++ b/sys/compat/linux/linux_common.c @@ -28,13 +28,15 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> -#include <sys/module.h> -#include <sys/malloc.h> -#include <sys/module.h> -#include <sys/types.h> +#include <sys/systm.h> +#include <sys/exec.h> +#include <sys/imgact.h> +#include <sys/imgact_elf.h> #include <sys/kernel.h> -#include <sys/proc.h> +#include <sys/malloc.h> +#include <sys/eventhandler.h> +#include <compat/linux/linux_emul.h> #include <compat/linux/linux_mib.h> #include <compat/linux/linux_util.h> @@ -42,6 +44,10 @@ MODULE_VERSION(linux_common, 1); SET_DECLARE(linux_device_handler_set, struct linux_device_handler); +static eventhandler_tag linux_exec_tag; +static eventhandler_tag linux_thread_dtor_tag; +static eventhandler_tag linux_exit_tag; + static int linux_common_modevent(module_t mod, int type, void *data) @@ -51,6 +57,12 @@ linux_common_modevent(module_t mod, int type, void *data) switch(type) { case MOD_LOAD: linux_osd_jail_register(); + linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, + linux_proc_exit, NULL, 1000); + linux_exec_tag = EVENTHANDLER_REGISTER(process_exec, + linux_proc_exec, NULL, 1000); + linux_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, + linux_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); SET_FOREACH(ldhp, linux_device_handler_set) linux_device_register_handler(*ldhp); break; @@ -58,6 +70,9 @@ linux_common_modevent(module_t mod, int type, void *data) linux_osd_jail_deregister(); SET_FOREACH(ldhp, linux_device_handler_set) linux_device_unregister_handler(*ldhp); + EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag); + EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag); + EVENTHANDLER_DEREGISTER(thread_dtor, linux_thread_dtor_tag); break; default: return (EOPNOTSUPP); |