Call chainevh callback when we are invoked with neither MOD_LOAD nor

MOD_UNLOAD.  This makes it possible to add custom hooks for other module
events.

Return EOPNOTSUPP when there is no callback available.

Pointed out by:	jhb
Reviewed by:	jhb
MFC after:	1 month
This commit is contained in:
Xin LI 2010-10-21 20:31:50 +00:00
parent 283e21dd32
commit 5e5fd037d6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=214181

View File

@ -181,7 +181,9 @@ syscall_module_handler(struct module *mod, int what, void *arg)
error = syscall_deregister(data->offset, &data->old_sysent);
return (error);
default:
return EOPNOTSUPP;
if (data->chainevh)
return (data->chainevh(mod, what, data->chainarg));
return (EOPNOTSUPP);
}
/* NOTREACHED */