How to check in C code whether a directory is on NFS file system?
===

In my C/C++ program I would like to check whether the data directory specified by user resides on NFS file system.  The check is needed because the data processing latency / bandwidth is worse for the remote NFS directory.  I would like to issue a warning to the user in case if the data directory is NFS.

How can I do that?  I figured there is stat() call that should be able to help me, but the details are not clear.

I am on Linux.