CAP_SET_PROC(3)

NAME
cap_set_proc - Set the Process Capability State

SYNOPSIS
#include <sys/types.h>
#include <sys/capability.h>
int
cap_set_proc(cap_t cap_p);

DESCRIPTION
The function cap_set_proc() shall set the values for all capability flags for all capabilities defined in the implementation with the capability state identified by cap_p. The new capability state of the process shall be completely determined by the contents of cap_p upon successful return from this function. If any flag in cap_p is set for any capability not currently permitted for the calling process, the function shall fail, and the capability state of teh process shall remain unchanged.

IMPLEMENTATION NOTES
FreeBSD's support for POSIX.1e interfaces and features is still under development at this time.

RETURN VALUES
Upon successful completion, this function shall return a value of zero. Otherwise, a value of -1 shall be returned and errno shall be set to indicate the error. Neither the state represented in the object identified by cap_p nor the capability state of the calling process shall be affected if the return value is -1.

ERRORS
If any of the following conditions occur, the cap_set_proc() function shall return -1 and set errno to the corresponding value:

[EINVAL]
    The value of the cap_p argument does not refer to a capability state in working storage.

[EPERM]
    The caller attempted to set a capability flag of a capability that was not permitted to the invoking process.

[ENOMEM]
    This function requires more memory than is allowed by the hardware or system-imposed memory management constraints.

SEE ALSO
cap(3), cap_get_proc(3), posix1e(3)

STANDARDS
POSIX.1e is described in IEEE POSIX.1e draft 17. Discussion of the draft continues on the cross-platform POSIX.1e implementation mailing list. To join this list, see the FreeBSD POSIX.1e implementation page for more information.

HISTORY
Support for POSIX.1e Capabilities was developed as part of the TrustedBSD Project. POSIX.1e Capability support was introduced in FreeBSD 5.0, and development continues.

AUTHORS
Robert N M Watson

BUGS
These features are not yet fully implemented.