Debian Codegraph @

src/util/proc.h

raw
1 #pragma once
2
3 /*
4 * Proc Helpers
5 */
6
7 #include <c-stdaux.h>
8 #include <stdlib.h>
9 #include <unistd.h>
10
11 #define PROC_PID_SELF ((pid_t)0)
12
13 enum {
14 _PROC_E_SUCCESS,
15
16 PROC_E_NOT_FOUND,
17 };
18
19 int proc_field(const char *data, const char *key, char **valuep);
20 int proc_read(int fd, char **datap, size_t *n_datap);
21
22 int proc_get_seclabel(pid_t pid, char **labelp, size_t *n_labelp);
23 int proc_resolve_pidfd(int pidfd, pid_t *pidp);