blob: 14b766cb7ee10ab05d300aef41d5f0701315f1e1 [file] [log] [blame]
bigbiff7b4c7a62015-01-01 19:44:14 -05001#ifndef UTIL_LINUX_PROCUTILS
2#define UTIL_LINUX_PROCUTILS
3
4#include <dirent.h>
5
6struct proc_tasks {
7 DIR *dir;
8};
9
10extern struct proc_tasks *proc_open_tasks(pid_t pid);
11extern void proc_close_tasks(struct proc_tasks *tasks);
12extern int proc_next_tid(struct proc_tasks *tasks, pid_t *tid);
13
14struct proc_processes {
15 DIR *dir;
16
17 const char *fltr_name;
18 uid_t fltr_uid;
19
20 unsigned int has_fltr_name : 1,
21 has_fltr_uid : 1;
22};
23
24extern struct proc_processes *proc_open_processes(void);
25extern void proc_close_processes(struct proc_processes *ps);
26
27extern void proc_processes_filter_by_name(struct proc_processes *ps, const char *name);
28extern void proc_processes_filter_by_uid(struct proc_processes *ps, uid_t uid);
29extern int proc_next_pid(struct proc_processes *ps, pid_t *pid);
30
31
32#endif /* UTIL_LINUX_PROCUTILS */