| From | Sent On | Attachments |
|---|---|---|
| Denis Eremenko | Dec 11, 2007 9:39 pm | |
| Lowell Gilbert | Dec 14, 2007 6:21 am | |
| Denis Eremenko | Dec 20, 2007 7:11 pm | |
| Robert Watson | Dec 21, 2007 5:28 pm |
| Subject: | fstat and filenames | |
|---|---|---|
| From: | Denis Eremenko (moon...@pnhz.kz) | |
| Date: | Dec 11, 2007 9:39:14 pm | |
| List: | org.freebsd.freebsd-fs | |
Why fstat so secretive about file names and unix domain sockets?
# lsof -p `pgrep syslogd` COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME ... syslogd 577 root 4u unix 0xc34652c8 0t0 /var/run/log syslogd 577 root 5u unix 0xc3465000 0t0 /var/run/logpriv syslogd 577 root 6u IPv4 0xc34c321c 0t0 UDP *:syslog ...
# fstat -p `pgrep syslogd` USER CMD PID FD MOUNT INUM MODE SZ|DV R/W ... root syslogd 577 4* local dgram c34676c0 root syslogd 577 5* local dgram c3467630 root syslogd 577 6* internet dgram udp c34c321c ...
According to manpage 'file' argument should be specified to enable NAME field (why? not quite POLA-ish). With mountpoint as argument it shows nothing: # fstat -p `pgrep syslogd` /var
And finally: "fstat -f /var" show some but w/o names as -f disables that, "fstat -f /var/*" shows only regulars and dirs, "lsof /var" shows twice more than "fstat -f /var" and with names.
Is there any way to get open files (not only regular) and their filenames with fstat and some criteria (uid or pid)?





