From: Ulrich Drepper Date: Sat, 5 Apr 1997 00:46:39 +0000 (+0000) Subject: Describe new error codes and strerror_r function. X-Git-Tag: cvs/libc20x-ud-970404~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=789a98d932ce6451188de8692089039f5830e19e;p=thirdparty%2Fglibc.git Describe new error codes and strerror_r function. --- diff --git a/manual/errno.texi b/manual/errno.texi index e346dd5f1f0..bba820869ed 100644 --- a/manual/errno.texi +++ b/manual/errno.texi @@ -1186,6 +1186,18 @@ They are not yet documented.} @comment errno ???/121 @end deftypevr +@comment errno.h +@comment Linux???: No medium found +@deftypevr Macro int ENOMEDIUM +@comment errno ???/??? +@end deftypevr + +@comment errno.h +@comment Linux???: Wrong medium type +@deftypevr Macro int EMEDIUMTYPE +@comment errno ???/??? +@end deftypevr + @node Error Messages, , Error Codes, Error Reporting @section Error Messages @@ -1214,6 +1226,25 @@ overwritten. (But it's guaranteed that no library function ever calls The function @code{strerror} is declared in @file{string.h}. @end deftypefun +@comment string.h +@comment GNU +@deftypefun {char *} strerror_r (int @var{errnum}, char *@var{buf}, size_t @var{n}) +The @code{strerror_r} function works like @code{strerror} but instead of +returning the error message in a statically allocated buffer shared by +all threads in the process, it writes the message string in the user +supplied buffer starting at @var{buf} with the length of @var{n} bytes. + +At most @var{n} characters are written (including the NUL byte) so it is +up to the user to select the buffer large enough. + +This function should always be used in multi-threaded programs since +there is no way to guarantee the string returned by @code{strerror} +really belongs to the last call of the current thread. + +This function @code{strerror_r} is a GNU extension and it is declared in +@file{string.h}. +@end deftypefun + @comment stdio.h @comment ISO @deftypefun void perror (const char *@var{message})