kcap_is_set and kcap_is_set_cr Kernel Service

Purpose

Determines if the given capability is present in an effective capability set.

Syntax

kcap_is_set (capability)
cap_value_t capability;

kcap_is_set_cr (capability, cred)
cap_value_t capability;
struct ucred *cred;

Parameters

Item Description
capability Specifies the capability to be examined. Must be one of the capabilities named in the sys/capabilities.h header file.
cred Pointer to the credentials to be examined.

Description

The kcap_is_set subroutine determines if the given capability is present in the current process' effective capability set. The kcap_is_set_cr subroutine determines if the given capability is present in the effective capability set of the credentials structure referenced by the cred parameter. The cred parameter must be a valid referenced credentials structure.

Return Values

The kcap_is_set and kcap_is_set_cr subroutines return 1 if the capability is present. Otherwise, they return 0.