openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/libcap/2.27-r0/libcap-2.27/libcap/cap_proc.c
int cap_set_ambient(cap_value_t cap, cap_flag_value_t set)
{
    int result, val;
    switch (set)
    {
        case CAP_SET:
            val = PR_CAP_AMBIENT_RAISE;
            break;
        case CAP_CLEAR:
            val = PR_CAP_AMBIENT_LOWER;
            break;
        default:
            errno = EINVAL;
            return -1;
    }
    result =
        prctl(PR_CAP_AMBIENT, pr_arg(val), pr_arg(cap), pr_arg(0), pr_arg(0));
    if (result < 0)
    {
        errno = -result;
        return -1;
    }
    return result;
}
/* modify a single ambient capability value */
modify a single ambient capability value
modify a single ambient capability value
int cap_set_ambient(cap_value_t cap, cap_flag_value_t set)
{
    int result, val;
    switch (set)
    {
        case CAP_SET:
            val = PR_CAP_AMBIENT_RAISE;
            break;
        case CAP_CLEAR:
            val = PR_CAP_AMBIENT_LOWER;
            break;
        default:
            errno = EINVAL;
            return -1;
    }
    result =
        prctl(PR_CAP_AMBIENT, pr_arg(val), pr_arg(cap), pr_arg(0), pr_arg(0));
    if (result < 0)
    {
        errno = -result;
        return -1;
    }
    return result;
}
int cap_set_ambient ( cap_value_t cap , cap_flag_value_t set ) { int result , val ; switch ( set ) { case CAP_SET : val = PR_CAP_AMBIENT_RAISE ; break ; case CAP_CLEAR : val = PR_CAP_AMBIENT_LOWER ; break ; default : errno = EINVAL ; return -1 ; } result = prctl ( PR_CAP_AMBIENT , pr_arg ( val ) , pr_arg ( cap ) , pr_arg ( 0 ) , pr_arg ( 0 ) ) ; if ( result < 0 ) { errno = - result ; return -1 ; } return result ; }
modify a single ambient capability value
modify a single ambient capability value