Error in man page of sendmsg?
Kevin Kinsey
kdk at daleco.biz
Thu Jun 22 15:22:20 UTC 2006
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
More information about the freebsd-questions
mailing list