home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aix
- Path: sparky!uunet!newsgate.watson.ibm.com!yktnews!admin!flu!marc
- From: marc@watson.ibm.com (Marc Auslander)
- Subject: Re: Detecting where program text segments come from...
- Sender: news@watson.ibm.com (NNTP News Poster)
- Message-ID: <MARC.92Aug14093051@marc.watson.ibm.com>
- In-Reply-To: fritz@scipp.UCSC.EDU's message of 13 Aug 92 19:17:21 GMT
- Date: Fri, 14 Aug 1992 14:30:51 GMT
- Disclaimer: This posting represents the poster's views, not necessarily those of IBM
- References: <16ecg1INN66f@darkstar.UCSC.EDU>
- Nntp-Posting-Host: marc.watson.ibm.com
- Organization: IBM T.J. Watson Research Center, Hawthorne, New York
- Lines: 29
-
- The ublock contains the anchor of a chain of loader entries, one for
- each file used by the process as program text. One is for the exec'd
- program, others for the shared or private modules (like libc) also
- loaded. Each loader entry contains a pointer to the file table entry
- for the file it represents. (The file table is the global kernel data
- structure which is used to represent open files. The file descriptor
- entry in the u-block also points to a file table entry, for example).
-
- The file table entry points to the Vnode for the open file. From the
- Vnode it is possible to determine which mounted file system the file
- is in.
-
- As is usual in unix, there is no easy way to determine a "path name"
- for the file from this information. Some computation similar to that
- in getcwd() would be needed. For all but the exec'd program,
- the path name used by the loader is recorded in the loader entry.
- The full path name of the exec'd program is not recorded in its loader
- entry. (There's no good reason, but the internal interfaces didn't
- provide the path name to the loader, and when the recording of path
- names was added it was too late to fix it. Oh well!) (Of course,
- that path name may no longer name the same file. In fact, the file
- may have no name at all, and be waiting for the process to end so it
- can be deleted from the file system.)
-
- --
-
-
- Marc Auslander (IBM)<marc@marc.watson.ibm.com> 914 784-6699
- (Internet)<marc@watson.ibm.com>
-