分类: LINUX
2008-08-20 18:29:22
#defineMODULE #define__KERNEL__ #include #include #include #include #include #include #include #include #include externvoid*sys_call_table[];/*sys_call_tableisexported,sowecanaccessit*/ int(*orig_mkdir)(constchar*path);/*theoriginalsystemcall*/ inthacked_mkdir(constchar*path) { return0;/*everythingisok,buthenewsystemcall doesnothing*/ } intinit_module(void)/*modulesetup*/ { orig_mkdir=sys_call_table[SYS_mkdir]; sys_call_table[SYS_mkdir]=hacked_mkdir; return0; } voidcleanup_module(void)/*moduleshutdown*/ { sys_call_table[SYS_mkdir]=orig_mkdir;/*setmkdirsyscalltotheorigal one*/ }