mirror of
git://sourceware.org/git/glibc.git
synced 2025-01-18 12:16:13 +08:00
Move node Argp Helper Functions to follow Argp Parsing State
Resolves BZ #14246.
This commit is contained in:
parent
f70bfe80e2
commit
3c8b4190fe
@ -1,5 +1,9 @@
|
||||
2012-12-11 Siddhesh Poyarekar <siddhesh@redhat.com>
|
||||
|
||||
[BZ #14246]
|
||||
* manual/argp.texi (Argp Helper Functions): Move node to follow
|
||||
Argp Parsing State.
|
||||
|
||||
[BZ #14872]
|
||||
* manual/conf.texi (Limits on File System Capacity): Mention if
|
||||
terminating null is included in the max size.
|
||||
|
20
NEWS
20
NEWS
@ -14,16 +14,16 @@ Version 2.17
|
||||
12140, 13013, 13412, 13542, 13601, 13603, 13604, 13629, 13679, 13696,
|
||||
13698, 13717, 13741, 13759, 13761, 13763, 13881, 13939, 13950, 13952,
|
||||
13966, 14042, 14047, 14090, 14150, 14151, 14152, 14154, 14157, 14166,
|
||||
14173, 14195, 14197, 14237, 14251, 14252, 14283, 14298, 14303, 14307,
|
||||
14328, 14331, 14336, 14337, 14347, 14349, 14368, 14376, 14417, 14447,
|
||||
14459, 14476, 14477, 14501, 14505, 14510, 14516, 14518, 14519, 14530,
|
||||
14532, 14538, 14543, 14544, 14545, 14557, 14562, 14568, 14576, 14579,
|
||||
14583, 14587, 14595, 14602, 14610, 14621, 14638, 14645, 14648, 14652,
|
||||
14660, 14661, 14669, 14672, 14683, 14694, 14716, 14719, 14743, 14767,
|
||||
14783, 14784, 14785, 14793, 14796, 14797, 14801, 14803, 14805, 14807,
|
||||
14811, 14815, 14821, 14822, 14824, 14828, 14831, 14833, 14835, 14838,
|
||||
14856, 14863, 14865, 14866, 14868, 14869, 14871, 14872, 14879, 14889,
|
||||
14893, 14898, 14914.
|
||||
14173, 14195, 14197, 14237, 14246, 14251, 14252, 14283, 14298, 14303,
|
||||
14307, 14328, 14331, 14336, 14337, 14347, 14349, 14368, 14376, 14417,
|
||||
14447, 14459, 14476, 14477, 14501, 14505, 14510, 14516, 14518, 14519,
|
||||
14530, 14532, 14538, 14543, 14544, 14545, 14557, 14562, 14568, 14576,
|
||||
14579, 14583, 14587, 14595, 14602, 14610, 14621, 14638, 14645, 14648,
|
||||
14652, 14660, 14661, 14669, 14672, 14683, 14694, 14716, 14719, 14743,
|
||||
14767, 14783, 14784, 14785, 14793, 14796, 14797, 14801, 14803, 14805,
|
||||
14807, 14811, 14815, 14821, 14822, 14824, 14828, 14831, 14833, 14835,
|
||||
14838, 14856, 14863, 14865, 14866, 14868, 14869, 14871, 14872, 14879,
|
||||
14889, 14893, 14898, 14914.
|
||||
|
||||
* CVE-2011-4609 svc_run() produces high cpu usage when accept fails with
|
||||
EMFILE has been fixed (Bugzilla #14889).
|
||||
|
158
manual/argp.texi
158
manual/argp.texi
@ -561,85 +561,6 @@ function returned an error value, each parser is called with
|
||||
@code{ARGP_KEY_ERROR}. No further calls are made, except the final call
|
||||
with @code{ARGP_KEY_FINI}.
|
||||
|
||||
@node Argp Helper Functions, , Argp Parsing State, Argp Parser Functions
|
||||
@subsubsection Functions For Use in Argp Parsers
|
||||
|
||||
Argp provides a number of functions available to the user of argp
|
||||
(@pxref{Argp Parser Functions}), mostly for producing error messages.
|
||||
These take as their first argument the @var{state} argument to the
|
||||
parser function. @xref{Argp Parsing State}.
|
||||
|
||||
|
||||
@cindex usage messages, in argp
|
||||
@comment argp.h
|
||||
@comment GNU
|
||||
@deftypefun void argp_usage (const struct argp_state *@var{state})
|
||||
Outputs the standard usage message for the argp parser referred to by
|
||||
@var{state} to @code{@var{state}->err_stream} and terminate the program
|
||||
with @code{exit (argp_err_exit_status)}. @xref{Argp Global Variables}.
|
||||
@end deftypefun
|
||||
|
||||
@cindex syntax error messages, in argp
|
||||
@comment argp.h
|
||||
@comment GNU
|
||||
@deftypefun void argp_error (const struct argp_state *@var{state}, const char *@var{fmt}, @dots{})
|
||||
Prints the printf format string @var{fmt} and following args, preceded
|
||||
by the program name and @samp{:}, and followed by a @w{@samp{Try @dots{}
|
||||
--help}} message, and terminates the program with an exit status of
|
||||
@code{argp_err_exit_status}. @xref{Argp Global Variables}.
|
||||
@end deftypefun
|
||||
|
||||
@cindex error messages, in argp
|
||||
@comment argp.h
|
||||
@comment GNU
|
||||
@deftypefun void argp_failure (const struct argp_state *@var{state}, int @var{status}, int @var{errnum}, const char *@var{fmt}, @dots{})
|
||||
Similar to the standard gnu error-reporting function @code{error}, this
|
||||
prints the program name and @samp{:}, the printf format string
|
||||
@var{fmt}, and the appropriate following args. If it is non-zero, the
|
||||
standard unix error text for @var{errnum} is printed. If @var{status} is
|
||||
non-zero, it terminates the program with that value as its exit status.
|
||||
|
||||
The difference between @code{argp_failure} and @code{argp_error} is that
|
||||
@code{argp_error} is for @emph{parsing errors}, whereas
|
||||
@code{argp_failure} is for other problems that occur during parsing but
|
||||
don't reflect a syntactic problem with the input, such as illegal values
|
||||
for options, bad phase of the moon, etc.
|
||||
@end deftypefun
|
||||
|
||||
@comment argp.h
|
||||
@comment GNU
|
||||
@deftypefun void argp_state_help (const struct argp_state *@var{state}, FILE *@var{stream}, unsigned @var{flags})
|
||||
Outputs a help message for the argp parser referred to by @var{state},
|
||||
to @var{stream}. The @var{flags} argument determines what sort of help
|
||||
message is produced. @xref{Argp Help Flags}.
|
||||
@end deftypefun
|
||||
|
||||
Error output is sent to @code{@var{state}->err_stream}, and the program
|
||||
name printed is @code{@var{state}->name}.
|
||||
|
||||
The output or program termination behavior of these functions may be
|
||||
suppressed if the @code{ARGP_NO_EXIT} or @code{ARGP_NO_ERRS} flags are
|
||||
passed to @code{argp_parse}. @xref{Argp Flags}.
|
||||
|
||||
This behavior is useful if an argp parser is exported for use by other
|
||||
programs (e.g., by a library), and may be used in a context where it is
|
||||
not desirable to terminate the program in response to parsing errors. In
|
||||
argp parsers intended for such general use, and for the case where the
|
||||
program @emph{doesn't} terminate, calls to any of these functions should
|
||||
be followed by code that returns the appropriate error code:
|
||||
|
||||
@smallexample
|
||||
if (@var{bad argument syntax})
|
||||
@{
|
||||
argp_usage (@var{state});
|
||||
return EINVAL;
|
||||
@}
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
If a parser function will @emph{only} be used when @code{ARGP_NO_EXIT}
|
||||
is not set, the return may be omitted.
|
||||
|
||||
@node Argp Parsing State, Argp Helper Functions, Argp Special Keys, Argp Parser Functions
|
||||
@subsubsection Argp Parsing State
|
||||
|
||||
@ -726,6 +647,85 @@ Private, for use by the argp implementation.
|
||||
@end table
|
||||
@end deftp
|
||||
|
||||
@node Argp Helper Functions, , Argp Parsing State, Argp Parser Functions
|
||||
@subsubsection Functions For Use in Argp Parsers
|
||||
|
||||
Argp provides a number of functions available to the user of argp
|
||||
(@pxref{Argp Parser Functions}), mostly for producing error messages.
|
||||
These take as their first argument the @var{state} argument to the
|
||||
parser function. @xref{Argp Parsing State}.
|
||||
|
||||
|
||||
@cindex usage messages, in argp
|
||||
@comment argp.h
|
||||
@comment GNU
|
||||
@deftypefun void argp_usage (const struct argp_state *@var{state})
|
||||
Outputs the standard usage message for the argp parser referred to by
|
||||
@var{state} to @code{@var{state}->err_stream} and terminate the program
|
||||
with @code{exit (argp_err_exit_status)}. @xref{Argp Global Variables}.
|
||||
@end deftypefun
|
||||
|
||||
@cindex syntax error messages, in argp
|
||||
@comment argp.h
|
||||
@comment GNU
|
||||
@deftypefun void argp_error (const struct argp_state *@var{state}, const char *@var{fmt}, @dots{})
|
||||
Prints the printf format string @var{fmt} and following args, preceded
|
||||
by the program name and @samp{:}, and followed by a @w{@samp{Try @dots{}
|
||||
--help}} message, and terminates the program with an exit status of
|
||||
@code{argp_err_exit_status}. @xref{Argp Global Variables}.
|
||||
@end deftypefun
|
||||
|
||||
@cindex error messages, in argp
|
||||
@comment argp.h
|
||||
@comment GNU
|
||||
@deftypefun void argp_failure (const struct argp_state *@var{state}, int @var{status}, int @var{errnum}, const char *@var{fmt}, @dots{})
|
||||
Similar to the standard gnu error-reporting function @code{error}, this
|
||||
prints the program name and @samp{:}, the printf format string
|
||||
@var{fmt}, and the appropriate following args. If it is non-zero, the
|
||||
standard unix error text for @var{errnum} is printed. If @var{status} is
|
||||
non-zero, it terminates the program with that value as its exit status.
|
||||
|
||||
The difference between @code{argp_failure} and @code{argp_error} is that
|
||||
@code{argp_error} is for @emph{parsing errors}, whereas
|
||||
@code{argp_failure} is for other problems that occur during parsing but
|
||||
don't reflect a syntactic problem with the input, such as illegal values
|
||||
for options, bad phase of the moon, etc.
|
||||
@end deftypefun
|
||||
|
||||
@comment argp.h
|
||||
@comment GNU
|
||||
@deftypefun void argp_state_help (const struct argp_state *@var{state}, FILE *@var{stream}, unsigned @var{flags})
|
||||
Outputs a help message for the argp parser referred to by @var{state},
|
||||
to @var{stream}. The @var{flags} argument determines what sort of help
|
||||
message is produced. @xref{Argp Help Flags}.
|
||||
@end deftypefun
|
||||
|
||||
Error output is sent to @code{@var{state}->err_stream}, and the program
|
||||
name printed is @code{@var{state}->name}.
|
||||
|
||||
The output or program termination behavior of these functions may be
|
||||
suppressed if the @code{ARGP_NO_EXIT} or @code{ARGP_NO_ERRS} flags are
|
||||
passed to @code{argp_parse}. @xref{Argp Flags}.
|
||||
|
||||
This behavior is useful if an argp parser is exported for use by other
|
||||
programs (e.g., by a library), and may be used in a context where it is
|
||||
not desirable to terminate the program in response to parsing errors. In
|
||||
argp parsers intended for such general use, and for the case where the
|
||||
program @emph{doesn't} terminate, calls to any of these functions should
|
||||
be followed by code that returns the appropriate error code:
|
||||
|
||||
@smallexample
|
||||
if (@var{bad argument syntax})
|
||||
@{
|
||||
argp_usage (@var{state});
|
||||
return EINVAL;
|
||||
@}
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
If a parser function will @emph{only} be used when @code{ARGP_NO_EXIT}
|
||||
is not set, the return may be omitted.
|
||||
|
||||
@node Argp Children, Argp Help Filtering, Argp Parser Functions, Argp Parsers
|
||||
@subsection Combining Multiple Argp Parsers
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user