Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Dec 2020 18:50:21 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Rahul Bharadwaj <rahulbharadwajpromos@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: What does =?UTF-8?Q?=E2=80=9CNo_anode=E2=80=9D?= mean in errno 55 when socket connection fails?
Message-ID:  <20201227185021.1190a289.freebsd@edvax.de>
In-Reply-To: <CADotuvv-csH5L2E5OGkLTNOVJ2KYeU6q9Fp_n1Y%2BFwfiiJCPQA@mail.gmail.com>
References:  <CADotuvv-csH5L2E5OGkLTNOVJ2KYeU6q9Fp_n1Y%2BFwfiiJCPQA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 27 Dec 2020 23:03:17 +0530, Rahul Bharadwaj wrote:
> I was doing a few performance tests on a local server and once in a while I
> hit an error where opening a socket connection fails.
> 
> i.e. considering the simplest code:
> 
> #include <errno.h>
> #include <sys/socket.h>
> 
> int main() {
>     /* code to create socket object */
> 
>     int ret = connect(sock, (struct sockaddr *)&serv_addr,
> sizeof(serv_addr));
>     if (ret < 0) {
>         fprintf(stderr, "connect() failed with: %d\n", errno); // <---- *get
> errno as 55*
>         exit(1);
>     }
>     /* other code */
> }
> 
> There is no explanation for this error number "55".

In /usr/include/sys/errno.h, you can find the following
entry:

	#define ENOBUFS         55              /* No buffer space available */

Also in "man 2 intro", the introduction to system calls,
there's a section about errno:

     55 ENOBUFS No buffer space available.  An operation on a socket or pipe
             was not performed because the system lacked sufficient buffer
             space or because a queue was full.

That doesn't help much, but regarding your example program
snippet, it would match the context.



> In every place, the
> only mention is "No anode". There is no mention of what "anode" means and
> what "No anode" specifically means.

This is part of the binutils or gcc-libs (in contrib/ subtree
of /usr/src, libiberty, or BSM security/ subtree). An anode is
probably a kind of or a synonym for an inode (i-node, index node,
a filesystem entry). But the error itself does not have to be in
this context; it could be that an inode was requested but could
not be allocated (filesystem problem), or the kernel ran out of
buffer spaces for sockets, so maybe it means "allocation node"?

Or maybe it's just one of those occassions where the programmer
tought: I don't know what error to return here... ;-)




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20201227185021.1190a289.freebsd>