3 <<strerror_r>>---convert error number to string and copy to buffer
10 char *strerror_r(int <[errnum]>, char *<[buffer]>, size_t <[n]>);
14 char *strerror_r(<[errnum]>, <[buffer]>, <[n]>)
20 <<strerror_r>> converts the error number <[errnum]> into a
21 string and copies the result into the supplied <[buffer]> for
22 a length up to <[n]>, including the NUL terminator. The value of
23 <[errnum]> is usually a copy of <<errno>>. If <<errnum>> is not a known
24 error number, the result is the empty string.
26 See <<strerror>> for how strings are mapped to <<errnum>>.
29 This function returns a pointer to a string. Your application must
30 not modify that string.
33 <<strerror_r>> is a gnu extension.
35 <<strerror_r>> requires no supporting OS subroutines.
39 #undef __STRICT_ANSI__
44 _DEFUN (strerror_r
, (errnum
, buffer
, n
),
50 error
= strerror (errnum
);
52 return strncpy (buffer
, (const char *)error
, n
);