Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 03 Mar 2002 09:19:38 -0600 (CST)
From:      Conrad Sabatier <conrads@cox.net>
To:        freebsd-hackers@freebsd.org
Subject:   A few questions about a few includes
Message-ID:  <XFMail.20020303091938.conrads@cox.net>

next in thread | raw e-mail | index | archive | help
Am I just completely stupid, or do we have a few things that could use a
little cleaning up in /usr/include as well as in the man page for kvm_*?

System: FreeBSD 4.5-STABLE

1) The man page for the kvm_* functions lists the following #include
   dependencies:

     #include <kvm.h>
     #include <sys/param.h>
     #include <sys/sysctl.h>

However, kvm.h contains some declarations that also require <sys/proc.h> and
<sys/user.h> (namely, struct kinfo_proc and struct proc).  Otherwise, one
might encounter warnings/errors re: incomplete types.

2) If compiling with the -pedantic switch, one might see something like
   this:

In file included from main.c:151:
/usr/include/sys/proc.h:108: warning: ANSI C forbids zero-size array
`ar_args'

In <sys/proc.h>:

/*
 * pargs, used to hold a copy of the command line, if it had a sane
 * length
 */
struct  pargs {
        u_int   ar_ref;         /* Reference count */
        u_int   ar_length;      /* Length */
        u_char  ar_args[0];     /* Arguments */
};

This does indeed seem to make little or no sense.  Could someone explain
this?  Is ar_args supposed to be a pointer or what?

3) Furthermore, on including <sys/user.h>, one then sees this:

In file included from /usr/include/sys/user.h:40,
                 from main.c:153:
/usr/include/machine/pcb.h:90: warning: struct has no members

In <machine/pcb.h>:

/*
 * The pcb is augmented with machine-dependent additional data for
 * core dumps. For the i386: ???
 */
struct md_coredump {
};

Nowhere under /usr/include is a more complete definition of md_coredump to
be found.  This looks awfully "kludgy" to me.

I do hope someone can shed some light here.  Thanks.

-- 
Conrad Sabatier <conrads@cox.net>

First Rule of History:
        History doesn't repeat itself -- historians merely repeat each
other.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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