Ticket #4263: man_strerr

File man_strerr, 2.8 KB (added by Jon, 11 years ago)

Manual text

Line 
1STRERROR(3) Linux Programmer’s Manual STRERROR(3)
2
3
4
5NNAAMMEE
6 strerror, strerror_r - return string describing error code
7
8SSYYNNOOPPSSIISS
9 ##iinncclluuddee <<ssttrriinngg..hh>>
10
11 cchhaarr **ssttrreerrrroorr((iinntt _e_r_r_n_u_m));;
12 iinntt ssttrreerrrroorr__rr((iinntt _e_r_r_n_u_m,, cchhaarr **_b_u_f,, ssiizzee__tt _n));;
13
14DDEESSCCRRIIPPTTIIOONN
15 The ssttrreerrrroorr(()) function returns a string describing the error code
16 passed in the argument _e_r_r_n_u_m, possibly using the LC_MESSAGES part of
17 the current locale to select the appropriate language. This string
18 must not be modified by the application, but may be modified by a sub-
19 sequent call to ppeerrrroorr(()) or ssttrreerrrroorr(()). No library function will mod-
20 ify this string.
21
22 The ssttrreerrrroorr__rr(()) function is similar to ssttrreerrrroorr(()), but is thread safe.
23 It returns the string in the user-supplied buffer _b_u_f of length _n.
24
25
26RREETTUURRNN VVAALLUUEE
27 The ssttrreerrrroorr(()) function returns the appropriate error description
28 string, or an unknown error message if the error code is unknown. The
29 value of _e_r_r_n_o is not changed for a successful call, and is set to a
30 nonzero value upon error. The ssttrreerrrroorr__rr(()) function returns 0 on suc-
31 cess and -1 on failure, setting _e_r_r_n_o.
32
33
34EERRRROORRSS
35 EEIINNVVAALL The value of _e_r_r_n_u_m is not a valid error number.
36
37 EERRAANNGGEE Insufficient storage was supplied to contain the error descrip-
38 tion string.
39
40
41CCOONNFFOORRMMIINNGG TTOO
42 SVID 3, POSIX, BSD 4.3, ISO/IEC 9899:1990 (C89).
43 ssttrreerrrroorr__rr(()) with prototype as given above is specified by SUSv3, and
44 was in use under Digital Unix and HP Unix. An incompatible function,
45 with prototype
46
47 cchhaarr **ssttrreerrrroorr__rr((iinntt _e_r_r_n_u_m,, cchhaarr **_b_u_f,, ssiizzee__tt _n));;
48
49 is a GNU extension used by glibc (since 2.0), and must be regarded as
50 obsolete in view of SUSv3. The GNU version may, but need not, use the
51 user-supplied buffer. If it does, the result may be truncated in case
52 the supplied buffer is too small. The result is always NUL-terminated.
53
54SSEEEE AALLSSOO
55 eerrrrnnoo(3), ppeerrrroorr(3), ssttrrssiiggnnaall(3)
56
57
58
59 2001-10-16 STRERROR(3)