1NN_ERRNO(3) nanomsg 1.1.5 NN_ERRNO(3)
2
3
4
6 nn_errno - retrieve the current errno
7
9 #include <nanomsg/nn.h>
10
11 int nn_errno (void);
12
14 Returns value of errno for the current thread.
15
16 On most systems, errno can be accessed directly and this function is
17 not needed. However, on Windows, there are multiple implementations of
18 the CRT library (single-threaded, multi-threaded, release, debug) and
19 each of them has its own instance of errno. Thus, if nanomsg library
20 and the application that uses it link with different versions of the
21 CRT library, they don’t share the same instance of errno. Consequently,
22 error codes set by nanomsg cannot be accessed by the application. To
23 overcome this problem, application can use nn_errno() function to
24 retrieve nanomsg’s value of errno.
25
27 Returns value of errno for the current thread.
28
30 No errors are defined.
31
33 rc = nn_send (s, "ABC", 3, 0);
34 if (rc < 0)
35 printf ("nn_send failed with error code %d\n", nn_errno ());
36
38 nn_strerror(3) nanomsg(7)
39
41 Martin Sustrik <sustrik@250bpm.com>
42
43
44
45 2018-10-15 NN_ERRNO(3)