summaryrefslogtreecommitdiffstats
path: root/share/examples/lkm/misc/module/misccall.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-12-25 07:19:32 +0000
committerbde <bde@FreeBSD.org>1995-12-25 07:19:32 +0000
commitc37e7feb99eeac77aa76f6347e3025858037c16a (patch)
tree87b8649103817b6ed4829289274a9483a44cc427 /share/examples/lkm/misc/module/misccall.c
parent730abc9c1605bba24a76b58b113e50364f99b484 (diff)
downloadFreeBSD-src-c37e7feb99eeac77aa76f6347e3025858037c16a.zip
FreeBSD-src-c37e7feb99eeac77aa76f6347e3025858037c16a.tar.gz
Updated lkm examples to work with prototype-related changes to the
MOD_MISC() and DISPATCH() macros. Renamed new_syscall module as new_syscall_mod. It seems to be standard to have module names ending with _mod, and this may be forced when MOD_SYSCALL() and MOD_VFS() are updated to match MOD_MISC(). Cleaned up lkm examples a little.
Diffstat (limited to 'share/examples/lkm/misc/module/misccall.c')
-rw-r--r--share/examples/lkm/misc/module/misccall.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/share/examples/lkm/misc/module/misccall.c b/share/examples/lkm/misc/module/misccall.c
index 5cadafc..dd972c7 100644
--- a/share/examples/lkm/misc/module/misccall.c
+++ b/share/examples/lkm/misc/module/misccall.c
@@ -37,14 +37,15 @@
*/
#include <sys/param.h>
#include <sys/ioctl.h>
-#include <sys/proc.h>
#include <sys/systm.h>
+/* XXX this should be in a header. */
+extern int misccall __P((struct proc *p, void *uap, int retval[]));
/*
- * This is the actual code for system call... it can be static because
- * we've externed it up above... the only plae it needs to be referenced
- * is the sysent we are interested in.
+ * This is the actual code for the system call... it can't be static because
+ * it is exported to another part of the module... the only place it needs
+ * to be referenced is the sysent we are interested in.
*
* To write your own system call using this as a template, you could strip
* out this code and use the rest as a prototype module, changing only the
@@ -66,13 +67,10 @@ int retval[];
* arguments.
*/
- printf( "\nI am a loaded system call using the miscellaneous\n");
- printf( "module loader interface and a kernel printf!\n");
+ printf( "\nI am a loaded system call.\n");
+ printf( "I was loaded using the miscellaneous module loader interface.\n");
+ printf( "I don't do anything except call the kernel's printf().\n");
printf( "I will print this message each time I am called!\n");
return( 0); /* success (or error code from errno.h)*/
}
-
-/*
- * EOF -- This file has not been truncated.
- */
OpenPOWER on IntegriCloud