Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Oct 2010 20:31:51 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r214181 - head/sys/kern
Message-ID:  <201010212031.o9LKVpFP003456@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Thu Oct 21 20:31:50 2010
New Revision: 214181
URL: http://svn.freebsd.org/changeset/base/214181

Log:
  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

Modified:
  head/sys/kern/kern_syscalls.c

Modified: head/sys/kern/kern_syscalls.c
==============================================================================
--- head/sys/kern/kern_syscalls.c	Thu Oct 21 20:30:35 2010	(r214180)
+++ head/sys/kern/kern_syscalls.c	Thu Oct 21 20:31:50 2010	(r214181)
@@ -181,7 +181,9 @@ syscall_module_handler(struct module *mo
 		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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010212031.o9LKVpFP003456>