libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating lock file for compilers that don't support -c -o


From: Albert Chin
Subject: Re: Creating lock file for compilers that don't support -c -o
Date: Mon, 25 Aug 2003 22:01:19 -0500
User-agent: Mutt/1.4i

On Mon, Aug 25, 2003 at 02:06:06PM -0500, Bob Friesenhahn wrote:
> On Mon, 25 Aug 2003, Paul Jarc wrote:
> 
> > Bob Friesenhahn <address@hidden> wrote:
> > > Creating a hard link is an atomic operation whereas a symbolic link is
> > > not
> >
> > How so?
> 
> It has to do with the complexity of the operation, particularly if a
> network is involved.  Creating a hard link does not create a new file
> (allocate a new inode), it simply updates a directory table to
> reference an existing file.  This requires a single network request.
> Most importantly, it is documented to be atomic.  Creating a symbolic
> link requires testing for an existing file, and then (if the file does
> not exist) creating a new file, and a directory entry to reference it.
> This requires multiple network transactions with an opportunity for
> race-conditions.
>
> NAME
>      link - make a hard file link
> 
> LIBRARY
>      Standard C Library (libc, -lc)
> 
> SYNOPSIS
>      #include <unistd.h>
> 
>      int
>      link(const char *name1, const char *name2);
> 
> DESCRIPTION
>      The link() function call atomically creates the specified directory entry
>      (hard link) name2 with the attributes of the underlying object pointed at
>      by name1. ...
>
> ...
>

I'd rather see a link to the POSIX standard defining link as atomic.

-- 
albert chin (address@hidden)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]