2 Copyright © 2008-2012, The AROS Development Team. All rights reserved.
13 short getnixfilesystemtype(LONG id_DiskType
);
15 /*****************************************************************************
18 #include <sys/mount.h>
27 Gets information about mounted filesystem.
30 path - path to any file in the filesystem we want to know about
31 buf - pointer to statfs structures where information about filesystem
35 Information about filesystem is stored in statfs structure
42 f_flags, f_files, f_ffree and f_fsid.val are always set to 0
43 f_mntfromname is set to an empty string
49 ******************************************************************************/
62 apath
= __path_u2a(path
);
69 /* Get filesystem data from lock */
70 if(((lock
= Lock(apath
, SHARED_LOCK
))))
74 /* Fill statfs structure */
75 buf
->f_type
= getnixfilesystemtype(data
.id_DiskType
);
77 buf
->f_fsize
= data
.id_BytesPerBlock
;
78 buf
->f_bsize
= data
.id_BytesPerBlock
;
79 buf
->f_blocks
= data
.id_NumBlocks
;
80 buf
->f_bfree
= data
.id_NumBlocks
- data
.id_NumBlocksUsed
;
81 buf
->f_bavail
= data
.id_NumBlocks
- data
.id_NumBlocksUsed
;
84 buf
->f_fsid
.val
[0] = 0;
85 buf
->f_fsid
.val
[1] = 0;
86 strncpy(buf
->f_mntonname
, __path_a2u(AROS_BSTR_ADDR(((struct DeviceList
*)BADDR(data
.id_VolumeNode
))->dl_Name
)), MNAMELEN
);
87 buf
->f_mntfromname
[0] = '\0';
101 errno
= __stdc_ioerr2errno(ioerr
);