diff options
author | Garrett D'Amore <garrett@damore.org> | 2016-11-23 15:21:55 -0800 |
---|---|---|
committer | Garrett D'Amore <garrett@damore.org> | 2016-11-23 16:11:42 -0800 |
commit | ac64955a483419241c4e446260df0074deaf2809 (patch) | |
tree | ad857aa14ef76d8da0dee1dc112f24e37af9f7aa /doc/nn_errno.adoc | |
parent | b02056f51fc92d45c171e73ef3fd5f8616a648b2 (diff) | |
download | nanomsg-ac64955a483419241c4e446260df0074deaf2809.tar.gz |
fixes #845 Simplify asciidoctor suffixes
Diffstat (limited to 'doc/nn_errno.adoc')
-rw-r--r-- | doc/nn_errno.adoc | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/doc/nn_errno.adoc b/doc/nn_errno.adoc new file mode 100644 index 0000000..547811c --- /dev/null +++ b/doc/nn_errno.adoc @@ -0,0 +1,57 @@ +nn_errno(3) +=========== + +NAME +---- +nn_errno - retrieve the current errno + + +SYNOPSIS +-------- +*#include <nanomsg/nn.h>* + +*int nn_errno (void);* + + +DESCRIPTION +----------- +Returns value of 'errno' for the current thread. + +On most systems, 'errno' can be accessed directly and this function is not +needed. However, on Windows, there are multiple implementations of the CRT +library (single-threaded, multi-threaded, release, debug) and each of them +has its own instance of 'errno'. Thus, if nanomsg library and the application +that uses it link with different versions of the CRT library, they don't share +the same instance of 'errno'. Consequently, error codes set by nanomsg cannot be +accessed by the application. To overcome this problem, application can use +_nn_errno()_ function to retrieve nanomsg's value of 'errno'. + +RETURN VALUE +------------ +Returns value of 'errno' for the current thread. + + +ERRORS +------ +No errors are defined. + + +EXAMPLE +------- + +---- +rc = nn_send (s, "ABC", 3, 0); +if (rc < 0) + printf ("nn_send failed with error code %d\n", nn_errno ()); +---- + + +SEE ALSO +-------- +<<nn_strerror#,nn_strerror(3)>> +<<nanomsg#,nanomsg(7)>> + +AUTHORS +------- +link:mailto:sustrik@250bpm.com[Martin Sustrik] + |