Advertisement
Guest User

Untitled

a guest
Jul 7th, 2013
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1.     char *pathname = "";
  2.  
  3.     struct path path;
  4.     struct dentry *dentry;
  5.     struct qstr qstr;
  6.  
  7.     struct files_struct *files = current->files;
  8.     struct file __rcu *file = files->fd_array[fd];
  9.  
  10.     if(file){
  11.         path = file->f_path;
  12.         dentry = path.dentry;
  13.         qstr = dentry->d_name;
  14.  
  15.         pathname = kmalloc(strlen(qstr.name), GFP_KERNEL);
  16.         strncpy(pathname, qstr.name, strlen(qstr.name));
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement