2013-12-09 17:14:24 +01:00
|
|
|
#ifndef __API_FS__
|
|
|
|
#define __API_FS__
|
2012-09-11 00:14:58 +02:00
|
|
|
|
2015-09-02 09:56:42 +02:00
|
|
|
#include <stdbool.h>
|
2016-02-14 17:03:43 +01:00
|
|
|
#include <unistd.h>
|
2015-09-02 09:56:42 +02:00
|
|
|
|
2015-09-02 09:56:37 +02:00
|
|
|
/*
|
|
|
|
* On most systems <limits.h> would have given us this, but not on some systems
|
|
|
|
* (e.g. GNU/Hurd).
|
|
|
|
*/
|
|
|
|
#ifndef PATH_MAX
|
|
|
|
#define PATH_MAX 4096
|
|
|
|
#endif
|
|
|
|
|
2015-09-02 09:56:41 +02:00
|
|
|
#define FS(name) \
|
|
|
|
const char *name##__mountpoint(void); \
|
2015-09-02 09:56:42 +02:00
|
|
|
const char *name##__mount(void); \
|
|
|
|
bool name##__configured(void); \
|
2015-09-02 09:56:41 +02:00
|
|
|
|
|
|
|
FS(sysfs)
|
|
|
|
FS(procfs)
|
|
|
|
FS(debugfs)
|
|
|
|
FS(tracefs)
|
|
|
|
|
|
|
|
#undef FS
|
|
|
|
|
2014-12-11 17:17:46 +01:00
|
|
|
|
|
|
|
int filename__read_int(const char *filename, int *value);
|
2015-09-10 16:58:50 +02:00
|
|
|
int filename__read_ull(const char *filename, unsigned long long *value);
|
2016-02-14 17:03:43 +01:00
|
|
|
int filename__read_str(const char *filename, char **buf, size_t *sizep);
|
2015-09-10 16:58:50 +02:00
|
|
|
|
2014-12-11 17:37:10 +01:00
|
|
|
int sysctl__read_int(const char *sysctl, int *value);
|
2015-09-10 16:58:50 +02:00
|
|
|
int sysfs__read_int(const char *entry, int *value);
|
|
|
|
int sysfs__read_ull(const char *entry, unsigned long long *value);
|
2013-12-09 17:14:24 +01:00
|
|
|
#endif /* __API_FS__ */
|