1PMSETPROCESSIDENTITY(3) Library Functions Manual PMSETPROCESSIDENTITY(3)
2
3
4
6 pmSetProcessIdentity - set process user and group id
7
9 #include <pcp/pmapi.h>
10
11 int pmSetProcessIdentity(const char *username);
12
13 cc ... -lpcp
14
16 pmSetProcessIdentity provides a platform-independent method to set the
17 user id of a process to that matching username.
18
19 If possible (when the caller is already running as root) pmSetProcessI‐
20 dentity will set the group id of the process to that of the matching
21 user, e.g. using username and getpwnam(3).
22
23 A return value of 0 indicates success, otherwise the return value is an
24 error code that may be decoded with pmErrStr(3).
25
26 pmSetProcessIdentity is most often used in conjunction with pmGetUser‐
27 name(3) at process start up.
28
30 getpwnam(3), PMAPI(3), pmErrStr(3), pmGetUsername(3), setgid(3) and
31 setuid(3).
32
33
34
35Performance Co-Pilot PCP PMSETPROCESSIDENTITY(3)