Evan S <[EMAIL PROTECTED]> writes:
>        if ((kinfo = malloc(nentries * sizeof(*kinfo))) == NULL)
>                            err(1, NULL);
>                    for (i = nentries; --i >= 0; ++proc_list) {
>                            (&kinfo[i])->ki_p = proc_list;
>                               if (KI_PROC(&kinfo[i])->p_prison)
>                                       {
>                                        printf("Jailed Process\n");
>                                        printf("%s\n",
> 
> KI_PROC(&kinfo[i])->p_prison->pr_host);
>                                       }
>                                       }
> 
> KI_PROC is just a macro that is 
> #define KI_PROC(ki) (&(ki)->ki_p->kp_proc)
> 
> [teqnix](~/work/c/getprocs)%gcc -g -lkvm getprocs.c -o getprocs
> getprocs.c: In function `main':
> getprocs.c:87: dereferencing pointer to incomplete type

pr_host is a member of struct prison, which is a kernel structure.
It's under #ifdef _KERNEL, which is why you don't have a definition
for it.  I'm not quite sure where you're getting your process list
from, but I think that p_prison is a kernel pointer in your context.
Obviously, trying to follow that from the userland won't do what you
want. :-)

Then again, I could be wrong.  If you want, take the definition of
struct prison from /usr/include/sys/jail.h and paste it into your
code.  That will get rid of the warning.  If your program seg faults
when you try to run it, you'll know I was right.

Regards,

                                        Dima Dorfman
                                        [EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to