[Toybox] [PATCH] Offer flag to only list open FDs.

Jeff Sharkey jsharkey at google.com
Wed Oct 26 09:50:15 PDT 2016


Doh, I forgot that toybox tries as much as possible to mirror upstream
behavior, so ignore my attempt to redefine "-f".

Looking at the lsof manpage, there isn't really a direct flag that does
what I'm looking for.  :(  The closest thing would be something like:

$ lsof -a -p [pid] -d 0-1024

Which isn't pretty at all.  I think I can get the bare-bones info I need
with `ls -lf /proc/[pid]/fd/`, so I'll go that direction for now.  Sorry
for the noise.

j

On Tue, Oct 25, 2016 at 11:05 PM, Rob Landley <rob at landley.net> wrote:

> On 10/25/2016 01:56 PM, Jeff Sharkey wrote:
> > Attached patch; happy to answer any questions.  :)
>
> Hmmm... from the lsof man page:
>
>     When -f is specified by itself, all path name  arguments  will
>     be  taken  to be simple files.  Thus, for example, the ``-f --
>     /'' arguments direct lsof to search for open files with a  `/'
>     path name, not all open files in the `/' (root) file system.
>
> The existing -l, -p, and -t are compatible with previous lsof
> implementations. (We don't seem to be doing the -p ^pid thing that
> _excludes_ pids, but what _is_ there is compatible.) But this looks like
> a new definition of -f? (It's hard to tell because the lsof man page is
> so busy...)
>
> How would you get the other lsof to filter the output this way?
>
> Rob
>



-- 
Jeff Sharkey
jsharkey at android.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20161026/db197740/attachment-0001.htm>


More information about the Toybox mailing list