diff options
-rw-r--r-- | lib/igt_debugfs.c | 9 | ||||
-rw-r--r-- | lib/igt_debugfs.h | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c index 33c4fc10..f1944398 100644 --- a/lib/igt_debugfs.c +++ b/lib/igt_debugfs.c @@ -73,3 +73,12 @@ int igt_debugfs_open(igt_debugfs_t *debugfs, const char *filename) sprintf(buf, "%s/%s", debugfs->dri_path, filename); return open(buf, O_RDONLY); } + +FILE *igt_debugfs_fopen(igt_debugfs_t *debugfs, const char *filename, + const char *mode) +{ + char buf[1024]; + + sprintf(buf, "%s/%s", debugfs->dri_path, filename); + return fopen(buf, mode); +} diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h index aa9449a8..1035a933 100644 --- a/lib/igt_debugfs.h +++ b/lib/igt_debugfs.h @@ -25,6 +25,8 @@ #ifndef __IGT_DEBUGFS_H__ #define __IGT_DEBUGFS_H__ +#include <stdio.h> + typedef struct { char root[128]; char dri_path[128]; @@ -32,5 +34,7 @@ typedef struct { int igt_debugfs_init(igt_debugfs_t *debugfs); int igt_debugfs_open(igt_debugfs_t *debugfs, const char *filename); +FILE *igt_debugfs_fopen(igt_debugfs_t *debugfs, const char *filename, + const char *mode); #endif /* __IGT_DEBUGFS_H__ */ |