Re: [PATCH] Linux-2.5 fix/improve get_pid()

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Sun Aug 11 2002 - 15:10:24 EST


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/



This archive was generated by hypermail 2b29 : Thu Aug 15 2002 - 22:00:25 EST