: ** PROGRAM TO LIST FILES CURRENTLY OPEN BY A PROCESS **

Gene Lee lee at minnow.sp.unisys.com
Wed Dec 13 02:12:57 AEST 1989




      I am trying to write a program (on UNIX 5.2) which will list the
      files which are currently open by a process.

      I started to investigate the problem and got as far as reading the
      proc structure out of the /dev/kmem.  Thats where I get stuck.  I
      know that I need to read the user structure for the process but
      how do I find it?  Is there a pointer of somekind in structure
      proc that I am overlooking.

      Once I can read the user structure then I will be able to get a
      list of the open file slots used by the program.  This will give
      me the inodes of the open files which I can then convert to
      filenames.

      Please mail responses to me.  Its easy to overlook things in the
      heavy traffic.  Thanks in advance.

		Gene W. Lee


Gene Lee               UUCP: ...!pyramid!pwcs!minnow!lee
Unisys Corporation               ...!amdahl!ems!minnow!lee
Phone: (612) 635-7147     CSNET: lee at minnow.SP.Unisys.Com
If not for the courage of the fearless manager, the paycheck would be lost.



More information about the Comp.unix.wizards mailing list