Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jun 2006 09:49:01 -0500
From:      Kevin Kinsey <kdk@daleco.biz>
To:        Valerio daelli <valerio.daelli@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Error in man page of sendmsg?
Message-ID:  <449AADDD.7090207@daleco.biz>
In-Reply-To: <27dbfc8c0606220654y65fd76ectf3191dc7b935465@mail.gmail.com>
References:  <27dbfc8c0606220654y65fd76ectf3191dc7b935465@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Valerio daelli wrote:

> 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.


Looks like a good catch.  Could you use send-pr(1) to get this into
the GNATS (problem report) database?  It's a "doc bug", apparently.

Kevin Kinsey

-- 
In war it is not men, but the man who counts.
		-- Napoleon




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