delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/03/17/11:05:37

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Thu, 17 Mar 2005 17:04:52 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: POSIX-compliance of link(2)
Message-ID: <20050317160452.GA3180@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <423980FB DOT 9070802 AT byu DOT net>
Mime-Version: 1.0
In-Reply-To: <423980FB.9070802@byu.net>
User-Agent: Mutt/1.4.2i

On Mar 17 06:07, Eric Blake wrote:
> According to POSIX, creating a hardlink to a symlink is supposed to be
> impossible, because link(2) is supposed to resolve symlinks before
> performing the actual link.  See
> http://www.opengroup.org/austin/mailarchives/ag/msg08153.html.

Regardless of this mail exchange, the ultimate word on this is the
SUSv3 man page, which shows no trace of demanding that link(2) follows
symlinks, see
http://www.opengroup.org/onlinepubs/009695399/functions/link.html

> $ ln -s a b
> $ link b c      # Bug: c should be a hard link to a, not b
> $ ls -l a b c
> - -rw-r--r--  1 eblake None 0 Mar 15 19:04 a
> lrwxrwxrwx  2 eblake None 1 Mar 15 19:04 b -> a
> lrwxrwxrwx  2 eblake None 1 Mar 15 19:04 c -> a

Ok, let's try this on Linux:

  $ uname -sr
  Linux 2.6.11
  $ rpm -q coreutils
  coreutils-5.2.1-1
  $ touch a
  $ ln -s a b
  $ link b c
  $ ls -l a b c
  -rw-r--r--  1 corinna users 0 2005-03-17 16:56 a
  lrwxrwxrwx  2 corinna users 1 2005-03-17 16:56 b -> a
  lrwxrwxrwx  2 corinna users 1 2005-03-17 16:56 c -> a

Same if I use ln(1) instead of link(1).  So?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019