From owner-freebsd-questions@freebsd.org Thu Oct 20 09:56:57 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 3BA5AC17AF5 for ; Thu, 20 Oct 2016 09:56:57 +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 E33AC99E for ; Thu, 20 Oct 2016 09:56:56 +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=Content-Type:MIME-Version:Message-ID:Subject:To: From:Date; bh=t0Cisjq6my9YzWnuo7BY2KmRsJ7TwbkMSRDdBvn2bm0=; b=BUhPJB0Msd6/qhG Fdp1QKfyImHRTN4xqnNEwoLXOorevHU4TAOXSCM35YX8krR3Y0AAdFcZbVxT3Mn9R4CO6GfOifjaI 5yIhWyLJimVFFvruGOCQeOoGQDatEbz4PK0MytRKdK/6u7Ov/27dhM7ekZ6DPa5QdzyyXYQHBJG19 Bc=; Received: by Neverland InternetMTA, id is 1bxA5m-0008yx-2S; Thu, 20 Oct 2016 11:56:54 +0200 Received: from ck by viper with local (Exim 4.84_2) (envelope-from ) id 1bxA5m-0001Iy-1E for freebsd-questions@freebsd.org; Thu, 20 Oct 2016 11:56:54 +0200 Date: Thu, 20 Oct 2016 11:56:54 +0200 From: Chris To: freebsd-questions@freebsd.org Subject: Accessing processlist to determine, if a process is running / struct kinfo_proc Message-ID: <20161020095654.GA4979@viper.neverland.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 09:56:57 -0000 Dear list I decided to revive an old monitoring program I once wrote for NetBSD and adapted it to FreeBSD's system calls. One of the probes is supposed to check, if a process is still running. 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. Can anybody give me a hint? I'll gladly send the complete file to the list if that's appropriate. Thanks Chris -- ------------------------------------------------------------------------ Chris fbsd@neverland.ch ------------------------------------------------------------------------