1CAP_CLEAR(3)               Linux Programmer's Manual              CAP_CLEAR(3)
2
3
4

NAME

6       cap_clear,  cap_get_flag, cap_set_flag - capability data object manipu‐
7       lation
8

SYNOPSIS

10       #include <sys/capability.h>
11
12       int cap_clear(cap_t cap_p);
13
14       int  cap_get_flag(cap_t  cap_p,  cap_value_t  cap,   cap_flag_t   flag,
15       cap_flag_value_t *value_p);
16
17       int  cap_set_flag(cap_t  cap_p,  cap_flag_t flag, int ncap, cap_value_t
18       *caps, cap_flag_value_t value);
19

USAGE

21       cc ... -lcap
22

DESCRIPTION

24       cap_clear initializes the capability state in working  storage  identi‐
25       fied by cap_p in such a way that all capability flags are cleared.
26
27       cap_get_flag obtains the current value of the capability flag, flag, of
28       the capability, cap, from the capability state identified by cap_p  and
29       places it in the location pointed to by value_p.
30
31       cap_set_flag  sets the flag, flag, of each capability in the array caps
32       in the capability state identified by cap_p to  value.   The  argument,
33       ncap, is used to specify the number of capabilities in the array, caps.
34
35       A  cap_value_t  can  identify  any  capability,  such  as CAP_CHOWN.  A
36       cap_flag_t can be set to CAP_EFFECTIVE, CAP_INHERITABLE or  CAP_PERMIT‐
37       TED.  A cap_flag_value_t can be CAP_CLEAR (0) or CAP_SET (1).
38

RETURN VALUE

40       cap_clear, cap_get_flag and cap_set_flag return zero on success, and -1
41       on failure.
42
43       On failure, errno(3) is set to EINVAL, indicating that one of the argu‐
44       ments is invalid.
45
46

CONFORMING TO

48       These functions are specified by POSIX.1e.
49

SEE ALSO

51       cap_copy_ext(3),  cap_from_text(3),  cap_get_file(3),  cap_get_proc(3),
52       cap_init(3)
53
54
55
56                                 26th May 1997                    CAP_CLEAR(3)
Impressum