#include #include #include #include #include #include static long errno; MODULE_AUTHOR("Constantine Gavrilov"); MODULE_DESCRIPTION("Simple test for syscall interface"); MODULE_LICENSE("GPL"); #ifdef CONFIG_X86_64 #include "gsyscall.h" static long wrapper_umask (mode_t mask) { long res = INLINE_SYSCALL(umask, 1, mask); return res; } #endif static _syscall1(long, umask, int, mode); static int __init syscall_test_init(void) { long res; printk(KERN_INFO "syscall_test: via syscall macro\n"); res=umask(0666); printk(KERN_INFO "syscall_test: via syscall macro -- result is %ld\n", res); #ifdef CONFIG_X86_64 printk(KERN_INFO "syscall_test: via INLINE_SYSCALL\n"); res=wrapper_umask(0666); printk(KERN_INFO "syscall_test: via INLINE_SYSCALL -- result is %ld\n", res); #endif return 0; } static void __exit syscall_test_exit(void) { return; } module_init(syscall_test_init); module_exit(syscall_test_exit);