/proc/<pid>/statfd
Subsystems (2)
PATCH 1/1 /proc/<pid>/statfd
The attached patch creates a /proc/<pid>/statfd file that contains one line per file descriptor and gives the current offset, the mode, flags and an error indicator (from struct file*).
I wrote it as an answer to age old questions such as 'how far into the tape is that tar?' and 'how far has the 30GB gzip got?'.
It is against 2.6.5 and has been tested on x86 and SPARC.
Comments, suggestions and constructive criticisms welcome.
Dave
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux on Alpha,68K| Happy \ \ gro.gilbert @ treblig.org | MIPS,x86,ARM,SPARC,PPC & HPPA | In Hex / \ _________________________|_____ http://www.treblig.org |_______/
Documentation/filesystems/proc.txt +8 -0
@@ -130,6 +130,7 @@ root Link to the root directory of this process stat Process status statm Process memory status information + statfd Status of the processes file descriptors status Process status in human readable form wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan ..............................................................................
@@ -180,6 +181,13 @@ dt number of dirty pages .............................................................................. +The statfd contains one line per open file descriptor in the process - for +example: +16 821409 02 0x44009 0 + +Is file descriptor 16, that is 821409 bytes into the file, has a mode of 02 (octal), +has flags 0x44009 and no error. + 1.2 Kernel data ---------------
fs/proc/base.c +170 -6
224 lines not on this page · raw message