Messages in this thread | | | Date | Mon, 3 Jan 2005 17:10:03 +0100 | From | Martin Waitz <> | Subject | Re: Getting inode no from current process file descriptor table |
| |
hoi :)
On Sun, Jan 02, 2005 at 09:37:24PM -0800, selvakumar nagendran wrote: > How can we get the inode number for a file provided > we have the corresponding file descriptor. Can we use > files_struct -> fd[fd] to get struct file ?. From that > how can we get the corresponding inode number?
#include <linux/dcache.h> #include <linux/file.h> #include <linux/fs.h>
struct file * file = fget(fd); inode_number = file->f_dentry->d_inode->i_ino; fput(file);
-- Martin Waitz [unhandled content-type:application/pgp-signature] | |