cap_get_proc(3C)
cap_get_proc, cap_set_proc, cap_set_proc_flags - get or set process capabilities
As shipped in IRIX 6.5.7. Unchanged since IRIX 6.5.
NAME cap_get_proc, cap_set_proc, cap_set_proc_flags - get or set process capabilities SYNOPSIS #include <sys/capability.h> cap_t cap_get_proc(); int cap_set_proc(cap_t cap); int cap_set_proc_flags(cap_value_t flags); DESCRIPTION cap_get_proc returns a pointer to an allocated cap_t associated with the process. cap_set_proc sets the capabilities for the process from the cap_t cap. If any flag in cap is set for any capability not currently permitted for the calling process, the function fails, and the capability state of the process shall remain unchanged. cap_set_proc_flags sets the capability state flags for the process from the cap_value_t flags. If the value of flags is CAP_FLAG_PURE_RECALC capabilities will not be inherited through exec(2) unless the program file has a capability set associated with it. RETURN VALUES cap_get_proc returns a pointer to an allocated cap_t if successful, NULL otherwise. The storage should be freed with a call to cap_free with the returned pointer as an argument when it is no longer needed. cap_set_proc and cap_set_proc_flags return 0 if successful, -1 otherwise. ERRORS cap_get_proc: ENOMEM allocation of the cap_t failed. cap_set_proc: EINVAL cap is not valid EPERM The caller attempted to set a capability flag of a capability that was not permitted to the invoking process. ENOMEM The function requires more memory than is allowed by the hardware or system-imposed memory management constraints. cap_set_proc: EINVAL flags is not valid SEE ALSO capabilities(4)