patacongo commented on PR #9521:
URL: https://github.com/apache/nuttx/pull/9521#issuecomment-1593372358

   
   
   The f_fsid field is not standard in `struct statfs` (but is required by 
POSIX in` struct statvfs`).  It is NOT specifid by POSIX standards for statfs.  
This is handled differently by different OSs:
   
   https://linux.die.net/man/2/statfs:
   
   > Nobody knows what f_fsid is supposed to contain (but see below). 
   > ...
   > **The f_fsid field**
   >
   > Solaris, Irix and POSIX have a system call  that returns a struct statvfs 
(defined in sys/statvfs.h containing an unsigned long f_fsid.  Linux, SunOS, 
HP-UX, 4.4BSD have a system call statfs() that returns a struct statfs (defined 
in sys/vfs.h containing a fsid_t f_fsid, where fsid_t is defined as struct { 
int val[2]; }. The same holds for FreeBSD, except that it uses the include file 
sys/mount.h.
   > 
   > The general idea is that f_fsid contains some random stuff such that the 
pair (f_fsid, ino) uniquely determines a file. Some operating systems use (a 
variation on) the device number, or the device number combined with the 
file-system type. Several OSes restrict giving out the f_fsid field to the 
superuser only (and zero it for unprivileged users), because this field is used 
in the filehandle of the file system when NFS-exported, and giving it out is a 
security concern.
   > 
   > Under some operating systems the fsid can be used as second argument to 
the sysfs system call.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to