From owner-freebsd-questions@freebsd.org Thu Oct 20 10:15:43 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AD12C1815A for ; Thu, 20 Oct 2016 10:15:43 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 559D032B for ; Thu, 20 Oct 2016 10:15:43 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de (port-92-195-117-205.dynamic.qsc.de [92.195.117.205]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id 10572277EC; Thu, 20 Oct 2016 12:15:40 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id u9KAFe2r002144; Thu, 20 Oct 2016 12:15:40 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Thu, 20 Oct 2016 12:15:40 +0200 From: Polytropon To: Chris Cc: freebsd-questions@freebsd.org Subject: Re: Accessing processlist to determine, if a process is running / struct kinfo_proc Message-Id: <20161020121540.8dcbaa49.freebsd@edvax.de> In-Reply-To: <20161020095654.GA4979@viper.neverland.ch> References: <20161020095654.GA4979@viper.neverland.ch> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 10:15:43 -0000 On Thu, 20 Oct 2016 11:56:54 +0200, Chris wrote: > When compiling, clang barfs: > > ---------------------------- 8< ---------------------------- > clang -c -Wall psprobe-BSD.c > psprobe-BSD.c:65:48: error: subscript of pointer to incomplete type 'struct kinfo_proc' > snprintf(CommandString, 64, "%s: ", processes[i].p_comm); > ~~~~~~~~~^ > /usr/include/kvm.h:56:8: note: forward declaration of 'struct kinfo_proc' > struct kinfo_proc; > ^ > ---------------------------- 8< ---------------------------- > > What I don't understand is: why isn't struct kinfo_proc completely > defined there? I couldn't find it's definition below /usr/include > anywhere. It's in the sys/ subdirectory. > Can anybody give me a hint? You need to #include where you will find the complete defintion of struct kinfo_proc. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...