summaryrefslogtreecommitdiffstats
path: root/share/examples/kld/syscall/module/syscall.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2009-06-03 09:28:58 +0000
committerpjd <pjd@FreeBSD.org>2009-06-03 09:28:58 +0000
commit9434014ec0ff82ae1d7b63a1c388cf2d41046a37 (patch)
treece11331c1da258f036e2ff4384f4bb88a54fcdca /share/examples/kld/syscall/module/syscall.c
parentf0fa176da8e8ec6d93e2071d91cca2e6f3f36654 (diff)
downloadFreeBSD-src-9434014ec0ff82ae1d7b63a1c388cf2d41046a37.zip
FreeBSD-src-9434014ec0ff82ae1d7b63a1c388cf2d41046a37.tar.gz
Where if not in examples we should follow style(9)?
Diffstat (limited to 'share/examples/kld/syscall/module/syscall.c')
-rw-r--r--share/examples/kld/syscall/module/syscall.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/share/examples/kld/syscall/module/syscall.c b/share/examples/kld/syscall/module/syscall.c
index 3416f3c..8d4f1fa 100644
--- a/share/examples/kld/syscall/module/syscall.c
+++ b/share/examples/kld/syscall/module/syscall.c
@@ -26,7 +26,6 @@
* $FreeBSD$
*/
-#include <sys/types.h>
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/module.h>
@@ -38,18 +37,17 @@
/*
* The function for implementing the syscall.
*/
-
static int
-hello (struct thread *td, void *arg)
+hello(struct thread *td, void *arg)
{
- printf ("hello kernel\n");
- return 0;
+
+ printf("hello kernel\n");
+ return (0);
}
/*
* The `sysent' for the new syscall
*/
-
static struct sysent hello_sysent = {
0, /* sy_narg */
hello /* sy_call */
@@ -58,30 +56,28 @@ static struct sysent hello_sysent = {
/*
* The offset in sysent where the syscall is allocated.
*/
-
static int offset = NO_SYSCALL;
/*
* The function called at load/unload.
*/
-
static int
-load (struct module *module, int cmd, void *arg)
+load(struct module *module, int cmd, void *arg)
{
int error = 0;
switch (cmd) {
case MOD_LOAD :
- printf ("syscall loaded at %d\n", offset);
+ printf("syscall loaded at %d\n", offset);
break;
case MOD_UNLOAD :
- printf ("syscall unloaded from %d\n", offset);
+ printf("syscall unloaded from %d\n", offset);
break;
default :
error = EOPNOTSUPP;
break;
}
- return error;
+ return (error);
}
SYSCALL_MODULE(syscall, &offset, &hello_sysent, load, NULL);
OpenPOWER on IntegriCloud