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_alloc.c
cap_t cap_dup(cap_t cap_d)
{
    cap_t result;

    if (!good_cap_t(cap_d))
    {
        _cap_debug("bad argument");
        errno = EINVAL;
        return NULL;
    }

    result = cap_init();
    if (result == NULL)
    {
        _cap_debug("out of memory");
        return NULL;
    }

    memcpy(result, cap_d, sizeof(*cap_d));

    return result;
}
/*
 * This function duplicates an internal capability set with
 * malloc()'d memory. It is the responsibility of the user to call
 * cap_free() to liberate it.
 */
This function duplicates an internal capability set with
malloc()'d memory. It is the responsibility of the user to call
cap_free() to liberate it.
This function duplicates an internal capability set with malloc () ' d memory . It is the responsibility of the user to call cap_free () to liberate it .
cap_t cap_dup(cap_t cap_d)
{
    cap_t result;
    if (!good_cap_t(cap_d))
    {
        _cap_debug("bad argument");
        errno = EINVAL;
        return NULL;
    }
    result = cap_init();
    if (result == NULL)
    {
        _cap_debug("out of memory");
        return NULL;
    }
    memcpy(result, cap_d, sizeof(*cap_d));
    return result;
}
cap_t cap_dup ( cap_t cap_d ) { cap_t result ; if ( ! good_cap_t ( cap_d ) ) { _cap_debug ( " " ) ; errno = EINVAL ; return NULL ; } result = cap_init ( ) ; if ( result == NULL ) { _cap_debug ( " " ) ; return NULL ; } memcpy ( result , cap_d , sizeof ( * cap_d ) ) ; return result ; }
This function duplicates an internal capability set with
 malloc()'d memory.
This function duplicates an internal capability set with malloc () ' d memory .