summaryrefslogtreecommitdiff
path: root/README.md
blob: d72db1a876f9eb0d2d2a6b339f6fc2a74127571a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# strerror

translate error numbers to strings or identifiers

## Synopsis
`strerror errno...`

## Description

The `strerror` utility translates error numbers to strings (via the C
function `strerror()`. If the number matches a symbolic constant defined in
the header `<errno.h>`, `strerror` will also provide that name.

## Operands

The `strerror` utility supports the following operands:

`errno`	A numeric error number, typically obtained from the value of the C
	identifier `errno`.

## STDIN

Not used.

## Input Files

None.

## STDOUT

The `strerror` utility writes the translation of each operand, one per line,
in the following format:

`"%d: %s [%s]\n", /errno/, /error_string/, /ERROR_DEFINE/`

In this, `/errno/` is the value provided as an operand, `/error_string/` is
the string returned by the C function `strerror()`, and `/ERROR_DEFINE/` is
the name of the symbolic constant defined to `/errno/` in `<errno.h>`. If
`/errno/` does not match a known symbolic constant, `/ERROR_DEFINE/` will
be `-`.

## STDERR

Not used.

## Output Files

None.

## Exit Status

 0	Successful completion.
 >0	An error occurred.