作者:关圣钊 | 来源:互联网 | 2023-05-19 00:16
Iamtryingtofindwhatmember(s)ofthestructfdtableorstructfilewillletmedeterminewhethe
I am trying to find what member(s) of the struct fdtable
or struct file
will let me determine whether or not an open file is a socket or a pipe.
我试图找到struct fdtable或struct file的成员将让我确定打开的文件是套接字还是管道。
the only path I can seem to find is:
我能找到的唯一途径是:
struct file f ....;
f.path->mnt->mnt_devname
This returns the device name at the mountpoint, all sockets/pipes apparently belong to sockfs or pipefs respectively.
这将返回挂载点处的设备名称,所有套接字/管道分别显然属于sockfs或pipefs。
Is there a faster way to check to see if an open file is a socket or pipe using a different member of the struct file or fdtable?
是否有更快的方法来检查打开的文件是使用struct文件或fdtable的不同成员的套接字还是管道?
Note: I am using the kernel definitions from 2.6.24
注意:我使用的是2.6.24中的内核定义
1 个解决方案