From owner-freebsd-hackers Fri Apr 13 18:13:44 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail1.javanet.com (mail1.javanet.com [205.219.162.10]) by hub.freebsd.org (Postfix) with ESMTP id B9FEE37B449 for ; Fri, 13 Apr 2001 18:13:40 -0700 (PDT) (envelope-from kaworu@sektor7.ath.cx) Received: from wintermute.sekt7.org (209-6-248-6.c3-0.lex-ubr1.sbo-lex.ma.cable.rcn.com [209.6.248.6]) by mail1.javanet.com (8.9.3/8.9.2) with ESMTP id VAA04346 for ; Fri, 13 Apr 2001 21:13:44 -0400 (EDT) Date: Fri, 13 Apr 2001 21:17:13 -0400 (EDT) From: Evan S X-Sender: kaworu@wintermute.sekt7 To: freebsd-hackers@freebsd.org Subject: question on kvm_getprocs Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I am writing a program called jailstat, which goes through the proc structure, checks if p_prison is true, if it is, prints out p_prison->pr_host. I have it working so it says, "jailed process", and prints out it's UID. But, when I try to make it print the hostname, this is what happens. Here's a snippet of code: 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 If anyone could give a little help. Thanks a lot. :-) Evan Sarmiento (kaworu@sektor7.ath.cx) http://sekt7.org/es -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (SunOS) Comment: Made with pgp4pine 1.75-6 iEYEARECAAYFAjrXpR8ACgkQa7CFsJ0L22wnawCgpVWLMcqBegbb5opBR2Hx8esV KJMAoJlZ1a/BsqqbPh8TxiTISPyN85fA =SaP9 -----END PGP SIGNATURE----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message