On 11/13/09 14:24, Garrett D'Amore - sun microsystems wrote: > ... > PROBLEM: > > pfiles(1) prints various information about open files in a process > (the manpage describes it as fstat(2) and fcntl(2) information, as well > as network endpoints, socket options, and the file path, if available). > > Occasionally it would be useful to see the file offset for files that > support seek; for example, for long-running processes that process large > files sequentially, it can be useful to discover the current position > in the file to estimate time to completion. The information is readily > available, and easy to output. > > pfiles(1) output is currently classified as Uncommitted. > > PROPOSAL: > > Add a new "offset:" output field to pfiles (in verbose mode, that is, > lacking the -n switch). The field would be printed for any file that > responds to lseek() with a valid offset, appearing just after the > pathname (if any). Several output formats were proposed and discussed; > locating just after all the other field:value items would be consistent, > but would almost certainly cause linewrap, and it seems a shame to > waste an entire line on one new field. Also, there's some value in > having the offset near the pathname, as that's likely the reference > field of interest for the offset. >
Is this field displayed with sockets? While sockets may not be seek'able, my experience with this kind of utility and extracting information from the kernel is that the "offset" for sockets is actually the number of bytes written (as it is for any file opened with O_TRUNC) and that can be of value. Darren