Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 11 Aug 2002 16:08:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 11 Aug 2002 16:08:32 -0400 Received: from pc-62-30-255-50-az.blueyonder.co.uk ([62.30.255.50]:46284 "EHLO kushida.apsleyroad.org") by vger.kernel.org with ESMTP id ; Sun, 11 Aug 2002 16:08:32 -0400 Date: Sun, 11 Aug 2002 21:10:24 +0100 From: Jamie Lokier To: Alan Cox Cc: Linus Torvalds , Paul Larson , Hubertus Franke , Rik van Riel , Andries Brouwer , Andrew Morton , andrea@suse.de, Dave Jones , lkml Subject: Re: [PATCH] Linux-2.5 fix/improve get_pid() Message-ID: <20020811211024.C3206@kushida.apsleyroad.org> References: <20020810182317.A306@kushida.apsleyroad.org> <20020810194813.D306@kushida.apsleyroad.org> <1029098474.16236.58.camel@irongate.swansea.linux.org.uk> <20020811205847.A3206@kushida.apsleyroad.org> <1029101038.16424.74.camel@irongate.swansea.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <1029101038.16424.74.camel@irongate.swansea.linux.org.uk>; from alan@lxorguk.ukuu.org.uk on Sun, Aug 11, 2002 at 10:23:58PM +0100 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 864 Lines: 22 Alan Cox wrote: > > So, in general, the way to detect hard links requires both objects to be > > open at the same time? I was sure it was enough to stat(), and check > > (st1.st_ino == st2.st_ino && st1.st_dev == st2.st_dev). > > > > Admittedly, one of the object could be renamed or deleted in that time > > so it's not 100% reliable on changing filesystems. > > Hence you need both open at the same time. ... unless you know that what you're looking at isn't changing, or you only guarantee correct results for parts of the filesystem which don't change (`tar', `find' etc.) Again, /proc is exempt! :) -- Jamie - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/