diff options
author | Andrew G. Morgan <morgan@kernel.org> | 2021-11-20 16:36:44 -0800 |
---|---|---|
committer | Andrew G. Morgan <morgan@kernel.org> | 2021-11-20 16:36:44 -0800 |
commit | f7deb5ad451458eeec20f9e7546d731e932bec2c (patch) | |
tree | 0bb61c8800d8ff806ec57ac8a3b044c4713492c3 | |
parent | e0582d0aee30032190222c110d72d7be22c715af (diff) | |
download | libcap-f7deb5ad451458eeec20f9e7546d731e932bec2c.tar.gz |
Add some information about cap_max_bits().
This function has been defined for a while (since libcap-2.30),
but I just found it wasn't documented.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
-rw-r--r-- | doc/cap_clear.3 | 16 | ||||
-rw-r--r-- | doc/cap_max_bits.3 | 1 | ||||
-rw-r--r-- | doc/libcap.3 | 1 |
3 files changed, 17 insertions, 1 deletions
diff --git a/doc/cap_clear.3 b/doc/cap_clear.3 index a1c40d5..0321515 100644 --- a/doc/cap_clear.3 +++ b/doc/cap_clear.3 @@ -15,6 +15,7 @@ int cap_fill_flag(cap_t cap_p, cap_flag_t to, const cap_t ref, cap_flag_t from); int cap_fill(cap_t cap_p, cap_flag_t to, cap_flag_t from); int cap_compare(cap_t cap_a, cap_t cap_b); +cap_value_t cap_max_bits(); .fi .sp Link with \fI\-lcap\fP. @@ -108,6 +109,14 @@ evaluates to non-zero if the returned differs in its .I flag components. +.PP +.BR cap_max_bits () +returns the number of capability values known to the running +kernel. This may differ from libcap's list known at compilation +time. Unnamed, at compilation time, capabilites can be referred to +numerically and libcap will handle them appropriately. Note, the +running kernel wins and it gets to define what "all" capabilities +means. .SH "RETURN VALUE" .BR cap_clear (), .BR cap_clear_flag (), @@ -117,7 +126,12 @@ and .BR cap_compare () return zero on success, and \-1 on failure. Other return values for .BR cap_compare () -are described above. +are described above. The function +.BR cap_max_bits () +returns a numeric value of type +.B cap_value_t +that is one larger than the largest actual value known to the running +kernel. .PP On failure, .I errno diff --git a/doc/cap_max_bits.3 b/doc/cap_max_bits.3 new file mode 100644 index 0000000..db506c6 --- /dev/null +++ b/doc/cap_max_bits.3 @@ -0,0 +1 @@ +.so man3/cap_clear.3 diff --git a/doc/libcap.3 b/doc/libcap.3 index b8c8520..c1ae4ba 100644 --- a/doc/libcap.3 +++ b/doc/libcap.3 @@ -21,6 +21,7 @@ cap_t cap_get_fd(int fd); cap_t cap_get_file(const char *path_p); int cap_get_flag(cap_t cap_p, cap_value_t cap , cap_flag_t flag, cap_flag_value_t *value_p); +cap_value_t cap_max_bits(); #include <sys/types.h> |