Name
_setproccap, _getproccap - set/get process capabilitiesSynopsis
#include <sys/capability.h> int _setproccap(size_t " usize ", __cap_s const *" iset ", __cap_s const *" pset ", __cap_s const * eset );int _getproccap(size_t " usize ", __cap_s *" iset ", __cap_s *" pset ", __cap_s * eset );
Description
_setproccap sets the calling process' Inheritable, Permitted and Effective capabilities to the sets specified. A NULL pointer specifies that a set should not be changed._getproccap copies the process' capability sets into the sets provided. A NULL pointer specifies that a set should not be returned.
The usize argument specifies the size of the user-space capability sets, in bytes. If the kernel uses a different size internally, it will truncate or zero-fill as required.
Return Value
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.Errors
One of the capability arguments was an invalid data pointer.
An attempt was made to add a capability to the Permitted set, or to set a capability in the Effective or Inheritable sets that is not in the Permitted set.
The POSIX.1e capability system was not configured into the kernel.
Conforming To
These system calls are specific to Linux. The portable interfaces arecap_set_proc (3)
and cap_get_proc (3).
See Also
_setfilecap (2).