Query: cmpt_get
OS: hpux
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
cmpt_change(3) Library Functions Manual cmpt_change(3)NAMEcmpt_change(), cmpt_get() - set and get process' compartmentSYNOPSISParameters cid Compartment ID. pid Process ID of the target process or for the calling process.DESCRIPTIONThe and functions query and manipulate the compartment of a process. The function returns the given process' compartment ID. If is passed as the pid parameter, the compartment ID of the calling process is returned. The function changes the calling process' compartment ID to be the value of cid. Security Restrictions In order for the function to be effective, the calling process must possess the privilege. See privileges(5) for more information about privileges.RETURN VALUEreturns the following values: Successful completion. The function returns a valid compartment ID. Function failed. is set to indicate the error. returns the following values: Successful completion. Function failed. is set to indicate the error.ERRORSIf any of the following conditions occur, the functions fail and set Invalid compartment ID specified. The function failed to allocate sufficient memory for its operation. The process does not have the privilege. pid is not valid.EXAMPLES#include <errno.h> #include <sys/cmpt.h> main() { cmpt_t c = cmpt_getbyname("init"); if (cmpt_change(c) == -1 ) { perror("could not enter init compartment"); exit(1); } printf("The process is now running in compartment %d ", cmpt_get(0)); }DEPENDENCIESThese functions are a part of the library.SEE ALSOcmpt_getbynum(3), cmpt_getbyname(3), compartments(4), compartments(5), privileges(5). cmpt_change(3)
Related Man Pages |
---|
cmpt_tune(1m) - hpux |
cmpt_endent(3) - hpux |
cmpt_getbyname(3) - hpux |
cmpt_setent(3) - hpux |
priv_get(3) - hpux |
Similar Topics in the Unix Linux Community |
---|
HP-UX 11i Security Containment |