#include #include #include #include #include #include #include static int hello (struct proc *p, void *arg) { unsigned char *message = * ((unsigned char **) arg); printf("message = %s\n", message); return 0; } static struct sysent hello_sysent = { 1, hello }; static int offset = NO_SYSCALL; static int load (struct module *module, int cmd, void *arg) { int error = 0; switch (cmd) { case MOD_LOAD: printf("syscall loaded at %d\n", offset); break; case MOD_UNLOAD: printf("syscall unloaded at %d\n", offset); break; default: error = EINVAL; break; } return error; } SYSCALL_MODULE(messagepost, &offset, &hello_sysent, load, NULL);