mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Accessing file-offset info for fds in /proc?
@ 2007-02-20  7:31 Hank Leininger
  2007-02-20 13:43 ` Dave Kleikamp
  0 siblings, 1 reply; 3+ messages in thread
From: Hank Leininger @ 2007-02-20  7:31 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel

[-- Attachment #1: Type: text/plain, Size: 1164 bytes --]

Is there anything provided by the kernel that would let you see the
current offset of an existing filehandle?

Sometimes when processing a very large file (grepping a log, bzip2'ing
or gpg'ing a file, or whatever), I'd really like to know how far along
it is, because I'm impatient.  lsof has an -o flag to show offsets for
file descriptors it lists, but it appears that's not supported under
Linux.  It looks like all of the information lsof and fuser print about 
files in use, etc can be gotten from /proc/*/fd/* (and /proc/*/maps, but
I'm not really concerned with mmap'ed files, just positions on fds).
Sometimes I'll resort to strace -s4096'ing the process to see what chunk
of text it's currently reading, and try to guess from that.  Silly.

Has anybody ever developed a patch to implement this?  I realize this
could create a variety of information-leakage problems; the information
probably would need to be restricted, such as by the same rules as
dumpable.  Are there any horribly painful reasons why this couldn't be
done?

Thanks,

-- 

Hank Leininger <hlein@korelogic.com>
F980 A584 5175 1996 DD7E  C47B 1A71 105C CB44 CBF8

[-- Attachment #2: Type: application/pgp-signature, Size: 155 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-20 14:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-20  7:31 Accessing file-offset info for fds in /proc? Hank Leininger
2007-02-20 13:43 ` Dave Kleikamp
2007-02-20 14:51   ` Miklos Szeredi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome