From userspace you can use stat(1) "stat -f" and it will tell you
the filesystem type; older stats don't know about xfs,
so you might need to look for the raw magic number,
0x58465342 ("XFSB")
To do it from C, see statfs(2), and use the f_type result.
-Eric
On Sat, 10 Jan 2004, Diyab wrote:
> Hello,
>
> I'm working with SELinux and adding XFS attribute / security label
> support into the API. The problem I'm running into is trying to
> determine what type of filesystem the file I'm operating on is located
> on. With ext2/3 the EA attribute name is different from what it will be
> on an XFS file system so I need to detect the file system type from the
> file stream I have open. I'm not familiar with how to check the file
> system type since I've not done this before so does anyone have any
> suggestions to give me? Any help is really appreciated, thanks!
>
> Timothy,
>
> Also please CC me because I am not on the list.
>
>
|