Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jun 2006 15:54:08 +0200
From:      "Valerio daelli" <valerio.daelli@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Error in man page of sendmsg?
Message-ID:  <27dbfc8c0606220654y65fd76ectf3191dc7b935465@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi

working with InterMapper (a network tool) on FreeBSD 5.4 I got a

sendmsg -1 errno 22 Invalid argument

I looked in man sendmsg in the errors but I found no EINVAL in the errors.
So I looked at the kernel sources and I found

----------------------------------------------------------------------------------------------------------

static int
sendit(td, s, mp, flags)
        register struct thread *td;
        int s;
        register struct msghdr *mp;
        int flags;
{
        struct mbuf *control;
        struct sockaddr *to;
        int error;

        if (mp->msg_name != NULL) {
                error = getsockaddr(&to, mp->msg_name, mp->msg_namelen);
                if (error) {
                        to = NULL;
                        goto bad;
                }
                mp->msg_name = to;
        } else {
                to = NULL;
        }

        if (mp->msg_control) {
                if (mp->msg_controllen < sizeof(struct cmsghdr)
#ifdef COMPAT_OLDSOCK
                    && mp->msg_flags != MSG_COMPAT
#endif
                ) {
                        error = EINVAL;

----------------------------------------------------------------------------------------------------------

that error is set to EINVAL so the man page should report EINVAL as possible
error in this funcion.
Bye

Valerio Daelli



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