Manual Pages for UNIX Darwin command on man getfsstat
MyWebUniversity

Manual Pages for UNIX Darwin command on man getfsstat

GETFSSTAT(2) BSD System Calls Manual GETFSSTAT(2)

NAME

ggeettffssssttaatt - get list of all mounted file systems

SYNOPSIS

##iinncclluuddee <>

##iinncclluuddee <>

##iinncclluuddee <>

int ggeettffssssttaatt(struct statfs *buf, int bufsize, int flags);

DESCRIPTION

GGeettffssssttaatt() returns information about all mounted file systems. Buf is a pointer to an array of statfs structures defined as follows: typedef struct { int32t val[2]; } fsidt;

#define MFSNAMELEN 15 /* length of fs type name, not inc. nul */

#define MNAMELEN 90 /* length of buffer for returned name */

struct statfs { short fotype; /* type of file system (reserved: zero) */ short foflags; /* copy of mount flags (reserved: zero) */ long fbsize; /* fundamental file system block size */ long fiosize; /* optimal transfer block size */ long fblocks; /* total data blocks in file system */ long fbfree; /* free blocks in fs */

long fbavail; /* free blocks avail to non-superuser */

long ffiles; /* total file nodes in file system */ long fffree; /* free file nodes in fs */

fsidt ffsid; /* file system id (super-user only) */

uidt fowner; /* user that mounted the file system */ short freserved1; /* reserved for future use */ short ftype; /* type of file system (reserved) */ long fflags; /* copy of mount flags (reserved) */ long freserved2[2]; /* reserved for future use */

char ffstypename[MFSNAMELEN]; /* fs type name */

char fmntonname[MNAMELEN]; /* directory on which mounted */

char fmntfromname[MNAMELEN]; /* mounted file system */

char freserved3; /* reserved for future use */ long freserved4[4]; /* reserved for future use */ };

Fields that are undefined for a particular file system are set to -1.

The buffer is filled with an array of statfs structures, one for each mounted file system up to the size specified by bufsize. If buf is given as NULL, ggeettffssssttaatt() returns just the number of mounted file systems. If flags is set to MNTNOWAIT, ggeettffssssttaatt() will directly return the information retained in the kernel to avoid delays caused by waiting for updated information from a file system that is perhaps temporarily unable

to respond. Some of the information returned may be out of date, how-

ever; if flags is set to MNTWAIT instead, ggeettffssssttaatt() will request updated information from each mounted filesystem before returning.

RETURN VALUES

Upon successful completion, the number of statfs structures is returned.

Otherwise, -1 is returned and the global variable errno is set to indi-

cate the error. EERRRROORRSS GGeettffssssttaatt() fails if one or more of the following are true: [EFAULT] Buf points to an invalid address. [EIO] An I/O error occurred while reading from or writing to the file system.

SEE ALSO

statfs(2), fstab(5), mount(8) HISTORY The ggeettffssssttaatt() function first appeared in 4.4BSD. BSD June 9, 1993 BSD




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™