2 Copyright © 2008, The AROS Development Team. All rights reserved.
14 short getnixfilesystemtype(LONG id_DiskType
);
16 /*****************************************************************************
19 #include <sys/mount.h>
28 Gets information about mounted filesystem.
31 path - path to any file in the filesystem we want to know about
32 buf - pointer to statfs structures where information about filesystem
36 Information about filesystem is stored in statfs structure
43 f_flags, f_files, f_ffree and f_fsid.val are always set to 0
44 f_mntfromname is set to an empty string
50 ******************************************************************************/
63 apath
= __path_u2a(path
);
70 /* Get filesystem data from lock */
71 if(((lock
= Lock(apath
, SHARED_LOCK
))))
75 /* Fill statfs structure */
76 buf
->f_type
= getnixfilesystemtype(data
.id_DiskType
);
78 buf
->f_fsize
= data
.id_BytesPerBlock
;
79 buf
->f_bsize
= data
.id_BytesPerBlock
;
80 buf
->f_blocks
= data
.id_NumBlocks
;
81 buf
->f_bfree
= data
.id_NumBlocks
- data
.id_NumBlocksUsed
;
82 buf
->f_bavail
= data
.id_NumBlocks
- data
.id_NumBlocksUsed
;
85 buf
->f_fsid
.val
[0] = 0;
86 buf
->f_fsid
.val
[1] = 0;
87 strncpy(buf
->f_mntonname
, __path_a2u(((struct DeviceList
*)BADDR(data
.id_VolumeNode
))->dl_Name
), MNAMELEN
);
88 buf
->f_mntfromname
[0] = '\0';
102 errno
= IoErr2errno(ioerr
);