1CAPNG_SETPID(3) Libcap-ng API CAPNG_SETPID(3)
2
3
4
6 capng_setpid - set working pid
7
9 #include <cap-ng.h>
10
11 void capng_setpid(int pid);
12
13
15 capng_pid sets the working pid for capabilities operations. This is
16 useful if you want to get the capabilities of a different process.
17
18
20 If your process calls fork , then the child process will still have the
21 pid of the parent process stored in libcap-ng's internal data. It is
22 disallowed to do any kind of setcap operations because you would be
23 crossing process boundaries. To correct this, if your program links
24 against pthreads, then libcap-ng will use the pthread_atfork function
25 (as a weak symbol) to reset the pid information to the new process
26 automatically. You are not required to link against pthreads. You can
27 call capng_setpid and adjust the stored pid manually.
28
29
31 None.
32
33
35 capng_get_caps_process(3), capabilities(7)
36
37
39 Steve Grubb
40
41
42
43Red Hat June 2009 CAPNG_SETPID(3)