CAP_GET_FILE(3)

NAME
cap_get_file, cap_set_file, cap_get_fd, cap_set_fd - get/set capabilities of files

SYNOPSIS
#include <sys/capability.h>

cap_t cap_get_file(char const *filename);

int cap_set_file(char const *filename, cap_t caps);

cap_t cap_get_fd(int fd);

int cap_set_fd(int fd, cap_t caps);

USAGE
cc ... -lcap

DESCRIPTION
cap_get_file and cap_get_fd return the capability sets of the file specified by filename or fd. The returned value must later be disposed of by passing it to cap_free.

cap_set_file and cap_set_fd set the capabilities of the file specified by filename or fd to caps.

RETURN VALUE
cap_get_file and cap_get_fd return a non-NULL value on success, and NULL on failure.

cap_set_file and cap_set_fd return zero on success, and -1 on failure.

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

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