CAP_SET_FLAG(3)

NAME
cap_set_flag - Set the Value of a Capability Flag

SYNOPSIS
#include <sys/types.h>
#include <sys/capability.h>
int
cap_set_flag(cap_t cap_p, cap_flag_t flag, int ncap, cap_value_t caps[], cap_flag_value_t value);

DESCRIPTION
This function shall set the flag flag of each capability in the array caps in the capability state in working storage identified by cap_p to value. The argument ncap is used to specify the number of capabilities in the array caps. Implementations may place restrictions on the setting of the flags in a capability state.

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. The capability state identified by cap_p shall not be affected if the return value is -1.

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

[er EINVAL]
    At least one of the values of cap_p, ncap, flag and value, or at least one of the first ncap elements in caps, does not refer to the corresponding entity.

    The resulting capability state identified by cap_p violates one or more implementation restrictions.

SEE ALSO
cap(3), cap_get_flag(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.