diff options
author | Michael Kerrisk <mtk.manpages@googlemail.com> | 2008-05-09 17:50:42 -0700 |
---|---|---|
committer | Andrew G. Morgan <morgan@kernel.org> | 2008-05-09 17:50:42 -0700 |
commit | 404b5b706ae180c3033e47c670252254ea1d5329 (patch) | |
tree | 820fd55f13c61fc161beaa9b1f003bc98e994596 | |
parent | 28efaf50bfbff71c406ad75af43ce9d26a02f7ab (diff) | |
download | libcap-404b5b706ae180c3033e47c670252254ea1d5329.tar.gz |
More doc fixes
[AGM folded in a couple of minor things too - and a .gitignore change.]
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | doc/cap_clear.3 | 11 | ||||
-rw-r--r-- | doc/cap_copy_ext.3 | 14 | ||||
-rw-r--r-- | doc/cap_from_text.3 | 15 | ||||
-rw-r--r-- | doc/cap_get_file.3 | 8 | ||||
-rw-r--r-- | doc/cap_get_proc.3 | 6 | ||||
-rw-r--r-- | doc/cap_init.3 | 6 |
7 files changed, 35 insertions, 26 deletions
@@ -1 +1,2 @@ *.o +*~ diff --git a/doc/cap_clear.3 b/doc/cap_clear.3 index 466ff38..dd73b0c 100644 --- a/doc/cap_clear.3 +++ b/doc/cap_clear.3 @@ -2,17 +2,22 @@ .SH NAME cap_clear, cap_get_flag, cap_set_flag \- capability data object manipulation .SH SYNOPSIS +.nf .B #include <sys/capability.h> .sp .BI "int cap_clear(cap_t " cap_p ); .sp .BI "int cap_clear_flag(cap_t " cap_p ", cap_flag_t " flag ");" .sp -.BI "int cap_get_flag(cap_t " cap_p ", cap_value_t " cap ", cap_flag_t " flag ", cap_flag_value_t *" value_p ");" +.BI "int cap_get_flag(cap_t " cap_p ", cap_value_t " cap , +.BI " cap_flag_t " flag ", cap_flag_value_t *" value_p ");" .sp -.BI "int cap_set_flag(cap_t " cap_p ", cap_flag_t " flag ", int " ncap ", const cap_value_t *" caps ", cap_flag_value_t " value ");" +.BI "int cap_set_flag(cap_t " cap_p ", cap_flag_t " flag ", int " ncap , +.BI " const cap_value_t *" caps \ +", cap_flag_value_t " value ");" .sp Link with \fI-lcap\fP. +.fi .SH DESCRIPTION .BR cap_clear () initializes the capability state in working storage identified by @@ -72,7 +77,7 @@ can be .BR cap_clear_flag (), .BR cap_get_flag () and -.B cap_set_flag +.BR cap_set_flag () return zero on success, and \-1 on failure. .PP On failure, diff --git a/doc/cap_copy_ext.3 b/doc/cap_copy_ext.3 index 0682f52..59edca1 100644 --- a/doc/cap_copy_ext.3 +++ b/doc/cap_copy_ext.3 @@ -3,7 +3,8 @@ .\" .TH CAP_COPY_EXT 3 "26th May 1997" "" "Linux Programmer's Manual" .SH NAME -cap_copy_ext, cap_size, cap_copy_int \- capability state external representation translation +cap_copy_ext, cap_size, cap_copy_int \- capability state +external representation translation .SH SYNOPSIS .B #include <sys/capability.h> .sp @@ -16,7 +17,8 @@ cap_copy_ext, cap_size, cap_copy_int \- capability state external representation Link with \fI-lcap\fP. .SH DESCRIPTION These functions translate a capability state from an internal representation -into an external one. The external representation is an exportable, contiguous, +into an external one. +The external representation is an exportable, contiguous, persistent representation of a capability state in user-managed space. The internal representation is managed by the capability functions in working storage. @@ -26,7 +28,7 @@ returns the total length (in bytes) that the capability state in working storage identified by .I cap_p would require when converted by -.BR cap_copy_ext . +.BR cap_copy_ext (). This function is used primarily to determine the amount of buffer space that must be provided to the .BR cap_copy_ext () @@ -43,8 +45,10 @@ represents the maximum size, in bytes, of the resulting data record. The .BR cap_copy_ext () function will do any conversions necessary to convert the capability state from the undefined internal format to an exportable, contiguous, persistent -data record. It is the responsibility of the user to allocate a buffer large -enough to hold the copied data. The buffer length required to hold the copied +data record. +It is the responsibility of the user to allocate a buffer large +enough to hold the copied data. +The buffer length required to hold the copied data may be obtained by a call to the .BR cap_size () function. diff --git a/doc/cap_from_text.3 b/doc/cap_from_text.3 index 5b62129..f259ea0 100644 --- a/doc/cap_from_text.3 +++ b/doc/cap_from_text.3 @@ -3,7 +3,8 @@ .\" .TH CAP_FROM_TEXT 3 "21th Jan 2008" "" "Linux Programmer's Manual" .SH NAME -cap_from_text, cap_to_text, cap_to_name, cap_from_name \- capability state textual representation translation +cap_from_text, cap_to_text, cap_to_name, cap_from_name \- capability +state textual representation translation .SH SYNOPSIS .B #include <sys/capability.h> .sp @@ -18,7 +19,8 @@ cap_from_text, cap_to_text, cap_to_name, cap_from_name \- capability state textu Link with \fI-lcap\fP. .SH DESCRIPTION These functions translate a capability state from an internal representation -into a textual one. The internal representation is managed by the capability +into a textual one. +The internal representation is managed by the capability functions in working storage. The textual representation is a structured, human-readable, string suitable for display. .PP @@ -29,7 +31,8 @@ state represented by a human-readable, nul terminated, character string pointed to by .IR buf_p . It returns a pointer to the newly created capability state. The -caller should free any releasable memory, when the capability state in working +caller should free any releasable memory, +when the capability state in working storage is no longer required, by calling .BR cap_free () with @@ -49,8 +52,7 @@ into a null terminated human-readable string. This function allocates any memory necessary to contain the string, and returns a pointer to the string. If the pointer .I len_p -is not -.BR NULL , +is not NULL, the function shall also return the full length of the string (not including the nul terminator) in the location pointed to by .IR len_p . @@ -70,8 +72,7 @@ Writing the decoded value into .IR *cap_p . If .I cap_p -is -.B NULL +is NULL no result is written, but the return code of the function indicates whether or not the specified capability can be represented by the library. diff --git a/doc/cap_get_file.3 b/doc/cap_get_file.3 index 67aa997..46a8f5b 100644 --- a/doc/cap_get_file.3 +++ b/doc/cap_get_file.3 @@ -1,10 +1,10 @@ .\" -.\" $Id: cap_get_file.3,v 1.1.1.1 1999/04/17 22:16:31 morgan Exp $ .\" written by Andrew Main <zefram@dcs.warwick.ac.uk> .\" .TH CAP_GET_FILE 3 "17th May 1998" "" "Linux Programmer's Manual" .SH NAME -cap_get_file, cap_set_file, cap_get_fd, cap_set_fd \- capability manipulation on files +cap_get_file, cap_set_file, cap_get_fd, cap_set_fd \- capability +manipulation on files .sp .B " Note: support for file capabilities is anticipated in Linux 2.6.23+" .SH SYNOPSIS @@ -53,9 +53,7 @@ with the capability state identified by The new capability state of the file shall be completely determined by the contents of .IR cap_p . -A -.IR NULL -value for +A NULL value for .IR cap_p is used to indicate that capabilities for the file should be deleted. For these functions to succeed, the calling process must have the diff --git a/doc/cap_get_proc.3 b/doc/cap_get_proc.3 index c92b7aa..d3568f2 100644 --- a/doc/cap_get_proc.3 +++ b/doc/cap_get_proc.3 @@ -42,13 +42,13 @@ unchanged. .PP .BR capgetp () fills an existing -.BR cap_d , +.IR cap_d , see .BR cap_init (3), with the process capabilities of the process indicated by .IR pid . This information can also be obtained from the -.B /proc/<pid>/status +.I /proc/<pid>/status file. .SH "RETURN VALUE" .BR cap_get_proc () @@ -88,7 +88,7 @@ current process and process '1' (typically .BR init (8)); other negative values refer to the .I -pid -process-group. In order to use this function, the kernel must support +process group. In order to use this function, the kernel must support it and the current process must have .B CAP_SETPCAP raised in its Effective capability set. The capabilities set in the diff --git a/doc/cap_init.3 b/doc/cap_init.3 index 7dcd691..4c7b493 100644 --- a/doc/cap_init.3 +++ b/doc/cap_init.3 @@ -23,17 +23,17 @@ manipulated only within this working storage area. Once editing of the capability state is complete, the updated capability state is used to replace the capability state associated with the file or process. .PP -.B cap_init +.BR cap_init () creates a capability state in working storage and return a pointer to the capability state. The initial value of all flags are cleared. The caller should free any releasable memory, when the capability state in working storage is no longer required, by calling -.B cap_free +.BR cap_free () with the .I cap_t as an argument. .PP -.B cap_free +.BR cap_free () liberates any releasable memory that has been allocated to the capability state identified by .IR obj_d . |