home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aix
- Path: sparky!uunet!newsgate.watson.ibm.com!yktnews!admin!yktnews!lucien
- From: lucien@watson.ibm.com (Lucien Van Elsen)
- Subject: Re: Access another process data segment(s)/address space
- Sender: news@watson.ibm.com (NNTP News Poster)
- Message-ID: <LUCIEN.92Nov11114504@fionavar.watson.ibm.com>
- In-Reply-To: mhe@hal.uio.no's message of Wed, 11 Nov 1992 07:55:44 GMT
- Date: Wed, 11 Nov 1992 16:45:04 GMT
- Disclaimer: This posting represents the poster's views, not necessarily those of IBM
- References: <1992Nov10.090641.20896@ulrik.uio.no>
- <LUCIEN.92Nov10101313@fionavar.watson.ibm.com>
- <1992Nov11.075544.29818@ulrik.uio.no>
- Nntp-Posting-Host: fionavar.watson.ibm.com
- Organization: IBM T.J Watson Research Center
- Lines: 42
-
- mhe@hal.uio.no (Morten Hermanrud) writes:
-
- >The ptrace allows me to read/write bytes in anothes process's address
- >space but it will not allow me to use the 'read' system call with
- >an address in the other process's address space as an argument without
- >copying the data into my own address space first. As the amount of data
- >is HUGE this would be an incredibly wasteful operation....
- >
- >What I want to do is :
- >
- > .
- > .
- > map process B's address space to my address space at addr N
- > write(fd,N,n_bytes);
- > .
- > .
- > read(fd,N,n_bytes);
- > .
- > .
- >
- >such that the read/write operation goes directly into process B's
- >address space.
-
- If large amounts of data a concern, I believe there's a way to do it, though
- the amount of work & wizardry involved is such that it may just be easier to
- make B cooperate with A and share a memory segment.
-
- Note that the rest of this was gleaned from the documentation in info and
- various include files; I havn't personally written a routine to do this.
- If you're willing to write A as a kernel process, you should be able to
- attach to a given process B's memory space from the kernel using the vm_att
- kernel service on the vmhandle contained in the u.u_adspace stored in the
- array u_adspace.srval of B, with the index of the array being the segment in
- which the address space of interest in B is located. The vm_uatt macro in
- /usr/include/sys/adspace.h should be a good guide to the format you want to
- use.
-
- -Lucien
- --
- -----------------------------------------------------------------------
- Lucien Van Elsen IBM Research
- lucien@watson.ibm.com Project Agora
-