logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

pmSetProcessIdentity - set process user and group id

C Synopsis

#include<pcp/pmapi.h>intpmSetProcessIdentity(constchar*username);cc...-lpcp

Description

pmSetProcessIdentity  provides  a  platform-independent  method  to  set the user id of a process to that
       matching username.

       If possible (when the caller is already running as root) pmSetProcessIdentity will set the  group  id  of
       the process to that of the matching user, e.g. using username and getpwnam(3).

       A  return  value  of 0 indicates success, otherwise the return value is an error code that may be decoded
       with pmErrStr(3).

       pmSetProcessIdentity is most often used in conjunction with pmGetUsername(3) at process start up.

Name

pmSetProcessIdentity - set process user and group id

See Also

getpwnam(3), PMAPI(3), pmErrStr(3), pmGetUsername(3), setgid(3) and setuid(3).

Performance Co-Pilot                                   PCP                               PMSETPROCESSIDENTITY(3)

See Also