X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/b0d623f7f2ae71ed96e60569f61f9a9a27016e80..bca245acd4c03fd752d1a45f011ad495e60fe53d:/bsd/man/man2/getfsstat.2?ds=sidebyside diff --git a/bsd/man/man2/getfsstat.2 b/bsd/man/man2/getfsstat.2 index 47e792b60..22c6edef9 100644 --- a/bsd/man/man2/getfsstat.2 +++ b/bsd/man/man2/getfsstat.2 @@ -56,111 +56,15 @@ function returns information about all mounted file systems. The .Fa buf argument is a pointer to an array of -.Xr statfs -structures. -.Pp -As of Mac OS X 10.6, the default size of the -.Ft ino_t -type is 64 bits (the macro -.Dv _DARWIN_FEATURE_64_BIT_INODE -will be defined). -While there is no -.Ft ino_t -type used in the -.Xr statfs -structure, the changes to -.Fn getfsstat -are grouped together with the 64-bit inode changes. -The string fields in the -.Xr statfs -structure are larger and the variant symbol -.Li _getfsstat$INODE64 -will be automatically used. -The -.Xr statfs -structure is defined as: -.Bd -literal -typedef struct { int32_t val[2]; } fsid_t; - -#define MFSTYPENAMELEN 16 /* length of fs type name including null */ -#define MAXPATHLEN 1024 -#define MNAMELEN MAXPATHLEN - -struct statfs { /* when _DARWIN_FEATURE_64_BIT_INODE is defined */ - uint32_t f_bsize; /* fundamental file system block size */ - int32_t f_iosize; /* optimal transfer block size */ - uint64_t f_blocks; /* total data blocks in file system */ - uint64_t f_bfree; /* free blocks in fs */ - uint64_t f_bavail; /* free blocks avail to non-superuser */ - uint64_t f_files; /* total file nodes in file system */ - uint64_t f_ffree; /* free file nodes in fs */ - fsid_t f_fsid; /* file system id */ - uid_t f_owner; /* user that mounted the filesystem */ - uint32_t f_type; /* type of filesystem */ - uint32_t f_flags; /* copy of mount exported flags */ - uint32_t f_fssubtype; /* fs sub-type (flavor) */ - char f_fstypename[MFSTYPENAMELEN]; /* fs type name */ - char f_mntonname[MAXPATHLEN]; /* directory on which mounted */ - char f_mntfromname[MAXPATHLEN]; /* mounted filesystem */ - uint32_t f_reserved[8]; /* For future use */ -}; -.Ed -.Pp -(In 10.5, 64-bit -.Ft ino_t , -larger -.Xr statfs -structure and variant symbol were available if the macro -.Dv _DARWIN_USE_64_BIT_INODE -is defined before any header files are included; this macro is optional in -10.6.) -.Pp -If the macro -.Dv _DARWIN_NO_64_BIT_INODE -is defined before any header files are included, or if the deployment target -is less than 10.6, the legacy -.Xr statfs -structure will be in effect. -The -.Ft ino_t -type will be 32 bits (the -.Dv _DARWIN_FEATURE_64_BIT_INODE -macro will not be defined), the strings in the -.Xr statfs -structure will be their smaller legacy size (and long mount paths may no longer -fit) and the undecorated symbol -.Li _getfsstat -will be used. -This legacy .Fa statfs -structure is defined as: -.Bd -literal -#define MFSNAMELEN 15 /* length of fs type name, not inc. nul */ -#define MNAMELEN 90 /* length of buffer for returned name */ - -struct statfs { /* when _DARWIN_FEATURE_64_BIT_INODE is NOT defined */ - short f_otype; /* type of file system (reserved: zero) */ - short f_oflags; /* copy of mount flags (reserved: zero) */ - long f_bsize; /* fundamental file system block size */ - long f_iosize; /* optimal transfer block size */ - long f_blocks; /* total data blocks in file system */ - long f_bfree; /* free blocks in fs */ - long f_bavail; /* free blocks avail to non-superuser */ - long f_files; /* total file nodes in file system */ - long f_ffree; /* free file nodes in fs */ - fsid_t f_fsid; /* file system id */ - uid_t f_owner; /* user that mounted the file system */ - short f_reserved1; /* reserved for future use */ - short f_type; /* type of file system (reserved) */ - long f_flags; /* copy of mount flags (reserved) */ - long f_reserved2[2]; /* reserved for future use */ - char f_fstypename[MFSNAMELEN]; /* fs type name */ - char f_mntonname[MNAMELEN]; /* directory on which mounted */ - char f_mntfromname[MNAMELEN]; /* mounted file system */ - char f_reserved3; /* reserved for future use */ - long f_reserved4[4]; /* reserved for future use */ -}; -.Ed +structures (see +.Xr statfs 2 ) . +As +.Xr statfs 2 +indicates, the structure is defined differently depending on +whether the macro _DARWIN_FEATURE_64_BIT_INODE is defined (see +.Xr stat 2 +for more information on this macro). .Pp Fields that are undefined for a particular file system are set to -1. The buffer is filled with an array of @@ -201,7 +105,7 @@ Otherwise, -1 is returned and the global variable .Va errno is set to indicate the error. .Sh ERRORS -.Fn Getfsstat +.Fn getfsstat fails if one or more of the following are true: .Bl -tag -width Er .It Bq Er EFAULT @@ -223,6 +127,7 @@ routine is equivalent to the default is defined), so there is no longer any reason to use it (it will be removed in the future). .Sh SEE ALSO +.Xr stat 2 , .Xr statfs 2 , .Xr fstab 5 , .Xr mount 8