diff options
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r-- | doc/gawk.texi | 32 |
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 |