Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char *pathname = "";
- struct path path;
- struct dentry *dentry;
- struct qstr qstr;
- struct files_struct *files = current->files;
- struct file __rcu *file = files->fd_array[fd];
- if(file){
- path = file->f_path;
- dentry = path.dentry;
- qstr = dentry->d_name;
- pathname = kmalloc(strlen(qstr.name), GFP_KERNEL);
- strncpy(pathname, qstr.name, strlen(qstr.name));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement