/* mod-syscall-ret-test.c * * Call the new module system calls that pass parameters and return results. * Use the existing unused system calls * futex 240, sched_setaffinity 241, sched_getaffinity 242 * */ /* Standard include files for syscall, see man syscall */ #include #include #include /* for printf */ int main(void) { int n; char * msg = "Hi there"; printf("Hello, calling module my_syscall 240 system call\n"); syscall(__NR_futex); printf("Hello, calling module my_syscall_ret 241 system call\n"); n = syscall(__NR_sched_setaffinity); printf("mod_syscall_ret 241 returned: %d\n",n); printf("Hello, calling module my_syscall_parm 242 system call\n"); n = syscall(__NR_sched_getaffinity, msg); printf("mod_syscall_parm 242 returned: %d\n",n); printf("Done. Go check /var/log/syslog\n"); return 0; }