aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawk.texi
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2012-04-01 17:07:45 -0400
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2012-04-01 17:07:45 -0400
commit3438b2129cd933e430349a6bd66a1933071c92c2 (patch)
tree13846c11f27fd037e4e3025cfbd9601c4ba8f975 /doc/gawk.texi
parent4d26f7436c0acf8617c4736f110f06e2f4531bbd (diff)
downloadegawk-3438b2129cd933e430349a6bd66a1933071c92c2.tar.gz
egawk-3438b2129cd933e430349a6bd66a1933071c92c2.tar.bz2
egawk-3438b2129cd933e430349a6bd66a1933071c92c2.zip
Update ERRNO API.
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r--doc/gawk.texi32
1 files changed, 20 insertions, 12 deletions
diff --git a/doc/gawk.texi b/doc/gawk.texi
index eaad54d2..7b46026b 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -29460,21 +29460,29 @@ This is a convenience macro that calls @code{get_actual_argument()}.
@cindex functions, return values@comma{} setting
@cindex @code{ERRNO} variable
-@cindex @code{update_ERRNO()} internal function
-@cindex internal function, @code{update_ERRNO()}
-@item void update_ERRNO(void)
+@cindex @code{update_ERRNO_int()} internal function
+@cindex internal function, @code{update_ERRNO_int()}
+@item void update_ERRNO_int(int errno_saved)
This function is called from within a C extension function to set
-the value of @command{gawk}'s @code{ERRNO} variable, based on the current
-value of the C @code{errno} global variable.
+the value of @command{gawk}'s @code{ERRNO} variable, based on the error
+value provided as the argument.
It is provided as a convenience.
@cindex @code{ERRNO} variable
-@cindex @code{update_ERRNO_saved()} internal function
-@cindex internal function, @code{update_ERRNO_saved()}
-@item void update_ERRNO_saved(int errno_saved)
+@cindex @code{update_ERRNO_string()} internal function
+@cindex internal function, @code{update_ERRNO_string()}
+@item void update_ERRNO_string(const char *string, enum errno_translate)
This function is called from within a C extension function to set
-the value of @command{gawk}'s @code{ERRNO} variable, based on the error
-value provided as the argument.
+the value of @command{gawk}'s @code{ERRNO} variable to a given string.
+The second argument determines whether the string is translated before being
+installed into @code{ERRNO}. It is provided as a convenience.
+
+@cindex @code{ERRNO} variable
+@cindex @code{unset_ERRNO()} internal function
+@cindex internal function, @code{unset_ERRNO()}
+@item void unset_ERRNO(void)
+This function is called from within a C extension function to set
+the value of @command{gawk}'s @code{ERRNO} variable to a null string.
It is provided as a convenience.
@cindex @code{ENVIRON} array
@@ -29838,7 +29846,7 @@ is updated.
(void) force_string(newdir);
ret = chdir(newdir->stptr);
if (ret < 0)
- update_ERRNO();
+ update_ERRNO_int(errno);
@end example
Finally, the function returns the return value to the @command{awk} level:
@@ -29907,7 +29915,7 @@ If there's an error, it sets @code{ERRNO} and returns:
(void) force_string(file);
ret = lstat(file->stptr, & sbuf);
if (ret < 0) @{
- update_ERRNO();
+ update_ERRNO_int(errno);
return make_number((AWKNUM) ret);
@}
@end example