Lines Matching refs:filename
41 // /proc/<filename>:<label> = <part of a multiline file>
58 char *name; // filename, plus ":var" for many-valued files
71 // filename and contents of the file. Trims trailing whitespace.
72 static void read_data(struct data *data, const char *filename) {
74 data->name = strdup(filename);
75 int fd = open(filename, O_RDONLY);
83 perror(filename);
103 const char *filename,
107 int fd = open(filename, O_RDONLY);
112 perror(filename);
124 int filename_len = strlen(filename);
142 // Key format: <filename>:<name>
145 unspace(data->name, filename, filename_len);
232 char filename[1024];
243 sprintf(filename, "/proc/%d/cmdline", pid);
244 int fd = open(filename, O_RDONLY);
246 perror(filename);
252 perror(filename);
289 sprintf(filename, "/proc/%d/stat", pids[i]);
290 read_data(next++, filename);
291 sprintf(filename, "/proc/%d/wchan", pids[i]);
292 read_data(next++, filename);