fs.h 738 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef __API_FS__
  2. #define __API_FS__
  3. #include <stdbool.h>
  4. /*
  5. * On most systems <limits.h> would have given us this, but not on some systems
  6. * (e.g. GNU/Hurd).
  7. */
  8. #ifndef PATH_MAX
  9. #define PATH_MAX 4096
  10. #endif
  11. #define FS(name) \
  12. const char *name##__mountpoint(void); \
  13. const char *name##__mount(void); \
  14. bool name##__configured(void); \
  15. FS(sysfs)
  16. FS(procfs)
  17. FS(debugfs)
  18. FS(tracefs)
  19. #undef FS
  20. int filename__read_int(const char *filename, int *value);
  21. int filename__read_ull(const char *filename, unsigned long long *value);
  22. int sysctl__read_int(const char *sysctl, int *value);
  23. int sysfs__read_int(const char *entry, int *value);
  24. int sysfs__read_ull(const char *entry, unsigned long long *value);
  25. #endif /* __API_FS__ */