Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jan 2006 21:36:48 +0530
From:      Pranav Sawargaonkar <pranav.sawargaonkar@gmail.com>
To:        hackers@freebsd.org
Subject:   Kernel programming
Message-ID:  <5007e1a40601140806n12c85950ie577b2a61ea1009d@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5007e1a40601140806n12c85950ie577b2a61ea1009d>