From owner-freebsd-questions@FreeBSD.ORG Mon Feb 15 15:48:12 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5875F106566C for ; Mon, 15 Feb 2010 15:48:12 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email1.allantgroup.com (email1.emsphone.com [199.67.51.115]) by mx1.freebsd.org (Postfix) with ESMTP id 00AB78FC1E for ; Mon, 15 Feb 2010 15:48:11 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by email1.allantgroup.com (8.14.0/8.14.0) with ESMTP id o1FFm9St002081 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 15 Feb 2010 09:48:09 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.4/8.14.3) with ESMTP id o1FFm8vU041689 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 15 Feb 2010 09:48:09 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.4/8.14.3/Submit) id o1FFm8NL041603; Mon, 15 Feb 2010 09:48:08 -0600 (CST) (envelope-from dan) Date: Mon, 15 Feb 2010 09:48:07 -0600 From: Dan Nelson To: Yuri Message-ID: <20100215154806.GA70798@dan.emsphone.com> References: <4B790227.6090803@rawbw.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B790227.6090803@rawbw.com> X-OS: FreeBSD 7.2-STABLE User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: clamav-milter 0.95.3 at email1.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (email1.allantgroup.com [199.67.51.78]); Mon, 15 Feb 2010 09:48:09 -0600 (CST) X-Scanned-By: MIMEDefang 2.45 Cc: freebsd-questions@freebsd.org Subject: Re: Why lsof shows the file as open and fstat doesn't ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 15:48:12 -0000 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