Help getting pointer to a u structure of a process

Jim Bride bridej at prism.CS.ORST.EDU
Thu Mar 7 06:32:25 AEST 1991


Hi.  I am working on a program which requires me to be able to access the 
u (user) structure of a process OTHER than the process which is currently 
running.  After reading over several thousand lines of source code I can't
find out how to get a pointer to the other process' user structure.  I think
it involves translating the pointer inside the proc structure (p->p_addr) that
points to the PTEs for the user structure into an address (which I can then
cast to a (struct user *)).  My program is running as a system call and I have
been able to access the proc structure for the process I need to modify (via a
call to pfind()), but I need to change a few things in the user structure of 
the process as well.  Does anyone know of a way (preferably in C, but I would
be willing to resort to assembler if I have to) that I can translate the
p_addr pointer to a usable address that I can use to access the u structure or
another method that I can the the address of the u structure of this other
process?  Any help you could offer would be greatly appreciated.

BTW, I am using a HP 9000 series 300 CPU running 4.3BSD Utah.

Thanks!

Jim


-------------------------------------------------------------------------
Jim Bride - Networking | Internet:   bridej at CS.ORST.EDU                  
Computer Science Dept. | UUCP:       hplabs!hp-pcd!orstcs!bridej         
Oregon State University| Phone:      737-6178                            



More information about the Comp.unix.internals mailing list