home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / aix / 11484 < prev    next >
Encoding:
Text File  |  1992-11-11  |  2.4 KB  |  59 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!newsgate.watson.ibm.com!yktnews!admin!yktnews!lucien
  3. From: lucien@watson.ibm.com (Lucien Van Elsen)
  4. Subject: Re: Access another process data segment(s)/address space    
  5. Sender: news@watson.ibm.com (NNTP News Poster)
  6. Message-ID: <LUCIEN.92Nov11114504@fionavar.watson.ibm.com>
  7. In-Reply-To: mhe@hal.uio.no's message of Wed, 11 Nov 1992 07:55:44 GMT
  8. Date: Wed, 11 Nov 1992 16:45:04 GMT
  9. Disclaimer: This posting represents the poster's views, not necessarily those of IBM
  10. References: <1992Nov10.090641.20896@ulrik.uio.no>
  11.     <LUCIEN.92Nov10101313@fionavar.watson.ibm.com>
  12.     <1992Nov11.075544.29818@ulrik.uio.no>
  13. Nntp-Posting-Host: fionavar.watson.ibm.com
  14. Organization: IBM T.J Watson Research Center
  15. Lines: 42
  16.  
  17. mhe@hal.uio.no (Morten Hermanrud) writes:
  18.  
  19. >The ptrace allows me to read/write bytes in anothes process's address
  20. >space but it will not allow me to use the 'read' system call with
  21. >an address in the other process's address space as an argument without
  22. >copying the data into my own address space first. As the amount of data
  23. >is HUGE this would be an incredibly wasteful operation....
  24. >
  25. >What I want to do is :
  26. >
  27. >    .
  28. >    .
  29. >    map process B's address space to my address space at addr N
  30. >    write(fd,N,n_bytes);
  31. >    .
  32. >    .
  33. >    read(fd,N,n_bytes);
  34. >    .
  35. >    .
  36. >
  37. >such that the read/write operation goes directly into process B's 
  38. >address space.
  39.  
  40. If large amounts of data a concern, I believe there's a way to do it, though
  41. the amount of work & wizardry involved is such that it may just be easier to
  42. make B cooperate with A and share a memory segment.
  43.  
  44.   Note that the rest of this was gleaned from the documentation in info and
  45. various include files; I havn't personally written a routine to do this.
  46. If you're willing to write A as a kernel process, you should be able to
  47. attach to a given process B's memory space from the kernel using the vm_att
  48. kernel service on the vmhandle contained in the u.u_adspace stored in the
  49. array u_adspace.srval of B, with the index of the array being the segment in
  50. which the address space of interest in B is located.  The vm_uatt macro in
  51. /usr/include/sys/adspace.h should be a good guide to the format you want to
  52. use.
  53.  
  54.         -Lucien
  55. --
  56. -----------------------------------------------------------------------
  57. Lucien Van Elsen                                          IBM  Research
  58. lucien@watson.ibm.com                                     Project Agora
  59.