diff options
Diffstat (limited to 'src/lib/libc/string/strerror.3')
| -rw-r--r-- | src/lib/libc/string/strerror.3 | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/lib/libc/string/strerror.3 b/src/lib/libc/string/strerror.3 index 11bacd313e..05cb7e9d9c 100644 --- a/src/lib/libc/string/strerror.3 +++ b/src/lib/libc/string/strerror.3 | |||
| @@ -33,7 +33,7 @@ | |||
| 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
| 35 | .\" | 35 | .\" |
| 36 | .\" $OpenBSD: strerror.3,v 1.4 2000/10/23 19:14:41 aaron Exp $ | 36 | .\" $OpenBSD: strerror.3,v 1.5 2002/11/21 20:45:05 marc Exp $ |
| 37 | .\" | 37 | .\" |
| 38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
| 39 | .Dt STRERROR 3 | 39 | .Dt STRERROR 3 |
| @@ -45,6 +45,8 @@ | |||
| 45 | .Fd #include <string.h> | 45 | .Fd #include <string.h> |
| 46 | .Ft char * | 46 | .Ft char * |
| 47 | .Fn strerror "int errnum" | 47 | .Fn strerror "int errnum" |
| 48 | .Ft int | ||
| 49 | .Fn strerror_r "int errnum" "char *strerrbuf" "size_t buflen" | ||
| 48 | .Sh DESCRIPTION | 50 | .Sh DESCRIPTION |
| 49 | The | 51 | The |
| 50 | .Fn strerror | 52 | .Fn strerror |
| @@ -58,6 +60,20 @@ characters, including the trailing NUL. | |||
| 58 | The array pointed to is not to be modified by the program, but may be | 60 | The array pointed to is not to be modified by the program, but may be |
| 59 | overwritten by subsequent calls to | 61 | overwritten by subsequent calls to |
| 60 | .Fn strerror . | 62 | .Fn strerror . |
| 63 | .Pp | ||
| 64 | .Fn strerror_r | ||
| 65 | is a thread safe version of | ||
| 66 | .Fn strerror | ||
| 67 | that places the error message in the given buffer | ||
| 68 | .Fa strerrbuf . | ||
| 69 | If the error message is larger then | ||
| 70 | .Fa buflen | ||
| 71 | the message will be truncated to fit within buflen and | ||
| 72 | .Er ERANGE | ||
| 73 | is returned. | ||
| 74 | .Fn strerror_r | ||
| 75 | returns zero upon successful completion. | ||
| 76 | An error number is returned, otherwise. | ||
| 61 | .Sh SEE ALSO | 77 | .Sh SEE ALSO |
| 62 | .Xr intro 2 , | 78 | .Xr intro 2 , |
| 63 | .Xr perror 3 , | 79 | .Xr perror 3 , |
| @@ -67,3 +83,7 @@ The | |||
| 67 | .Fn strerror | 83 | .Fn strerror |
| 68 | function conforms to | 84 | function conforms to |
| 69 | .St -ansiC . | 85 | .St -ansiC . |
| 86 | The | ||
| 87 | .Fn strerror_r | ||
| 88 | function conforms to | ||
| 89 | .St -p1003.1 . | ||
