Lines Matching defs:path
17 int is_valid_path(const char *path)
19 if (access(path, F_OK) == -1)
24 unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen)
29 fd = open(path, O_RDONLY);
45 unsigned int cpupower_write_sysfs(const char *path, char *buf, size_t buflen)
50 fd = open(path, O_WRONLY);
56 perror(path);
76 char path[SYSFS_PATH_MAX];
84 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u", cpu);
86 if (stat(path, &statbuf) != 0)
93 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/online", cpu);
94 if (stat(path, &statbuf) != 0)
97 fd = open(path, O_RDONLY);
121 char path[SYSFS_PATH_MAX];
123 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/topology/%s",
125 if (cpupower_read_sysfs(path, linebuf, MAX_LINE_LEN) == 0)