From: Simon Josefsson Date: Tue, 7 Nov 2006 10:35:21 +0000 (+0000) Subject: More errno discussion regarding push/pull functions. X-Git-Tag: gnutls_1_5_4~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=29886dd6f289df197a83fdff5ba015fea964064a;p=thirdparty%2Fgnutls.git More errno discussion regarding push/pull functions. --- diff --git a/doc/gnutls.texi b/doc/gnutls.texi index 57447a9760..ac42a8c4e9 100644 --- a/doc/gnutls.texi +++ b/doc/gnutls.texi @@ -372,17 +372,24 @@ required callbacks to access the transport layer. @item @ref{gnutls_transport_set_pull_function} @item @ref{gnutls_transport_set_ptr} @item @ref{gnutls_transport_set_lowat} +@item @ref{gnutls_transport_set_errno} @end itemize These functions accept a callback function as a parameter. The callback functions should return the number of bytes written, or -1 on error and should set @code{errno} appropriately. +In some environments, setting @code{errno} is unreliable, for example +Windows have several errno variables in different CRTs, or it may be +that errno is not a thread-local variable. If this is a concern to +you, call @code{gnutls_transport_set_errno} with the intended errno +value instead of setting @code{errno} directly. + @acronym{GnuTLS} currently only interprets the EINTR and EAGAIN errno values and returns the corresponding @acronym{GnuTLS} error codes @code{GNUTLS_E_INTERRUPTED} and @code{GNUTLS_E_AGAIN}. These values are usually returned by interrupted system calls, or when non blocking -IO is used. All @acronym{GnuTLS} functions can be resumed (called +IO is used. All @acronym{GnuTLS} functions can be resumed (called again), if any of these error codes is returned. The error codes above refer to the system call, not the @acronym{GnuTLS} function, since signals do not interrupt @acronym{GnuTLS}' functions.