[vox-tech] Question about listing loaded modules by process...

Charles Polisher vox-tech@lists.lugod.org
Mon, 17 Jun 2002 17:11:32 -0700


R. Douglas Barbieri wrote:
> Okay, here is what I'm getting at. Sorry for being unclear.
> 
> Say I have a program which plays an audio file. It asks the operating 
> system to access the sound card device. If the device driver is compiled 
> as a module, the OS requires the module be loaded into memory before the 
> sound card can be accessed. For example, say I have a SB16, so I need sb.o 
> loaded into memory (and all the dependant modules as well, a la "modprobe 
> -r sb").
> 
> While the process has this "resource" open (may I refer to it as a
> resource?), the module must remain in memory. A "modprobe -r sb" returns
> "sb: Device or resource busy." If I can locate the process which is
> accessing the sound device (say, for example, "play RMSSings.wav"), and
> kill it ("killall play"), I can then do a "modprobe -r sb" successfully.
> 
> Suppose I don't know that I have "play" running in the background, or
> which programs really are causing the "sb.o" module to remain in memory.  
> Isn't there a program out there, a la lsmod and lsof, which allows me to
> list what processes are requiring the use of what OS device modules? In
> other words, to list out the fact that "play" has "sb.o" locked into
> memory?
> 
> Does this make more sense, guys? :-)

     fuser -v *
will tell which files or filesystems are held by 
which process, or if the kernel is the 'holder'.

--
I believe that the moment is near when by a procedure of
active paranoiac thought, it will be possible to systematize
confusion and contribute to the total discrediting of the
world of reality.       -- Salvador Dali