diff options
author | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-09-26 18:16:17 +0000 |
---|---|---|
committer | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-09-26 18:16:17 +0000 |
commit | 614a23c65d9eabed00a5fe30a4d0fa138b6aa5e9 (patch) | |
tree | 3731ea290c206f61394a41a0ef3959828587369f /libiberty/strerror.c | |
parent | 06c92cbc412348d781face036e144c36d0f73fc5 (diff) | |
download | gcc-614a23c65d9eabed00a5fe30a4d0fa138b6aa5e9.tar.gz |
* configure.in (MAKEINFO, PERL): Detect these.
(--enable-maintainer-mode): Add.
* configure: Regenerate.
* Makefile.in (MAKEINFO, PERL): Define.
(libiberty.info, libiberty.dvi, libiberty.html): New.
(CFILES): Add bsearch.c.
(CONFIGURED_OFILES): New, list of objects configure might add.
(maint-missing, maint-buildall): New, for maintainers only.
(clean, mostlyclean): Add info/dvi/html files.
* libiberty.texi, copying-lib.texi, obstacks.texi, functions.texi: New.
* gather-docs: New, for maintainers.
* maint-tool: New, for maintainers.
* alloca.c, atexit.c, basename.c, bcmp.c, bcopy.c, bsearch.c,
bzero.c, calloc.c, clock.c, configure.in, configure, getcwd.c,
getpagesize.c, getpwd.c, index.c, memchr.c, memcmp.c, memcpy.c,
memmove.c, memset.c, putenv.c, rename.c, rindex.c, setenv.c,
sigsetmask.c, strcasecmp.c, strchr.c, strdup.c, strerror.c,
strncasecmp.c, strncmp.c, strrchr.c, strstr.c, strtod.c, strtol.c,
tmpnam.c, vfork.c, vprintf.c, waitpid.c, xatexit.c, xexit.c,
xmalloc.c, xmemdup.c, xstrdup.c, xstrerror.c: Add or update
documentation.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45828 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/strerror.c')
-rw-r--r-- | libiberty/strerror.c | 113 |
1 files changed, 44 insertions, 69 deletions
diff --git a/libiberty/strerror.c b/libiberty/strerror.c index ba837e32332..dbc29a30f34 100644 --- a/libiberty/strerror.c +++ b/libiberty/strerror.c @@ -562,28 +562,23 @@ init_error_tables () /* -NAME - - errno_max -- return the max errno value -SYNOPSIS +@deftypefn Replacement int errno_max (void) - int errno_max (); +Returns the maximum @code{errno} value for which a corresponding +symbolic name or message is available. Note that in the case where we +use the @code{sys_errlist} supplied by the system, it is possible for +there to be more symbolic names than messages, or vice versa. In +fact, the manual page for @code{perror(3C)} explicitly warns that one +should check the size of the table (@code{sys_nerr}) before indexing +it, since new error codes may be added to the system before they are +added to the table. Thus @code{sys_nerr} might be smaller than value +implied by the largest @code{errno} value defined in @file{errno.h}. -DESCRIPTION +We return the maximum value that can be used to obtain a meaningful +symbolic name or message. - Returns the maximum errno value for which a corresponding symbolic - name or message is available. Note that in the case where - we use the sys_errlist supplied by the system, it is possible for - there to be more symbolic names than messages, or vice versa. - In fact, the manual page for perror(3C) explicitly warns that one - should check the size of the table (sys_nerr) before indexing it, - since new error codes may be added to the system before they are - added to the table. Thus sys_nerr might be smaller than value - implied by the largest errno value defined in <errno.h>. - - We return the maximum value that can be used to obtain a meaningful - symbolic name or message. +@end deftypefn */ @@ -604,31 +599,25 @@ errno_max () /* -NAME +@deftypefn Replacement char* strerror (int @var{errnoval}) - strerror -- map an error number to an error message string +Maps an @code{errno} number to an error message string, the contents +of which are implementation defined. On systems which have the +external variables @code{sys_nerr} and @code{sys_errlist}, these +strings will be the same as the ones used by @code{perror}. -SYNOPSIS +If the supplied error number is within the valid range of indices for +the @code{sys_errlist}, but no message is available for the particular +error number, then returns the string @samp{"Error NUM"}, where NUM is +the error number. - char *strerror (int errnoval) +If the supplied error number is not a valid index into +@code{sys_errlist}, returns NULL. -DESCRIPTION - - Maps an errno number to an error message string, the contents of - which are implementation defined. On systems which have the external - variables sys_nerr and sys_errlist, these strings will be the same - as the ones used by perror(). - - If the supplied error number is within the valid range of indices - for the sys_errlist, but no message is available for the particular - error number, then returns the string "Error NUM", where NUM is the - error number. +The returned string is only guaranteed to be valid only until the +next call to @code{strerror}. - If the supplied error number is not a valid index into sys_errlist, - returns NULL. - - The returned string is only guaranteed to be valid only until the - next call to strerror. +@end deftypefn */ @@ -678,32 +667,24 @@ strerror (errnoval) /* -NAME +@deftypefn Replacement const char* strerrno (int @var{errnum}) - strerrno -- map an error number to a symbolic name string +Given an error number returned from a system call (typically returned +in @code{errno}), returns a pointer to a string containing the +symbolic name of that error number, as found in @file{errno.h}. -SYNOPSIS +If the supplied error number is within the valid range of indices for +symbolic names, but no name is available for the particular error +number, then returns the string @samp{"Error NUM"}, where NUM is the +error number. - const char *strerrno (int errnoval) +If the supplied error number is not within the range of valid +indices, then returns NULL. -DESCRIPTION - - Given an error number returned from a system call (typically - returned in errno), returns a pointer to a string containing the - symbolic name of that error number, as found in <errno.h>. - - If the supplied error number is within the valid range of indices - for symbolic names, but no name is available for the particular - error number, then returns the string "Error NUM", where NUM is - the error number. - - If the supplied error number is not within the range of valid - indices, then returns NULL. - -BUGS +The contents of the location pointed to are only guaranteed to be +valid until the next call to strerrno. - The contents of the location pointed to are only guaranteed to be - valid until the next call to strerrno. +@end deftypefn */ @@ -746,18 +727,12 @@ strerrno (errnoval) /* -NAME - - strtoerrno -- map a symbolic errno name to a numeric value - -SYNOPSIS - - int strtoerrno (char *name) +@deftypefn Replacement int strtoerrno (const char *@var{name}) -DESCRIPTION +Given the symbolic name of a error number (e.g., @code{EACCESS}), map it +to an errno value. If no translation is found, returns 0. - Given the symbolic name of a error number, map it to an errno value. - If no translation is found, returns 0. +@end deftypefn */ |