1ERRNO(3am) GNU Awk Extension Modules ERRNO(3am)
2
3
4
6 errno - convert errno values to strings and vice versa
7
9 @load "errno"
10
11 string = strerror(11)
12 string = errno2name(11)
13 integer = name2errno("EAGAIN")
14
16 This extension is useful for working with the gawk PROCINFO ["errno"]
17 value. The errno extension adds three functions named strerror(),
18 errno2name(), and name2errno(), as follows:
19
20 strerror()
21 This function takes an integer argument and returns the result
22 from calling the strerror(3) C library function. If the argu‐
23 ment is not numeric, it will return an empty string.
24
25 errno2name()
26 This function takes an integer argument and returns the symbolic
27 name for the associated errno value. For example, the returned
28 value might be EACCES or EAGAIN. An empty string is returned
29 for an unrecognized argument.
30
31 name2errno()
32 This function takes a string argument and returns the integer
33 value associated with that symbolic errno value. For example,
34 if the argument is "EAGAIN", the returned value might be 11.
35 For unrecognized arguments, a value of -1 is returned.
36
38 @load "errno"
39 ...
40 printf "The numeric value of 'EAGAIN' is %d\n", name2errno("EAGAIN")
41 printf "The string value of 11 is %s\n", errno2name(11)
42 printf "The description of errno 11 is '%s'\n", strerror(11)
43
45 strerror(3)
46
48 Andrew Schorr
49
51 Copyright © 2012, 2013, Free Software Foundation, Inc.
52
53 Permission is granted to make and distribute verbatim copies of this
54 manual page provided the copyright notice and this permission notice
55 are preserved on all copies.
56
57 Permission is granted to copy and distribute modified versions of this
58 manual page under the conditions for verbatim copying, provided that
59 the entire resulting derived work is distributed under the terms of a
60 permission notice identical to this one.
61
62 Permission is granted to copy and distribute translations of this man‐
63 ual page into another language, under the above conditions for modified
64 versions, except that this permission notice may be stated in a trans‐
65 lation approved by the Foundation.
66
67
68
69Free Software Foundation Jan 15 2013 ERRNO(3am)