getting a list of open files versus PID nos.?

Chuck Robey chuckr at telenix.org
Thu Dec 9 20:55:07 UTC 2010


On 12/09/10 06:49, krad wrote:
> On 9 December 2010 00:20, Andriy Gapon<avg at freebsd.org>  wrote:
>
>> on 09/12/2010 01:47 Matthew Fleming said the following:
>>> On Wed, Dec 8, 2010 at 3:01 PM, Bruce Cran<bruce at cran.org.uk>  wrote:
>>>> On Wed, 8 Dec 2010 14:54:57 -0800
>>>> Matthew Fleming<mdf356 at gmail.com>  wrote:
>>>>
>>>>> This is what lsof is for.  I believe there's one in ports, but I have
>>>>> never tried it.
>>>>
>>>> Is there any advantage to using lsof instead of fstat(1) (fstat -p pid)?
>>>
>>> I believe that lsof reports on all open files by all processes,
>>> whereas fstat will only report on a specific provided pid.
>>
>> Just try running fstat without any options.
>> Or procstat -a -f.

Ahh, the procstat -a -f output was more clearly readable than even the suggested 
lsof.  I found that enlightenment was opening 2,672 different
/dev/apmNNNN devices.  Man apm tells me it's to do with Advanced Power Mgm't, 
nearly all of these huge lumps of open files.  How might I deal with getting 
these /dev/apmNNNN files to close themselves?  Because I have little doubt that 
I am (at last!!) looking at the reason for my machine lockups.



More information about the freebsd-hackers mailing list