1 /** 2 * @defgroup statfs Statfs 3 * @ingroup libc 4 */ 5 6 #ifndef _SYS_STATFS_H 7 #define _SYS_STATFS_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 #include <features.h> 14 15 #include <sys/statvfs.h> 16 17 #ifdef __LITEOS__ 18 #define ROMFS_MAGIC 0x7275 19 #define MSDOS_SUPER_MAGIC 0x4d44 20 #define RAMFS_MAGIC 0x858458f6 21 #define YAFFS_MAGIC 0x5941ff53 22 #define NFS_SUPER_MAGIC 0x6969 23 #define PROCFS_MAGIC 0x434f5250 24 #define JFFS2_SUPER_MAGIC 0x72b6 25 #endif 26 27 typedef struct __fsid_t { 28 int __val[2]; 29 } fsid_t; 30 31 #include <bits/statfs.h> 32 33 /** 34 * @ingroup vfs 35 * 36 * @par Description: 37 * The statfs() function shall get the information of the file system pointed to by the path and return the 38 * information in buf. 39 * 40 * @attention 41 * <ul> 42 * <li>Now only fat filesystem support this function.</li> 43 * </ul> 44 * 45 * @retval #0 On success. 46 * @retval #-1 On failure with errno set. 47 * 48 * @par Errors 49 * <ul> 50 * <li><b>EFAULT</b>: The path is a null pointer or the buf is a null pointer.</li> 51 * <li><b>ENAMETOOLONG</b>: The length of a component of a pathname is longer than {NAME_MAX}.</li> 52 * <li><b>ENOENT</b>: A component of the path does not exist.</li> 53 * <li><b>ENODEV</b>: The mount is not healthy.</li> 54 * </ul> 55 * 56 * @par Dependency: 57 * <ul><li>statfs.h</li></ul> 58 * @see None 59 */ 60 int statfs (const char *, struct statfs *); 61 int fstatfs (int, struct statfs *); 62 63 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) 64 #define statfs64 statfs 65 #define fstatfs64 fstatfs 66 #define fsblkcnt64_t fsblkcnt_t 67 #define fsfilcnt64_t fsfilcnt_t 68 #endif 69 70 #ifdef __cplusplus 71 } 72 #endif 73 74 #endif 75