Bug 17555

Summary: fstat(1) doesn't show memory-mapped files
Product: Base System Reporter: iedowse <iedowse>
Component: binAssignee: Brian Feldman <green>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.3-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
file.diff none

Description iedowse 2000-03-22 20:20:01 UTC
	fstat(1) is a useful tool for determining which processes hold
	references to a filesystem - I use it frequently to help resolve
	'Device busy' errors when attempting to unmount a filesystem.

	However, files that are memory-mapped into a process's address
	space don't show up (unless the file descriptor is still open).

	The patch included below makes fstat include mmap()'d files in
	its listing of open files for each process. The word 'mmap'
	appears in the FD column to indicate that this is a mmap()'d
	file.

	Most of the logic in the new dommap() function below is taken
	from procfs_map.c.
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2000-03-29 12:47:15 UTC
Responsible Changed
From-To: freebsd-bugs->green

Brian, since you seem to be beefing up fstat(1), could you look 
at this one?  Ian submits good PR's. :-) 
Comment 2 Brian Feldman freebsd_committer freebsd_triage 2000-04-04 03:33:05 UTC
State Changed
From-To: open->feedback

Do you think you could make it conditional on a flag?  This can potentially 
add 
a lot of overhead, so it shouldn't (IMHO) be default.  If you can take care 
of that, I'll commit it; however, if you don't have the time, I could do 
it, too. 
Comment 3 iedowse freebsd_committer freebsd_triage 2001-01-05 01:14:33 UTC
State Changed
From-To: feedback->closed

This was committed to -current some time ago, and has already been 
MFC'd (I submitted this PR, so I'll close it).