bigbiff | 7b4c7a6 | 2015-01-01 19:44:14 -0500 | [diff] [blame] | 1 | #ifndef UTIL_LINUX_PROCUTILS |
| 2 | #define UTIL_LINUX_PROCUTILS |
| 3 | |
| 4 | #include <dirent.h> |
| 5 | |
| 6 | struct proc_tasks { |
| 7 | DIR *dir; |
| 8 | }; |
| 9 | |
| 10 | extern struct proc_tasks *proc_open_tasks(pid_t pid); |
| 11 | extern void proc_close_tasks(struct proc_tasks *tasks); |
| 12 | extern int proc_next_tid(struct proc_tasks *tasks, pid_t *tid); |
| 13 | |
| 14 | struct 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 | |
| 24 | extern struct proc_processes *proc_open_processes(void); |
| 25 | extern void proc_close_processes(struct proc_processes *ps); |
| 26 | |
| 27 | extern void proc_processes_filter_by_name(struct proc_processes *ps, const char *name); |
| 28 | extern void proc_processes_filter_by_uid(struct proc_processes *ps, uid_t uid); |
| 29 | extern int proc_next_pid(struct proc_processes *ps, pid_t *pid); |
| 30 | |
| 31 | |
| 32 | #endif /* UTIL_LINUX_PROCUTILS */ |