Date: Mon, 15 Feb 2010 09:48:07 -0600 From: Dan Nelson <dnelson@allantgroup.com> To: Yuri <yuri@rawbw.com> Cc: freebsd-questions@freebsd.org Subject: Re: Why lsof shows the file as open and fstat doesn't ? Message-ID: <20100215154806.GA70798@dan.emsphone.com> In-Reply-To: <4B790227.6090803@rawbw.com> References: <4B790227.6090803@rawbw.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Feb 15), Yuri said: > I am looking at one file which is actually a unix socket: > /tmp/dbus-iQmkLjgxD6. > "lsof | grep dbus-iQmkLjgxD6" shows that it's open by a particular > process many times: > ibus-daem 48407 yuri 4u unix 0xc966019c 0t0 /tmp/dbus-iQmkLjgxD6 > ibus-daem 48407 yuri 5u unix 0xc9569000 0t0 /tmp/dbus-iQmkLjgxD6 > ibus-daem 48407 yuri 6u unix 0xc955e9a8 0t0 /tmp/dbus-iQmkLjgxD6 > ibus-daem 48407 yuri 7u unix 0xc8d25000 0t0 /tmp/dbus-iQmkLjgxD6 > ibus-daem 48407 yuri 8u unix 0xc9596ce0 0t0 /tmp/dbus-iQmkLjgxD6 > ibus-daem 48407 yuri 9u unix 0xc8f9b19c 0t0 /tmp/dbus-iQmkLjgxD6 > ibus-daem 48407 yuri 10u unix 0xc916619c 0t0 /tmp/dbus-iQmkLjgxD6 > ibus-daem 48407 yuri 11u unix 0xc9547338 0t0 /tmp/dbus-iQmkLjgxD6 > ibus-daem 48407 yuri 12u unix 0xc9589670 0t0 /tmp/dbus-iQmkLjgxD6 > > But when I run "fstat /tmp/dbus-iQmkLjgxD6" it doesn't return anything, > like this file isn't open at all. > > Why there is such discrepancy? It looks like fstat doesn't work on unix sockets at all; I tried on /tmp/mysql.sock and some X11 sockets. -- Dan Nelson dnelson@allantgroup.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100215154806.GA70798>