- 论坛徽章:
- 0
|
asmlinkage long new_open(const char * filename, int flags, int mode)
//用new_open替换sys_open
{ struct inode*inode;
char *tmp=NULL;
tmp= (char*) kmalloc(100, GFP_KERNEL);
memset(tmp,0,100);
strncpy_from_user(tmp, filename, 100);
getinode_byname(tmp,inode);
}
void getinode_byname(const char * filename,struct inode*inode)
{ //根据文件路径得到inode
struct file *f;
f=filp_open(filename,0,1);
inode=f->f_dentry->d_inode;
filp_close(f,current->files);
printk("<1>get protect inode \n");
}
可是模块加载以后在filp_close出现eip错误,请大家帮我看看好吗? |
|