blob: 969ec3684169570f34c353b878bf9619e2d3e41b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include <sys/stat.h>
#include <sys/mount.h>
#include <errno.h>
#include "debugfs.h"
int debugfs_init(void)
{
struct stat st;
if (stat("/sys/kernel/debug/dri", &st) == 0)
return 0;
if (stat("/sys/kernel/debug", &st))
return errno;
if (mount("debug", "/sys/kernel/debug", "debugfs", 0, 0))
return errno;
return 0;
}
|