Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, I want to be able to differentiate between disk I/O and network I/O from vfs_read(). This function takes a pointer to a struct file as a parameter. My question ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2009
    Posts
    2

    socket or not from struct file


    Hi,

    I want to be able to differentiate between disk I/O and network I/O from vfs_read(). This function takes a pointer to a struct file as a parameter. My question is how to figure whether that file is a socket or a physical file on disk. Thanks.

  2. #2
    Just Joined!
    Join Date
    Nov 2009
    Posts
    2
    solved: S_ISSOCK(filp->f_dentry->d_inode->i_mode)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •