fork download
  1. typedef long int __quad_t;
  2.  
  3. typedef long int __off64_t;
  4. typedef struct { int __val[2]; } __fsid_t;
  5.  
  6. typedef unsigned long int __fsblkcnt_t;
  7. typedef unsigned long int __fsblkcnt64_t;
  8.  
  9. typedef unsigned long int __fsfilcnt_t;
  10. typedef unsigned long int __fsfilcnt64_t;
  11.  
  12. struct statfs
  13. {
  14. long int f_type;
  15. long int f_bsize;
  16.  
  17. __fsblkcnt_t f_blocks;
  18. __fsblkcnt_t f_bfree;
  19. __fsblkcnt_t f_bavail;
  20. __fsfilcnt_t f_files;
  21. __fsfilcnt_t f_ffree;
  22.  
  23. __fsid_t f_fsid;
  24. long int f_namelen;
  25. long int f_frsize;
  26. long int f_flags;
  27. long int f_spare[4];
  28. };
  29.  
  30. struct statfs64
  31. {
  32. long int f_type;
  33. long int f_bsize;
  34. __fsblkcnt64_t f_blocks;
  35. __fsblkcnt64_t f_bfree;
  36. __fsblkcnt64_t f_bavail;
  37. __fsfilcnt64_t f_files;
  38. __fsfilcnt64_t f_ffree;
  39. __fsid_t f_fsid;
  40. long int f_namelen;
  41. long int f_frsize;
  42. long int f_flags;
  43. long int f_spare[4];
  44. };
  45.  
  46. extern int statfs (__const char *__file, struct statfs *__buf) __attribute__ ((__nonnull__ (1, 2)));
  47. extern int printf(const char *, ...);
  48.  
  49. int main()
  50. {
  51. struct statfs buf;
  52. if (0!= statfs("/", &buf))
  53. printf("oops\n");
  54. else
  55. printf("f_bsize: %ld\n", buf.f_bsize);
  56. return 0;
  57. }
  58.  
Success #stdin #stdout 0.02s 1720KB
stdin
Standard input is empty
stdout
f_bsize: 4096