From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 14 16:06:53 2006 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B1FD16A420 for ; Sat, 14 Jan 2006 16:06:53 +0000 (GMT) (envelope-from pranav.sawargaonkar@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.200]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C61543D55 for ; Sat, 14 Jan 2006 16:06:51 +0000 (GMT) (envelope-from pranav.sawargaonkar@gmail.com) Received: by wproxy.gmail.com with SMTP id i14so767815wra for ; Sat, 14 Jan 2006 08:06:48 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=SJFVk7vyJi2OpuesXE13ygBgwIVqznMVOu8Frlm9DKiJ1KMk04B6PS+h2bScLtdWx4IzECF6JImXWLPsf6rTmXMLOE2v8JpAafpLY36u/+TIUODiAU0L04RUEX132RnwRwv0h9BS7ln59ljEGdCHH9PjOQesudGA/1AUvD2JrWk= Received: by 10.54.105.7 with SMTP id d7mr2123wrc; Sat, 14 Jan 2006 08:06:48 -0800 (PST) Received: by 10.54.125.1 with HTTP; Sat, 14 Jan 2006 08:06:48 -0800 (PST) Message-ID: <5007e1a40601140806n12c85950ie577b2a61ea1009d@mail.gmail.com> Date: Sat, 14 Jan 2006 21:36:48 +0530 From: Pranav Sawargaonkar To: hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Kernel programming X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2006 16:06:53 -0000 Hi I have doubt about accessing vmspace structure using proc pointer. I have written code below in my module and try to find out data size of a program, but during make it is giving me errors.Please anyone tell me what is right way to code my function. Function I have written is- static int myfunction(void) { struct proc *p; p=3Dpfind(400); //400 is pid of one of process running at that time printf("\nData size %d",ctob(p->p_vmspace->vm_dsize)); UNLOCK_PROC(p); return 0; } Thank you. Pranav