Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Dec 2020 23:24:12 +0530
From:      Rahul Bharadwaj <rahulbharadwajpromos@gmail.com>
To:        Polytropon <freebsd@edvax.de>
Cc:        freebsd-questions@freebsd.org
Subject:   =?UTF-8?Q?Re=3A_What_does_=E2=80=9CNo_anode=E2=80=9D_mean_in_errno_55_when_s?= =?UTF-8?Q?ocket_connection_fails=3F?=
Message-ID:  <CADotuvuLnyYoU7QszHU1mxe1RFTqu3g9ivsZ_nE4MniZNS47Dg@mail.gmail.com>
In-Reply-To: <20201227185021.1190a289.freebsd@edvax.de>
References:  <CADotuvv-csH5L2E5OGkLTNOVJ2KYeU6q9Fp_n1Y%2BFwfiiJCPQA@mail.gmail.com> <20201227185021.1190a289.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
I see. I had to look into the FreeBSD source than the internet for the
error number. Now the error makes sense.

Thank you!!

On Sun, Dec 27, 2020 at 11:20 PM Polytropon <freebsd@edvax.de> wrote:

> 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?CADotuvuLnyYoU7QszHU1mxe1RFTqu3g9ivsZ_nE4MniZNS47Dg>