From owner-freebsd-questions@FreeBSD.ORG Thu Jun 22 15:22:20 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E18316A4E0 for ; Thu, 22 Jun 2006 15:22:20 +0000 (UTC) (envelope-from kdk@daleco.biz) Received: from ezekiel.daleco.biz (southernuniform.com [66.76.92.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id 24CA4440D1 for ; Thu, 22 Jun 2006 14:50:29 +0000 (GMT) (envelope-from kdk@daleco.biz) Received: from [192.168.2.2] ([69.27.149.254]) by ezekiel.daleco.biz (8.13.4/8.13.1) with ESMTP id k5MEnCBm040437; Thu, 22 Jun 2006 09:49:37 -0500 (CDT) (envelope-from kdk@daleco.biz) Message-ID: <449AADDD.7090207@daleco.biz> Date: Thu, 22 Jun 2006 09:49:01 -0500 From: Kevin Kinsey User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.0.2) Gecko/20060509 SeaMonkey/1.0.1 MIME-Version: 1.0 To: Valerio daelli References: <27dbfc8c0606220654y65fd76ectf3191dc7b935465@mail.gmail.com> In-Reply-To: <27dbfc8c0606220654y65fd76ectf3191dc7b935465@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Error in man page of sendmsg? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jun 2006 15:22:20 -0000 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