CAP_COPY_EXT(3)

NAME
cap_copy_ext, cap_size, cap_copy_int - external representation of capability sets

SYNOPSIS
#include <sys/capability.h>

ssize_t cap_copy_ext(void *extrep, cap_t caps, ssize_t length);

ssize_t cap_size(cap_t caps);

cap_t cap_copy_int(void const *extrep);

DESCRIPTION
These functions provide an external representation of POSIX.1e capabilities, suitable for storage in archives or communication over pipes, for example.

cap_copy_ext copies the capability sets caps into the buffer extrep (of length length), and returns indicating how much of the buffer was actually used.

cap_size returns indicating how large a buffer would be required to fully represent the capability set caps.

cap_copy_int takes a buffer extrep, whose contents are the result of a cap_copy_ext call, and reforms it into an internal-format capability set. The return value must eventually be disposed of by passing it to cap_free.

RETURN VALUE
cap_copy_int returns a non-NULL value on success, and NULL on failure.

On failure, errno(3) is set to EINVAL, or ENOMEM.

CONFORMING TO
These functions are specified by POSIX.1e.

SEE ALSO
cap_clear(3), cap_from_text(3), cap_get_file(3), cap_get_proc(3), cap_init(3)