From owner-freebsd-questions@freebsd.org Thu Oct 20 10:28:35 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 840F7C186A9 for ; Thu, 20 Oct 2016 10:28:35 +0000 (UTC) (envelope-from fbsd@neverland.ch) Received: from apu.neverland.ch (alto.neverland.ch [213.144.146.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B95FB86 for ; Thu, 20 Oct 2016 10:28:34 +0000 (UTC) (envelope-from fbsd@neverland.ch) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverland.ch; s=key1; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date; bh=fl7kZc1JgBbnLwqb2mPvQ9dWLz5SGt8y33gcqxL5OQc=; b=o0q7TlGc9LKSructcuClHdw4gd noSlqVZepMlMh3N39MSOUY6YfsfTIleoIgfQJ0Ju5AKSYE84+wY9ZM6mX4cE0f0oE2V3yST8TCsJC pETBCOm8y4emVgRFpLUqJwbV/4fEcfhEPyf7A+8ur5R9K7++6HBnb22H1DwdLBFnTkOs=; Received: by Neverland InternetMTA, id is 1bxAaO-00090D-ET; Thu, 20 Oct 2016 12:28:32 +0200 Received: from ck by viper with local (Exim 4.84_2) (envelope-from ) id 1bxAaO-0001MR-D5; Thu, 20 Oct 2016 12:28:32 +0200 Date: Thu, 20 Oct 2016 12:28:32 +0200 From: Chris To: Polytropon Cc: freebsd-questions@freebsd.org Subject: Re: Accessing processlist to determine, if a process is running / struct kinfo_proc Message-ID: <20161020102832.GA5160@viper.neverland.ch> References: <20161020095654.GA4979@viper.neverland.ch> <20161020121540.8dcbaa49.freebsd@edvax.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161020121540.8dcbaa49.freebsd@edvax.de> User-Agent: Mutt/1.5.23 (2014-03-12) 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:28:35 -0000 Quoting Polytropon (freebsd@edvax.de): > 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. > Aah, I must have been blind all the time! Thanks a lot for your help :-) Kind regards and have a nice day Chris