_SETPROCCAP(2)

NAME
_setproccap, _getproccap - set/get process capabilities

SYNOPSIS
#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

EFAULT
    One of the capability arguments was an invalid data pointer.

EPERM
    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.

ENOSYS
    The POSIX.1e capability system was not configured into the kernel.

CONFORMING TO
These system calls are specific to Linux. The portable interfaces are cap_set_proc(3) and cap_get_proc(3).

SEE ALSO
_setfilecap(2).