Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    socket or not from struct file


    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
    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