Error in man page of sendmsg?

Valerio daelli valerio.daelli at gmail.com
Thu Jun 22 13:54:11 UTC 2006


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


More information about the freebsd-questions mailing list